1 /*
2 * FFM (ffserver live feed) muxer
3 * Copyright (c) 2001 Fabrice Bellard
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
29
31 {
33 int fill_size, h;
35
38
40
41 /* put header */
47 h |= 0x8000;
51
52 /* prepare next packet */
56 }
57
58 /* 'first' is true if first data of a frame */
61 int64_t dts, int header)
62 {
65
69 }
70
71 /* write as many packets as needed */
72 while (size > 0) {
74 if (len > size)
77
83 }
84 }
85
87 {
94 }
95
97 {
103 int bit_rate, i;
104
107 if (ret < 0)
109 }
110
112
113 /* header */
116 avio_wb64(pb, 0);
/* current write position */
117
120
122 bit_rate = 0;
126 }
128
130
131 /* list of streams */
137
139 /* generic info */
149 }
153 /* specific info */
200 break;
206 break;
207 default:
208 return -1;
209 }
210 }
212
214
215 /* flush until end of block reached */
218
220
221 /* init packet mux */
228
229 return 0;
230 }
231
233 {
235 int64_t dts;
238
240 /* packet size & key_frame */
242 header[1] = 0;
248 if (pkt->
pts != pkt->
dts) {
251 header_size += 4;
252 }
255
256 return 0;
257 }
258
260 {
262
263 /* flush packets */
266
267 return 0;
268 }
269
273 .extensions = "ffm",
281 };