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