Mercurial > libavformat.hg
annotate avformat.h @ 183:b3b056122bd8 libavformat
ATI VCR2
author | michaelni |
---|---|
date | Thu, 24 Jul 2003 23:37:40 +0000 |
parents | 808dabf5a88e |
children | 2438e76dde67 |
rev | line source |
---|---|
0 | 1 #ifndef AVFORMAT_H |
2 #define AVFORMAT_H | |
3 | |
39 | 4 #ifdef __cplusplus |
5 extern "C" { | |
6 #endif | |
7 | |
0 | 8 #define LIBAVFORMAT_VERSION_INT 0x000406 |
9 #define LIBAVFORMAT_VERSION "0.4.6" | |
115 | 10 #define LIBAVFORMAT_BUILD 4605 |
0 | 11 |
12 #include "avcodec.h" | |
13 | |
14 #include "avio.h" | |
15 | |
16 /* packet functions */ | |
17 | |
18 #define AV_NOPTS_VALUE 0 | |
19 | |
20 typedef struct AVPacket { | |
65 | 21 int64_t pts; /* presentation time stamp in stream units (set av_set_pts_info) */ |
22 uint8_t *data; | |
53
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
23 int size; |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
24 int stream_index; |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
25 int flags; |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
26 int duration; |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
27 void (*destruct)(struct AVPacket *); |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
28 void *priv; |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
29 } AVPacket; |
0 | 30 #define PKT_FLAG_KEY 0x0001 |
53
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
31 |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
32 static inline void av_init_packet(AVPacket *pkt) |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
33 { |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
34 pkt->pts = AV_NOPTS_VALUE; |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
35 pkt->flags = 0; |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
36 pkt->stream_index = 0; |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
37 } |
0 | 38 |
39 int av_new_packet(AVPacket *pkt, int size); | |
53
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
40 |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
41 /** |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
42 * Free a packet |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
43 * |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
44 * @param pkt packet to free |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
45 */ |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
46 static inline void av_free_packet(AVPacket *pkt) |
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
47 { |
163
470456bd0065
av_free_packet SEGV fix by (Arthur van Hoff (javanator))
michaelni
parents:
159
diff
changeset
|
48 if (pkt && pkt->destruct) { |
470456bd0065
av_free_packet SEGV fix by (Arthur van Hoff (javanator))
michaelni
parents:
159
diff
changeset
|
49 pkt->destruct(pkt); |
470456bd0065
av_free_packet SEGV fix by (Arthur van Hoff (javanator))
michaelni
parents:
159
diff
changeset
|
50 } |
53
fb671d87824e
zero copy packet handling for DV1394 by Max Krasnyansky
bellard
parents:
52
diff
changeset
|
51 } |
0 | 52 |
53 /*************************************************/ | |
54 /* fractional numbers for exact pts handling */ | |
55 | |
56 /* the exact value of the fractional number is: 'val + num / den'. num | |
57 is assumed to be such as 0 <= num < den */ | |
58 typedef struct AVFrac { | |
65 | 59 int64_t val, num, den; |
0 | 60 } AVFrac; |
61 | |
65 | 62 void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den); |
63 void av_frac_add(AVFrac *f, int64_t incr); | |
64 void av_frac_set(AVFrac *f, int64_t val); | |
0 | 65 |
66 /*************************************************/ | |
67 /* input/output formats */ | |
68 | |
69 struct AVFormatContext; | |
70 | |
71 /* this structure contains the data a format has to probe a file */ | |
72 typedef struct AVProbeData { | |
64 | 73 const char *filename; |
0 | 74 unsigned char *buf; |
75 int buf_size; | |
76 } AVProbeData; | |
77 | |
78 #define AVPROBE_SCORE_MAX 100 | |
79 | |
80 typedef struct AVFormatParameters { | |
81 int frame_rate; | |
85
25062c9b1f86
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
75
diff
changeset
|
82 int frame_rate_base; |
0 | 83 int sample_rate; |
84 int channels; | |
85 int width; | |
86 int height; | |
87 enum PixelFormat pix_fmt; | |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
88 struct AVImageFormat *image_format; |
30
90fd30dd68b3
grab device is in AVFormatParameter (at least better than global variable)
bellard
parents:
29
diff
changeset
|
89 int channel; /* used to select dv channel */ |
90fd30dd68b3
grab device is in AVFormatParameter (at least better than global variable)
bellard
parents:
29
diff
changeset
|
90 const char *device; /* video4linux, audio or DV device */ |
159
7d698c3213a0
tv standard selection support for dv1394 and grab (v4l)
al3x
parents:
151
diff
changeset
|
91 const char *standard; /* tv standard, NTSC, PAL, SECAM */ |
0 | 92 } AVFormatParameters; |
93 | |
94 #define AVFMT_NOFILE 0x0001 /* no file should be opened */ | |
95 #define AVFMT_NEEDNUMBER 0x0002 /* needs '%d' in filename */ | |
96 #define AVFMT_NOHEADER 0x0004 /* signal that no header is present | |
97 (streams are added dynamically) */ | |
98 #define AVFMT_SHOW_IDS 0x0008 /* show format stream IDs numbers */ | |
99 #define AVFMT_RAWPICTURE 0x0020 /* format wants AVPicture structure for | |
100 raw picture data */ | |
101 | |
102 typedef struct AVOutputFormat { | |
103 const char *name; | |
104 const char *long_name; | |
105 const char *mime_type; | |
106 const char *extensions; /* comma separated extensions */ | |
107 /* size of private data so that it can be allocated in the wrapper */ | |
108 int priv_data_size; | |
109 /* output support */ | |
110 enum CodecID audio_codec; /* default audio codec */ | |
111 enum CodecID video_codec; /* default video codec */ | |
112 int (*write_header)(struct AVFormatContext *); | |
113 /* XXX: change prototype for 64 bit pts */ | |
114 int (*write_packet)(struct AVFormatContext *, | |
115 int stream_index, | |
116 unsigned char *buf, int size, int force_pts); | |
117 int (*write_trailer)(struct AVFormatContext *); | |
118 /* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER */ | |
119 int flags; | |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
120 /* currently only used to set pixel format if not YUV420P */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
121 int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *); |
0 | 122 /* private fields */ |
123 struct AVOutputFormat *next; | |
124 } AVOutputFormat; | |
125 | |
126 typedef struct AVInputFormat { | |
127 const char *name; | |
128 const char *long_name; | |
129 /* size of private data so that it can be allocated in the wrapper */ | |
130 int priv_data_size; | |
131 /* tell if a given file has a chance of being parsing by this format */ | |
132 int (*read_probe)(AVProbeData *); | |
133 /* read the format header and initialize the AVFormatContext | |
134 structure. Return 0 if OK. 'ap' if non NULL contains | |
135 additionnal paramters. Only used in raw format right | |
136 now. 'av_new_stream' should be called to create new streams. */ | |
137 int (*read_header)(struct AVFormatContext *, | |
138 AVFormatParameters *ap); | |
139 /* read one packet and put it in 'pkt'. pts and flags are also | |
140 set. 'av_new_stream' can be called only if the flag | |
141 AVFMT_NOHEADER is used. */ | |
142 int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); | |
143 /* close the stream. The AVFormatContext and AVStreams are not | |
144 freed by this function */ | |
145 int (*read_close)(struct AVFormatContext *); | |
146 /* seek at or before a given pts (given in microsecond). The pts | |
147 origin is defined by the stream */ | |
65 | 148 int (*read_seek)(struct AVFormatContext *, int64_t pts); |
0 | 149 /* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_NOHEADER */ |
150 int flags; | |
151 /* if extensions are defined, then no probe is done. You should | |
152 usually not use extension format guessing because it is not | |
153 reliable enough */ | |
154 const char *extensions; | |
155 /* general purpose read only value that the format can use */ | |
156 int value; | |
157 /* private fields */ | |
158 struct AVInputFormat *next; | |
159 } AVInputFormat; | |
160 | |
161 typedef struct AVStream { | |
162 int index; /* stream index in AVFormatContext */ | |
163 int id; /* format specific stream id */ | |
164 AVCodecContext codec; /* codec context */ | |
165 int r_frame_rate; /* real frame rate of the stream */ | |
85
25062c9b1f86
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
75
diff
changeset
|
166 int r_frame_rate_base;/* real frame rate base of the stream */ |
0 | 167 uint64_t time_length; /* real length of the stream in miliseconds */ |
168 void *priv_data; | |
169 /* internal data used in av_find_stream_info() */ | |
170 int codec_info_state; | |
171 int codec_info_nb_repeat_frames; | |
172 int codec_info_nb_real_frames; | |
173 /* PTS generation when outputing stream */ | |
174 AVFrac pts; | |
175 /* ffmpeg.c private use */ | |
176 int stream_copy; /* if TRUE, just copy stream */ | |
5 | 177 /* quality, as it has been removed from AVCodecContext and put in AVVideoFrame |
178 * MN:dunno if thats the right place, for it */ | |
179 float quality; | |
0 | 180 } AVStream; |
181 | |
182 #define MAX_STREAMS 20 | |
183 | |
184 /* format I/O context */ | |
185 typedef struct AVFormatContext { | |
186 /* can only be iformat or oformat, not both at the same time */ | |
187 struct AVInputFormat *iformat; | |
188 struct AVOutputFormat *oformat; | |
189 void *priv_data; | |
190 ByteIOContext pb; | |
191 int nb_streams; | |
192 AVStream *streams[MAX_STREAMS]; | |
193 char filename[1024]; /* input or output filename */ | |
194 /* stream info */ | |
195 char title[512]; | |
196 char author[512]; | |
197 char copyright[512]; | |
198 char comment[512]; | |
199 int flags; /* format specific flags */ | |
200 /* private data for pts handling (do not modify directly) */ | |
201 int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */ | |
202 int pts_num, pts_den; /* value to convert to seconds */ | |
203 /* This buffer is only needed when packets were already buffered but | |
204 not decoded, for example to get the codec parameters in mpeg | |
205 streams */ | |
206 struct AVPacketList *packet_buffer; | |
207 } AVFormatContext; | |
208 | |
209 typedef struct AVPacketList { | |
210 AVPacket pkt; | |
211 struct AVPacketList *next; | |
212 } AVPacketList; | |
213 | |
214 extern AVInputFormat *first_iformat; | |
215 extern AVOutputFormat *first_oformat; | |
216 | |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
217 /* still image support */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
218 struct AVInputImageContext; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
219 typedef struct AVInputImageContext AVInputImageContext; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
220 |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
221 typedef struct AVImageInfo { |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
222 enum PixelFormat pix_fmt; /* requested pixel format */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
223 int width; /* requested width */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
224 int height; /* requested height */ |
115 | 225 int interleaved; /* image is interleaved (e.g. interleaved GIF) */ |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
226 AVPicture pict; /* returned allocated image */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
227 } AVImageInfo; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
228 |
112 | 229 /* AVImageFormat.flags field constants */ |
115 | 230 #define AVIMAGE_INTERLEAVED 0x0001 /* image format support interleaved output */ |
112 | 231 |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
232 typedef struct AVImageFormat { |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
233 const char *name; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
234 const char *extensions; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
235 /* tell if a given file has a chance of being parsing by this format */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
236 int (*img_probe)(AVProbeData *); |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
237 /* read a whole image. 'alloc_cb' is called when the image size is |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
238 known so that the caller can allocate the image. If 'allo_cb' |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
239 returns non zero, then the parsing is aborted. Return '0' if |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
240 OK. */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
241 int (*img_read)(ByteIOContext *, |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
242 int (*alloc_cb)(void *, AVImageInfo *info), void *); |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
243 /* write the image */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
244 int supported_pixel_formats; /* mask of supported formats for output */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
245 int (*img_write)(ByteIOContext *, AVImageInfo *); |
112 | 246 int flags; |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
247 struct AVImageFormat *next; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
248 } AVImageFormat; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
249 |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
250 void av_register_image_format(AVImageFormat *img_fmt); |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
251 AVImageFormat *av_probe_image_format(AVProbeData *pd); |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
252 AVImageFormat *guess_image_format(const char *filename); |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
253 int av_read_image(ByteIOContext *pb, const char *filename, |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
254 AVImageFormat *fmt, |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
255 int (*alloc_cb)(void *, AVImageInfo *info), void *opaque); |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
256 int av_write_image(ByteIOContext *pb, AVImageFormat *fmt, AVImageInfo *img); |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
257 |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
258 extern AVImageFormat *first_image_format; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
259 |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
260 extern AVImageFormat pnm_image_format; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
261 extern AVImageFormat pbm_image_format; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
262 extern AVImageFormat pgm_image_format; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
263 extern AVImageFormat ppm_image_format; |
109
c82a6062485e
added new netpbm pam format support (needed for alpha plane support)
bellard
parents:
89
diff
changeset
|
264 extern AVImageFormat pam_image_format; |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
265 extern AVImageFormat pgmyuv_image_format; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
266 extern AVImageFormat yuv_image_format; |
71 | 267 #ifdef CONFIG_ZLIB |
44 | 268 extern AVImageFormat png_image_format; |
71 | 269 #endif |
47
45308962220f
added jpeg image encoder and decoder (new YUV handling routines and mjpeg codec fixes are necessary to go further)
bellard
parents:
44
diff
changeset
|
270 extern AVImageFormat jpeg_image_format; |
52 | 271 extern AVImageFormat gif_image_format; |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
272 |
0 | 273 /* XXX: use automatic init with either ELF sections or C file parser */ |
274 /* modules */ | |
275 | |
276 /* mpeg.c */ | |
277 int mpegps_init(void); | |
278 | |
279 /* mpegts.c */ | |
280 extern AVInputFormat mpegts_demux; | |
281 int mpegts_init(void); | |
282 | |
283 /* rm.c */ | |
284 int rm_init(void); | |
285 | |
286 /* crc.c */ | |
287 int crc_init(void); | |
288 | |
289 /* img.c */ | |
290 int img_init(void); | |
291 | |
292 /* asf.c */ | |
293 int asf_init(void); | |
294 | |
295 /* avienc.c */ | |
296 int avienc_init(void); | |
297 | |
298 /* avidec.c */ | |
299 int avidec_init(void); | |
300 | |
301 /* swf.c */ | |
302 int swf_init(void); | |
303 | |
304 /* mov.c */ | |
305 int mov_init(void); | |
306 | |
164
99fbacf0f764
flash video (flv) support patch by (Garrick Meeker <gmeeker at theoryllc dot com>)
michaelni
parents:
163
diff
changeset
|
307 /* flvenc.c */ |
99fbacf0f764
flash video (flv) support patch by (Garrick Meeker <gmeeker at theoryllc dot com>)
michaelni
parents:
163
diff
changeset
|
308 int flvenc_init(void); |
99fbacf0f764
flash video (flv) support patch by (Garrick Meeker <gmeeker at theoryllc dot com>)
michaelni
parents:
163
diff
changeset
|
309 |
99fbacf0f764
flash video (flv) support patch by (Garrick Meeker <gmeeker at theoryllc dot com>)
michaelni
parents:
163
diff
changeset
|
310 /* flvdec.c */ |
99fbacf0f764
flash video (flv) support patch by (Garrick Meeker <gmeeker at theoryllc dot com>)
michaelni
parents:
163
diff
changeset
|
311 int flvdec_init(void); |
99fbacf0f764
flash video (flv) support patch by (Garrick Meeker <gmeeker at theoryllc dot com>)
michaelni
parents:
163
diff
changeset
|
312 |
0 | 313 /* jpeg.c */ |
314 int jpeg_init(void); | |
315 | |
316 /* gif.c */ | |
317 int gif_init(void); | |
318 | |
319 /* au.c */ | |
320 int au_init(void); | |
321 | |
146 | 322 /* amr.c */ |
323 int amr_init(void); | |
324 | |
0 | 325 /* wav.c */ |
326 int wav_init(void); | |
327 | |
328 /* raw.c */ | |
329 int raw_init(void); | |
330 | |
331 /* ogg.c */ | |
332 int ogg_init(void); | |
333 | |
334 /* dv.c */ | |
335 int dv_init(void); | |
336 | |
337 /* ffm.c */ | |
338 int ffm_init(void); | |
339 | |
340 /* rtsp.c */ | |
341 extern AVInputFormat redir_demux; | |
342 int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f); | |
343 | |
138 | 344 /* 4xm.c */ |
345 int fourxm_init(void); | |
346 | |
0 | 347 #include "rtp.h" |
348 | |
349 #include "rtsp.h" | |
350 | |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
351 /* yuv4mpeg.c */ |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
352 extern AVOutputFormat yuv4mpegpipe_oformat; |
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
353 |
0 | 354 /* utils.c */ |
355 void av_register_input_format(AVInputFormat *format); | |
356 void av_register_output_format(AVOutputFormat *format); | |
357 AVOutputFormat *guess_stream_format(const char *short_name, | |
358 const char *filename, const char *mime_type); | |
359 AVOutputFormat *guess_format(const char *short_name, | |
360 const char *filename, const char *mime_type); | |
361 | |
65 | 362 void av_hex_dump(uint8_t *buf, int size); |
0 | 363 |
364 void av_register_all(void); | |
365 | |
366 typedef struct FifoBuffer { | |
65 | 367 uint8_t *buffer; |
368 uint8_t *rptr, *wptr, *end; | |
0 | 369 } FifoBuffer; |
370 | |
371 int fifo_init(FifoBuffer *f, int size); | |
372 void fifo_free(FifoBuffer *f); | |
65 | 373 int fifo_size(FifoBuffer *f, uint8_t *rptr); |
374 int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr); | |
375 void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr); | |
0 | 376 |
377 /* media file input */ | |
378 AVInputFormat *av_find_input_format(const char *short_name); | |
379 AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); | |
380 int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, | |
381 AVInputFormat *fmt, | |
382 int buf_size, | |
383 AVFormatParameters *ap); | |
384 | |
385 #define AVERROR_UNKNOWN (-1) /* unknown error */ | |
386 #define AVERROR_IO (-2) /* i/o error */ | |
387 #define AVERROR_NUMEXPECTED (-3) /* number syntax expected in filename */ | |
388 #define AVERROR_INVALIDDATA (-4) /* invalid data found */ | |
389 #define AVERROR_NOMEM (-5) /* not enough memory */ | |
390 #define AVERROR_NOFMT (-6) /* unknown format */ | |
391 | |
392 int av_find_stream_info(AVFormatContext *ic); | |
393 int av_read_packet(AVFormatContext *s, AVPacket *pkt); | |
394 void av_close_input_file(AVFormatContext *s); | |
395 AVStream *av_new_stream(AVFormatContext *s, int id); | |
396 void av_set_pts_info(AVFormatContext *s, int pts_wrap_bits, | |
397 int pts_num, int pts_den); | |
398 | |
399 /* media file output */ | |
17
e1200dd82537
added simple still image format support to simplify image and imagepipe video formats
bellard
parents:
5
diff
changeset
|
400 int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap); |
0 | 401 int av_write_header(AVFormatContext *s); |
402 int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf, | |
403 int size); | |
404 int av_write_trailer(AVFormatContext *s); | |
405 | |
406 void dump_format(AVFormatContext *ic, | |
407 int index, | |
408 const char *url, | |
409 int is_output); | |
410 int parse_image_size(int *width_ptr, int *height_ptr, const char *str); | |
168 | 411 int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg); |
65 | 412 int64_t parse_date(const char *datestr, int duration); |
0 | 413 |
65 | 414 int64_t av_gettime(void); |
0 | 415 |
416 /* ffm specific for ffserver */ | |
417 #define FFM_PACKET_SIZE 4096 | |
418 offset_t ffm_read_write_index(int fd); | |
419 void ffm_write_write_index(int fd, offset_t pos); | |
420 void ffm_set_write_index(AVFormatContext *s, offset_t pos, offset_t file_size); | |
421 | |
422 int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); | |
423 | |
424 int get_frame_filename(char *buf, int buf_size, | |
425 const char *path, int number); | |
426 int filename_number_test(const char *filename); | |
427 | |
428 /* grab specific */ | |
429 int video_grab_init(void); | |
430 int audio_init(void); | |
431 | |
29 | 432 /* DV1394 */ |
433 int dv1394_init(void); | |
0 | 434 |
435 #ifdef HAVE_AV_CONFIG_H | |
436 int strstart(const char *str, const char *val, const char **ptr); | |
437 int stristart(const char *str, const char *val, const char **ptr); | |
438 void pstrcpy(char *buf, int buf_size, const char *str); | |
439 char *pstrcat(char *buf, int buf_size, const char *s); | |
440 | |
151 | 441 void __dynarray_add(unsigned long **tab_ptr, int *nb_ptr, unsigned long elem); |
442 | |
443 #define dynarray_add(tab, nb_ptr, elem)\ | |
444 do {\ | |
445 typeof(tab) _tab = (tab);\ | |
446 typeof(elem) _elem = (elem);\ | |
447 (void)sizeof(**_tab == _elem); /* check that types are compatible */\ | |
448 __dynarray_add((unsigned long **)_tab, nb_ptr, (unsigned long)_elem);\ | |
449 } while(0) | |
450 | |
0 | 451 struct in_addr; |
452 int resolve_host(struct in_addr *sin_addr, const char *hostname); | |
453 | |
454 void url_split(char *proto, int proto_size, | |
455 char *hostname, int hostname_size, | |
456 int *port_ptr, | |
457 char *path, int path_size, | |
458 const char *url); | |
459 | |
460 int match_ext(const char *filename, const char *extensions); | |
461 | |
462 #endif /* HAVE_AV_CONFIG_H */ | |
463 | |
39 | 464 #ifdef __cplusplus |
465 } | |
466 #endif | |
467 | |
0 | 468 #endif /* AVFORMAT_H */ |