Mercurial > libavformat.hg
comparison avformat.h @ 293:62cec412a186 libavformat
make AVFMT_NOHEADER flag dynamic - added av_open_input_stream()
author | bellard |
---|---|
date | Wed, 29 Oct 2003 14:20:56 +0000 |
parents | 9fa2ec3b9982 |
children | 2833c2311b66 |
comparison
equal
deleted
inserted
replaced
292:155ce13f1033 | 293:62cec412a186 |
---|---|
3 | 3 |
4 #ifdef __cplusplus | 4 #ifdef __cplusplus |
5 extern "C" { | 5 extern "C" { |
6 #endif | 6 #endif |
7 | 7 |
8 #define LIBAVFORMAT_BUILD 4608 | 8 #define LIBAVFORMAT_BUILD 4609 |
9 | 9 |
10 #define LIBAVFORMAT_VERSION_INT FFMPEG_VERSION_INT | 10 #define LIBAVFORMAT_VERSION_INT FFMPEG_VERSION_INT |
11 #define LIBAVFORMAT_VERSION FFMPEG_VERSION | 11 #define LIBAVFORMAT_VERSION FFMPEG_VERSION |
12 #define LIBAVFORMAT_IDENT "FFmpeg" FFMPEG_VERSION "b" AV_STRINGIFY(LIBAVFORMAT_BUILD) | 12 #define LIBAVFORMAT_IDENT "FFmpeg" FFMPEG_VERSION "b" AV_STRINGIFY(LIBAVFORMAT_BUILD) |
13 | 13 |
40 void (*destruct)(struct AVPacket *); | 40 void (*destruct)(struct AVPacket *); |
41 void *priv; | 41 void *priv; |
42 } AVPacket; | 42 } AVPacket; |
43 #define PKT_FLAG_KEY 0x0001 | 43 #define PKT_FLAG_KEY 0x0001 |
44 | 44 |
45 /* initialize optional fields of a packet */ | |
45 static inline void av_init_packet(AVPacket *pkt) | 46 static inline void av_init_packet(AVPacket *pkt) |
46 { | 47 { |
47 pkt->pts = AV_NOPTS_VALUE; | 48 pkt->pts = AV_NOPTS_VALUE; |
48 pkt->flags = 0; | 49 pkt->flags = 0; |
49 pkt->stream_index = 0; | 50 pkt->stream_index = 0; |
100 enum PixelFormat pix_fmt; | 101 enum PixelFormat pix_fmt; |
101 struct AVImageFormat *image_format; | 102 struct AVImageFormat *image_format; |
102 int channel; /* used to select dv channel */ | 103 int channel; /* used to select dv channel */ |
103 const char *device; /* video4linux, audio or DV device */ | 104 const char *device; /* video4linux, audio or DV device */ |
104 const char *standard; /* tv standard, NTSC, PAL, SECAM */ | 105 const char *standard; /* tv standard, NTSC, PAL, SECAM */ |
106 int mpeg2ts_raw:1; /* force raw MPEG2 transport stream output, if possible */ | |
107 int mpeg2ts_compute_pcr:1; /* compute exact PCR for each transport | |
108 stream packet (only meaningful if | |
109 mpeg2ts_raw is TRUE */ | |
105 } AVFormatParameters; | 110 } AVFormatParameters; |
106 | 111 |
107 #define AVFMT_NOFILE 0x0001 /* no file should be opened */ | 112 #define AVFMT_NOFILE 0x0001 /* no file should be opened */ |
108 #define AVFMT_NEEDNUMBER 0x0002 /* needs '%d' in filename */ | 113 #define AVFMT_NEEDNUMBER 0x0002 /* needs '%d' in filename */ |
109 #define AVFMT_NOHEADER 0x0004 /* signal that no header is present | |
110 (streams are added dynamically) */ | |
111 #define AVFMT_SHOW_IDS 0x0008 /* show format stream IDs numbers */ | 114 #define AVFMT_SHOW_IDS 0x0008 /* show format stream IDs numbers */ |
112 #define AVFMT_RAWPICTURE 0x0020 /* format wants AVPicture structure for | 115 #define AVFMT_RAWPICTURE 0x0020 /* format wants AVPicture structure for |
113 raw picture data */ | 116 raw picture data */ |
114 | 117 |
115 typedef struct AVOutputFormat { | 118 typedef struct AVOutputFormat { |
148 now. 'av_new_stream' should be called to create new streams. */ | 151 now. 'av_new_stream' should be called to create new streams. */ |
149 int (*read_header)(struct AVFormatContext *, | 152 int (*read_header)(struct AVFormatContext *, |
150 AVFormatParameters *ap); | 153 AVFormatParameters *ap); |
151 /* read one packet and put it in 'pkt'. pts and flags are also | 154 /* read one packet and put it in 'pkt'. pts and flags are also |
152 set. 'av_new_stream' can be called only if the flag | 155 set. 'av_new_stream' can be called only if the flag |
153 AVFMT_NOHEADER is used. */ | 156 AVFMTCTX_NOHEADER is used. */ |
154 int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); | 157 int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); |
155 /* close the stream. The AVFormatContext and AVStreams are not | 158 /* close the stream. The AVFormatContext and AVStreams are not |
156 freed by this function */ | 159 freed by this function */ |
157 int (*read_close)(struct AVFormatContext *); | 160 int (*read_close)(struct AVFormatContext *); |
158 /* seek at or before a given pts (given in microsecond). The pts | 161 /* seek at or before a given pts (given in microsecond). The pts |
159 origin is defined by the stream */ | 162 origin is defined by the stream */ |
160 int (*read_seek)(struct AVFormatContext *, int64_t pts); | 163 int (*read_seek)(struct AVFormatContext *, int64_t pts); |
161 /* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_NOHEADER */ | 164 /* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER */ |
162 int flags; | 165 int flags; |
163 /* if extensions are defined, then no probe is done. You should | 166 /* if extensions are defined, then no probe is done. You should |
164 usually not use extension format guessing because it is not | 167 usually not use extension format guessing because it is not |
165 reliable enough */ | 168 reliable enough */ |
166 const char *extensions; | 169 const char *extensions; |
179 void *priv_data; | 182 void *priv_data; |
180 /* internal data used in av_find_stream_info() */ | 183 /* internal data used in av_find_stream_info() */ |
181 int codec_info_state; | 184 int codec_info_state; |
182 int codec_info_nb_repeat_frames; | 185 int codec_info_nb_repeat_frames; |
183 int codec_info_nb_real_frames; | 186 int codec_info_nb_real_frames; |
184 /* PTS generation when outputing stream */ | 187 /* encoding: PTS generation when outputing stream */ |
185 AVFrac pts; | 188 AVFrac pts; |
186 /* ffmpeg.c private use */ | 189 /* ffmpeg.c private use */ |
187 int stream_copy; /* if TRUE, just copy stream */ | 190 int stream_copy; /* if TRUE, just copy stream */ |
188 /* quality, as it has been removed from AVCodecContext and put in AVVideoFrame | 191 /* quality, as it has been removed from AVCodecContext and put in AVVideoFrame |
189 * MN:dunno if thats the right place, for it */ | 192 * MN:dunno if thats the right place, for it */ |
193 int64_t start_time; | 196 int64_t start_time; |
194 /* decoding: duration of the stream, in AV_TIME_BASE fractional | 197 /* decoding: duration of the stream, in AV_TIME_BASE fractional |
195 seconds. */ | 198 seconds. */ |
196 int64_t duration; | 199 int64_t duration; |
197 } AVStream; | 200 } AVStream; |
201 | |
202 #define AVFMTCTX_NOHEADER 0x0001 /* signal that no header is present | |
203 (streams are added dynamically) */ | |
198 | 204 |
199 #define MAX_STREAMS 20 | 205 #define MAX_STREAMS 20 |
200 | 206 |
201 /* format I/O context */ | 207 /* format I/O context */ |
202 typedef struct AVFormatContext { | 208 typedef struct AVFormatContext { |
216 char album[512]; | 222 char album[512]; |
217 int year; /* ID3 year, 0 if none */ | 223 int year; /* ID3 year, 0 if none */ |
218 int track; /* track number, 0 if none */ | 224 int track; /* track number, 0 if none */ |
219 char genre[32]; /* ID3 genre */ | 225 char genre[32]; /* ID3 genre */ |
220 | 226 |
221 int flags; /* format specific flags */ | 227 int ctx_flags; /* format specific flags, see AVFMTCTX_xx */ |
222 /* private data for pts handling (do not modify directly) */ | 228 /* private data for pts handling (do not modify directly) */ |
223 int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */ | 229 int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */ |
224 int pts_num, pts_den; /* value to convert to seconds */ | 230 int pts_num, pts_den; /* value to convert to seconds */ |
225 /* This buffer is only needed when packets were already buffered but | 231 /* This buffer is only needed when packets were already buffered but |
226 not decoded, for example to get the codec parameters in mpeg | 232 not decoded, for example to get the codec parameters in mpeg |
446 void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr); | 452 void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr); |
447 | 453 |
448 /* media file input */ | 454 /* media file input */ |
449 AVInputFormat *av_find_input_format(const char *short_name); | 455 AVInputFormat *av_find_input_format(const char *short_name); |
450 AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); | 456 AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); |
457 int av_open_input_stream(AVFormatContext **ic_ptr, | |
458 ByteIOContext *pb, const char *filename, | |
459 AVInputFormat *fmt, AVFormatParameters *ap); | |
451 int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, | 460 int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, |
452 AVInputFormat *fmt, | 461 AVInputFormat *fmt, |
453 int buf_size, | 462 int buf_size, |
454 AVFormatParameters *ap); | 463 AVFormatParameters *ap); |
455 | 464 |