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