Statistics
| Branch: | Revision:

ffmpeg / libavformat / avformat.h @ 4815e246

History | View | Annotate | Download (42.7 KB)

1 04d7f601 Diego Biurrun
/*
2
 * copyright (c) 2001 Fabrice Bellard
3
 *
4 b78e7197 Diego Biurrun
 * This file is part of FFmpeg.
5
 *
6
 * FFmpeg is free software; you can redistribute it and/or
7 04d7f601 Diego Biurrun
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9 b78e7197 Diego Biurrun
 * version 2.1 of the License, or (at your option) any later version.
10 04d7f601 Diego Biurrun
 *
11 b78e7197 Diego Biurrun
 * FFmpeg is distributed in the hope that it will be useful,
12 04d7f601 Diego Biurrun
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17 b78e7197 Diego Biurrun
 * License along with FFmpeg; if not, write to the Free Software
18 04d7f601 Diego Biurrun
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
 */
20
21 98790382 Stefano Sabatini
#ifndef AVFORMAT_AVFORMAT_H
22
#define AVFORMAT_AVFORMAT_H
23 de6d9b64 Fabrice Bellard
24 800c289a Måns Rullgård
#define LIBAVFORMAT_VERSION_MAJOR 52
25 7eb68edb Baptiste Coudurier
#define LIBAVFORMAT_VERSION_MINOR 25
26
#define LIBAVFORMAT_VERSION_MICRO  0
27 e97ac1e6 Måns Rullgård
28 800c289a Måns Rullgård
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
29
                                               LIBAVFORMAT_VERSION_MINOR, \
30
                                               LIBAVFORMAT_VERSION_MICRO)
31
#define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \
32
                                           LIBAVFORMAT_VERSION_MINOR,   \
33
                                           LIBAVFORMAT_VERSION_MICRO)
34 5aa083ee Michael Niedermayer
#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
35 8026c3b5 Alex Beregszaszi
36 5aa083ee Michael Niedermayer
#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
37 4b1f4f23 Juanjo
38 c97429e2 Stefano Sabatini
/**
39
 * Returns the LIBAVFORMAT_VERSION_INT constant.
40
 */
41
unsigned avformat_version(void);
42
43 f71869a4 Fabrice Bellard
#include <time.h>
44 67070e4f Zdenek Kabelac
#include <stdio.h>  /* FILE */
45 76a448ed Måns Rullgård
#include "libavcodec/avcodec.h"
46 de6d9b64 Fabrice Bellard
47
#include "avio.h"
48
49 a6d18a0e Michael Niedermayer
50
/*
51 ea29242c Mike Melanson
 * Public Metadata API.
52
 * The metadata API allows libavformat to export metadata tags to a client
53
 * application using a sequence of key/value pairs.
54
 * Important concepts to keep in mind:
55
 * 1. Keys are unique; there can never be 2 tags with the same key. This is
56
 *    also meant semantically, i.e., a demuxer should not knowingly produce
57
 *    several keys that are literally different but semantically identical.
58
 *    E.g., key=Author5, key=Author6. In this example, all authors must be
59
 *    placed in the same tag.
60
 * 2. Metadata is flat, not hierarchical; there are no subtags. If you
61
 *    want to store, e.g., the email address of the child of producer Alice
62
 *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
63
 * 3. A tag whose value is localized for a particular language is appended
64
 *    with a dash character ('-') and the ISO 639 3-letter language code.
65
 *    For example: Author-ger=Michael, Author-eng=Mike
66
 *    The original/default language is in the unqualified "Author" tag.
67 a6d18a0e Michael Niedermayer
 *    A demuxer should set a default if it sets any translated tag.
68
 */
69
70 48a81c0f Aurelien Jacobs
#define AV_METADATA_MATCH_CASE      1
71 a6d18a0e Michael Niedermayer
#define AV_METADATA_IGNORE_SUFFIX   2
72
73
typedef struct {
74
    char *key;
75
    char *value;
76 bc1d2afb Aurelien Jacobs
}AVMetadataTag;
77 a6d18a0e Michael Niedermayer
78 e232c252 Aurelien Jacobs
typedef struct AVMetadata AVMetadata;
79 a6d18a0e Michael Niedermayer
80
/**
81
 * gets a metadata element with matching key.
82
 * @param prev set to the previous matching element to find the next.
83
 * @param flags allows case as well as suffix insensitive comparissions.
84
 * @return found tag or NULL, changing key or value leads to undefined behavior.
85
 */
86 bc1d2afb Aurelien Jacobs
AVMetadataTag *
87 e232c252 Aurelien Jacobs
av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags);
88 a6d18a0e Michael Niedermayer
89
/**
90
 * sets the given tag in m, overwriting an existing tag.
91
 * @param tag tag to add to m, key and value will be av_strduped.
92
 * @return >= 0 if success otherwise error code that is <0.
93
 */
94 e232c252 Aurelien Jacobs
int av_metadata_set(AVMetadata **m, AVMetadataTag tag);
95 a6d18a0e Michael Niedermayer
96 094d9df7 Aurelien Jacobs
/**
97
 * Free all the memory allocated for an AVMetadata struct.
98
 */
99
void av_metadata_free(AVMetadata **m);
100
101 a6d18a0e Michael Niedermayer
102 de6d9b64 Fabrice Bellard
/* packet functions */
103
104
typedef struct AVPacket {
105 f6e76ba4 Michael Niedermayer
    /**
106 4f57fa8c Diego Biurrun
     * Presentation timestamp in time_base units.
107 f6e76ba4 Michael Niedermayer
     * This is the time at which the decompressed packet will be presented
108
     * to the user.
109
     * Can be AV_NOPTS_VALUE if it is not stored in the file.
110 4f57fa8c Diego Biurrun
     * pts MUST be larger or equal to dts as presentation cannot happen before
111 f6e76ba4 Michael Niedermayer
     * decompression, unless one wants to view hex dumps. Some formats misuse
112
     * the terms dts and pts/cts to mean something different, these timestamps
113
     * must be converted to true pts/dts before they are stored in AVPacket.
114
     */
115
    int64_t pts;
116
    /**
117 4f57fa8c Diego Biurrun
     * Decompression timestamp in time_base units.
118 f6e76ba4 Michael Niedermayer
     * This is the time at which the packet is decompressed.
119
     * Can be AV_NOPTS_VALUE if it is not stored in the file.
120
     */
121
    int64_t dts;
122 0c1a9eda Zdenek Kabelac
    uint8_t *data;
123 6fa5a56c Fabrice Bellard
    int   size;
124
    int   stream_index;
125
    int   flags;
126 a82630de Michael Niedermayer
    /**
127
     * Duration of this packet in time_base units, 0 if unknown.
128
     * Equals next_pts - this_pts in presentation order.
129
     */
130
    int   duration;
131 6fa5a56c Fabrice Bellard
    void  (*destruct)(struct AVPacket *);
132
    void  *priv;
133 2692067a Michael Niedermayer
    int64_t pos;                            ///< byte position in stream, -1 if unknown
134 a2636c0f Michael Niedermayer
135
    /**
136 4f57fa8c Diego Biurrun
     * Time difference in stream time base units from the pts of this
137 e7f656d5 Michael Niedermayer
     * packet to the point at which the output from the decoder has converged
138 4f57fa8c Diego Biurrun
     * independent from the availability of previous frames. That is, the
139
     * frames are virtually identical no matter if decoding started from
140
     * the very first frame or from this keyframe.
141
     * Is AV_NOPTS_VALUE if unknown.
142 e7f656d5 Michael Niedermayer
     * This field is not the display duration of the current packet.
143 a2636c0f Michael Niedermayer
     *
144
     * The purpose of this field is to allow seeking in streams that have no
145
     * keyframes in the conventional sense. It corresponds to the
146 4f57fa8c Diego Biurrun
     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
147 a2636c0f Michael Niedermayer
     * essential for some types of subtitle streams to ensure that all
148
     * subtitles are correctly displayed after seeking.
149
     */
150
    int64_t convergence_duration;
151 115329f1 Diego Biurrun
} AVPacket;
152 6fa5a56c Fabrice Bellard
#define PKT_FLAG_KEY   0x0001
153
154 63dd1377 Michael Niedermayer
void av_destruct_packet_nofree(AVPacket *pkt);
155 3217cb42 Panagiotis Issaris
156
/**
157
 * Default packet destructor.
158
 */
159 90ad92b3 Michael Niedermayer
void av_destruct_packet(AVPacket *pkt);
160 63dd1377 Michael Niedermayer
161 05abfce9 Ramiro Polla
/**
162 4f57fa8c Diego Biurrun
 * Initialize optional fields of a packet with default values.
163 05abfce9 Ramiro Polla
 *
164
 * @param pkt packet
165
 */
166 659596f0 Ramiro Polla
void av_init_packet(AVPacket *pkt);
167 de6d9b64 Fabrice Bellard
168 3217cb42 Panagiotis Issaris
/**
169 4f57fa8c Diego Biurrun
 * Allocate the payload of a packet and initialize its fields with
170
 * default values.
171 3217cb42 Panagiotis Issaris
 *
172
 * @param pkt packet
173
 * @param size wanted payload size
174 4f57fa8c Diego Biurrun
 * @return 0 if OK, AVERROR_xxx otherwise
175 3217cb42 Panagiotis Issaris
 */
176 de6d9b64 Fabrice Bellard
int av_new_packet(AVPacket *pkt, int size);
177 3217cb42 Panagiotis Issaris
178
/**
179 4f57fa8c Diego Biurrun
 * Allocate and read the payload of a packet and initialize its fields with
180
 * default values.
181 3217cb42 Panagiotis Issaris
 *
182
 * @param pkt packet
183 4f57fa8c Diego Biurrun
 * @param size desired payload size
184
 * @return >0 (read size) if OK, AVERROR_xxx otherwise
185 3217cb42 Panagiotis Issaris
 */
186 2692067a Michael Niedermayer
int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size);
187 3217cb42 Panagiotis Issaris
188 43d414ba Panagiotis Issaris
/**
189
 * @warning This is a hack - the packet memory allocation stuff is broken. The
190 4f57fa8c Diego Biurrun
 * packet is allocated if it was not really allocated.
191 43d414ba Panagiotis Issaris
 */
192 fb2758c8 Fabrice Bellard
int av_dup_packet(AVPacket *pkt);
193 6fa5a56c Fabrice Bellard
194
/**
195 4f57fa8c Diego Biurrun
 * Free a packet.
196 6fa5a56c Fabrice Bellard
 *
197
 * @param pkt packet to free
198
 */
199
static inline void av_free_packet(AVPacket *pkt)
200
{
201 342474ab Michael Niedermayer
    if (pkt && pkt->destruct) {
202 bb270c08 Diego Biurrun
        pkt->destruct(pkt);
203 342474ab Michael Niedermayer
    }
204 6fa5a56c Fabrice Bellard
}
205 de6d9b64 Fabrice Bellard
206
/*************************************************/
207 916c80e9 Fabrice Bellard
/* fractional numbers for exact pts handling */
208
209 671adb17 Mark Cox
/**
210 4f57fa8c Diego Biurrun
 * The exact value of the fractional number is: 'val + num / den'.
211
 * num is assumed to be 0 <= num < den.
212
 * @deprecated Use AVRational instead.
213 671adb17 Mark Cox
*/
214 916c80e9 Fabrice Bellard
typedef struct AVFrac {
215 115329f1 Diego Biurrun
    int64_t val, num, den;
216 52e57500 Diego Biurrun
} AVFrac;
217 916c80e9 Fabrice Bellard
218
/*************************************************/
219 b9a281db Fabrice Bellard
/* input/output formats */
220 de6d9b64 Fabrice Bellard
221 7caf0cc6 Michael Niedermayer
struct AVCodecTag;
222
223 de6d9b64 Fabrice Bellard
struct AVFormatContext;
224 b9a281db Fabrice Bellard
225 4f57fa8c Diego Biurrun
/** This structure contains the data a format has to probe a file. */
226 b9a281db Fabrice Bellard
typedef struct AVProbeData {
227 5c91a675 Zdenek Kabelac
    const char *filename;
228 b9a281db Fabrice Bellard
    unsigned char *buf;
229
    int buf_size;
230
} AVProbeData;
231
232 4f57fa8c Diego Biurrun
#define AVPROBE_SCORE_MAX 100               ///< Maximum score, half of that is used for file-extension-based detection.
233 87e87886 Michael Niedermayer
#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
234 de6d9b64 Fabrice Bellard
235
typedef struct AVFormatParameters {
236 c0df9d75 Michael Niedermayer
    AVRational time_base;
237 de6d9b64 Fabrice Bellard
    int sample_rate;
238
    int channels;
239
    int width;
240
    int height;
241 4606ac8d Zdenek Kabelac
    enum PixelFormat pix_fmt;
242 4f57fa8c Diego Biurrun
    int channel; /**< Used to select DV channel. */
243
    const char *standard; /**< TV standard, NTSC, PAL, SECAM */
244
    unsigned int mpeg2ts_raw:1;  /**< Force raw MPEG-2 transport stream output, if possible. */
245
    unsigned int mpeg2ts_compute_pcr:1; /**< Compute exact PCR for each transport
246 72e043dd Erik Hovland
                                            stream packet (only meaningful if
247 4f57fa8c Diego Biurrun
                                            mpeg2ts_raw is TRUE). */
248
    unsigned int initial_pause:1;       /**< Do not begin to play the stream
249
                                            immediately (RTSP only). */
250 72e043dd Erik Hovland
    unsigned int prealloced_context:1;
251 71957315 Michael Niedermayer
#if LIBAVFORMAT_VERSION_INT < (53<<16)
252 5b6d5596 Michael Niedermayer
    enum CodecID video_codec_id;
253
    enum CodecID audio_codec_id;
254 71957315 Michael Niedermayer
#endif
255 de6d9b64 Fabrice Bellard
} AVFormatParameters;
256
257 4f57fa8c Diego Biurrun
//! Demuxer will use url_fopen, no opened file should be provided by the caller.
258 40d9c544 Reimar Döffinger
#define AVFMT_NOFILE        0x0001
259 4f57fa8c Diego Biurrun
#define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */
260
#define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */
261
#define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for
262
                                      raw picture data. */
263
#define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */
264
#define AVFMT_NOTIMESTAMPS  0x0080 /**< Format does not need / have any timestamps. */
265
#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
266
#define AVFMT_TS_DISCONT    0x0200 /**< Format allows timestamp discontinuities. */
267 b9a281db Fabrice Bellard
268
typedef struct AVOutputFormat {
269 de6d9b64 Fabrice Bellard
    const char *name;
270 bde15e74 Stefano Sabatini
    /**
271
     * Descriptive name for the format, meant to be more human-readable
272
     * than \p name. You \e should use the NULL_IF_CONFIG_SMALL() macro
273
     * to define it.
274
     */
275 de6d9b64 Fabrice Bellard
    const char *long_name;
276
    const char *mime_type;
277 4f57fa8c Diego Biurrun
    const char *extensions; /**< comma-separated filename extensions */
278
    /** Size of private data so that it can be allocated in the wrapper. */
279 b9a281db Fabrice Bellard
    int priv_data_size;
280 de6d9b64 Fabrice Bellard
    /* output support */
281 43d414ba Panagiotis Issaris
    enum CodecID audio_codec; /**< default audio codec */
282
    enum CodecID video_codec; /**< default video codec */
283 de6d9b64 Fabrice Bellard
    int (*write_header)(struct AVFormatContext *);
284 e928649b Michael Niedermayer
    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
285 de6d9b64 Fabrice Bellard
    int (*write_trailer)(struct AVFormatContext *);
286 43d414ba Panagiotis Issaris
    /** can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER */
287 b9a281db Fabrice Bellard
    int flags;
288 4f57fa8c Diego Biurrun
    /** Currently only used to set pixel format if not YUV420P. */
289 290c5fa6 Fabrice Bellard
    int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *);
290 78cb7273 Diego Biurrun
    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
291
                             AVPacket *in, int flush);
292 7caf0cc6 Michael Niedermayer
293
    /**
294 78cb7273 Diego Biurrun
     * List of supported codec_id-codec_tag pairs, ordered by "better
295
     * choice first". The arrays are all CODEC_ID_NONE terminated.
296 7caf0cc6 Michael Niedermayer
     */
297 c1854592 Reimar Döffinger
    const struct AVCodecTag * const *codec_tag;
298 7caf0cc6 Michael Niedermayer
299 11bf3847 Aurelien Jacobs
    enum CodecID subtitle_codec; /**< default subtitle codec */
300
301 b9a281db Fabrice Bellard
    /* private fields */
302
    struct AVOutputFormat *next;
303
} AVOutputFormat;
304 de6d9b64 Fabrice Bellard
305 b9a281db Fabrice Bellard
typedef struct AVInputFormat {
306
    const char *name;
307 bde15e74 Stefano Sabatini
    /**
308
     * Descriptive name for the format, meant to be more human-readable
309
     * than \p name. You \e should use the NULL_IF_CONFIG_SMALL() macro
310
     * to define it.
311
     */
312 b9a281db Fabrice Bellard
    const char *long_name;
313 4f57fa8c Diego Biurrun
    /** Size of private data so that it can be allocated in the wrapper. */
314 b9a281db Fabrice Bellard
    int priv_data_size;
315 65d7d68b Michael Niedermayer
    /**
316 5d81d641 Diego Biurrun
     * Tell if a given file has a chance of being parsed by this format.
317
     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
318
     * big so you do not have to check for that unless you need more.
319 65d7d68b Michael Niedermayer
     */
320 b9a281db Fabrice Bellard
    int (*read_probe)(AVProbeData *);
321 4f57fa8c Diego Biurrun
    /** Read the format header and initialize the AVFormatContext
322
       structure. Return 0 if OK. 'ap' if non-NULL contains
323
       additional parameters. Only used in raw format right
324 b9a281db Fabrice Bellard
       now. 'av_new_stream' should be called to create new streams.  */
325 de6d9b64 Fabrice Bellard
    int (*read_header)(struct AVFormatContext *,
326
                       AVFormatParameters *ap);
327 4f57fa8c Diego Biurrun
    /** Read one packet and put it in 'pkt'. pts and flags are also
328 b9a281db Fabrice Bellard
       set. 'av_new_stream' can be called only if the flag
329 da24c5e3 Fabrice Bellard
       AVFMTCTX_NOHEADER is used. */
330 de6d9b64 Fabrice Bellard
    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
331 4f57fa8c Diego Biurrun
    /** Close the stream. The AVFormatContext and AVStreams are not
332 de6d9b64 Fabrice Bellard
       freed by this function */
333
    int (*read_close)(struct AVFormatContext *);
334 115329f1 Diego Biurrun
    /**
335 4f57fa8c Diego Biurrun
     * Seek to a given timestamp relative to the frames in
336
     * stream component stream_index.
337 3ba1438d Michael Niedermayer
     * @param stream_index must not be -1
338 115329f1 Diego Biurrun
     * @param flags selects which direction should be preferred if no exact
339 3ba1438d Michael Niedermayer
     *              match is available
340 05ce0f11 Maksym Veremeyenko
     * @return >= 0 on success (but not necessarily the new offset)
341 3ba1438d Michael Niedermayer
     */
342 115329f1 Diego Biurrun
    int (*read_seek)(struct AVFormatContext *,
343 3ba1438d Michael Niedermayer
                     int stream_index, int64_t timestamp, int flags);
344 8d14a25c Michael Niedermayer
    /**
345 4f57fa8c Diego Biurrun
     * Gets the next timestamp in stream[stream_index].time_base units.
346 d9526386 Diego Biurrun
     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
347 8d14a25c Michael Niedermayer
     */
348
    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
349
                              int64_t *pos, int64_t pos_limit);
350 4f57fa8c Diego Biurrun
    /** Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. */
351 de6d9b64 Fabrice Bellard
    int flags;
352 4f57fa8c Diego Biurrun
    /** If extensions are defined, then no probe is done. You should
353 b9a281db Fabrice Bellard
       usually not use extension format guessing because it is not
354
       reliable enough */
355
    const char *extensions;
356 4f57fa8c Diego Biurrun
    /** General purpose read-only value that the format can use. */
357 b9a281db Fabrice Bellard
    int value;
358 fb2758c8 Fabrice Bellard
359 4f57fa8c Diego Biurrun
    /** Start/resume playing - only meaningful if using a network-based format
360
       (RTSP). */
361 fb2758c8 Fabrice Bellard
    int (*read_play)(struct AVFormatContext *);
362
363 4f57fa8c Diego Biurrun
    /** Pause playing - only meaningful if using a network-based format
364
       (RTSP). */
365 fb2758c8 Fabrice Bellard
    int (*read_pause)(struct AVFormatContext *);
366
367 c1854592 Reimar Döffinger
    const struct AVCodecTag * const *codec_tag;
368 7caf0cc6 Michael Niedermayer
369 b9a281db Fabrice Bellard
    /* private fields */
370
    struct AVInputFormat *next;
371
} AVInputFormat;
372 de6d9b64 Fabrice Bellard
373 57004ff1 Aurelien Jacobs
enum AVStreamParseType {
374
    AVSTREAM_PARSE_NONE,
375
    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
376 4f57fa8c Diego Biurrun
    AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */
377 78cb7273 Diego Biurrun
    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
378 57004ff1 Aurelien Jacobs
};
379
380 fb2758c8 Fabrice Bellard
typedef struct AVIndexEntry {
381
    int64_t pos;
382
    int64_t timestamp;
383
#define AVINDEX_KEYFRAME 0x0001
384 30a43f2d Michael Niedermayer
    int flags:2;
385 4f57fa8c Diego Biurrun
    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
386
    int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
387 fb2758c8 Fabrice Bellard
} AVIndexEntry;
388
389 90c2295b Evgeniy Stepanov
#define AV_DISPOSITION_DEFAULT   0x0001
390
#define AV_DISPOSITION_DUB       0x0002
391
#define AV_DISPOSITION_ORIGINAL  0x0004
392
#define AV_DISPOSITION_COMMENT   0x0008
393
#define AV_DISPOSITION_LYRICS    0x0010
394
#define AV_DISPOSITION_KARAOKE   0x0020
395
396 ba66ae94 Michael Niedermayer
/**
397
 * Stream structure.
398
 * New fields can be added to the end with minor version bumps.
399 8bfb108b Diego Biurrun
 * Removal, reordering and changes to existing fields require a major
400 ba66ae94 Michael Niedermayer
 * version bump.
401 8bfb108b Diego Biurrun
 * sizeof(AVStream) must not be used outside libav*.
402 ba66ae94 Michael Niedermayer
 */
403 de6d9b64 Fabrice Bellard
typedef struct AVStream {
404 43d414ba Panagiotis Issaris
    int index;    /**< stream index in AVFormatContext */
405 4f57fa8c Diego Biurrun
    int id;       /**< format-specific stream ID */
406 43d414ba Panagiotis Issaris
    AVCodecContext *codec; /**< codec context */
407 b4b87d48 Michael Niedermayer
    /**
408 8bfb108b Diego Biurrun
     * Real base frame rate of the stream.
409
     * This is the lowest frame rate with which all timestamps can be
410 864ff8c1 Ramiro Polla
     * represented accurately (it is the least common multiple of all
411 4f57fa8c Diego Biurrun
     * frame rates in the stream). Note, this value is just a guess!
412
     * For example if the time base is 1/90000 and all frames have either
413
     * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
414 b4b87d48 Michael Niedermayer
     */
415
    AVRational r_frame_rate;
416 de6d9b64 Fabrice Bellard
    void *priv_data;
417 82583548 Michael Niedermayer
418 b9a281db Fabrice Bellard
    /* internal data used in av_find_stream_info() */
419 82583548 Michael Niedermayer
    int64_t first_dts;
420 4f57fa8c Diego Biurrun
    /** encoding: pts generation when outputting stream */
421 a9fd2b19 Måns Rullgård
    struct AVFrac pts;
422 5b28c8c3 Michael Niedermayer
423
    /**
424 8bfb108b Diego Biurrun
     * This is the fundamental unit of time (in seconds) in terms
425
     * of which frame timestamps are represented. For fixed-fps content,
426 4f57fa8c Diego Biurrun
     * time base should be 1/frame rate and timestamp increments should be 1.
427 5b28c8c3 Michael Niedermayer
     */
428 9ee91c2f Michael Niedermayer
    AVRational time_base;
429 43d414ba Panagiotis Issaris
    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
430 a48b7a6b Fabrice Bellard
    /* ffmpeg.c private use */
431 4f57fa8c Diego Biurrun
    int stream_copy; /**< If set, just copy stream. */
432
    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
433 b4aea108 Michael Niedermayer
    //FIXME move stuff to a flags field?
434 4f57fa8c Diego Biurrun
    /** Quality, as it has been removed from AVCodecContext and put in AVVideoFrame.
435 755bfeab Diego Biurrun
     * MN: dunno if that is the right place for it */
436 115329f1 Diego Biurrun
    float quality;
437 6d96a9b9 Michael Niedermayer
    /**
438 8bfb108b Diego Biurrun
     * Decoding: pts of the first frame of the stream, in stream time base.
439
     * Only set this if you are absolutely 100% sure that the value you set
440
     * it to really is the pts of the first frame.
441 4854c253 Neil Brown
     * This may be undefined (AV_NOPTS_VALUE).
442 8bfb108b Diego Biurrun
     * @note The ASF header does NOT contain a correct start_time the ASF
443
     * demuxer must NOT set this.
444 6d96a9b9 Michael Niedermayer
     */
445 115329f1 Diego Biurrun
    int64_t start_time;
446 e26381b6 Neil Brown
    /**
447 8bfb108b Diego Biurrun
     * Decoding: duration of the stream, in stream time base.
448 e26381b6 Neil Brown
     * If a source file does not specify a duration, but does specify
449 4f57fa8c Diego Biurrun
     * a bitrate, this value will be estimated from bitrate and file size.
450 e26381b6 Neil Brown
     */
451 ee404803 Fabrice Bellard
    int64_t duration;
452 fb2758c8 Fabrice Bellard
453 43d414ba Panagiotis Issaris
    char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */
454 09730260 Fabrice Bellard
455 fb2758c8 Fabrice Bellard
    /* av_read_frame() support */
456 57004ff1 Aurelien Jacobs
    enum AVStreamParseType need_parsing;
457 fb2758c8 Fabrice Bellard
    struct AVCodecParserContext *parser;
458 6ec87caa Fabrice Bellard
459 fb2758c8 Fabrice Bellard
    int64_t cur_dts;
460 635fbcb1 Michael Niedermayer
    int last_IP_duration;
461
    int64_t last_IP_pts;
462 fb2758c8 Fabrice Bellard
    /* av_seek_frame() support */
463 4f57fa8c Diego Biurrun
    AVIndexEntry *index_entries; /**< Only used if the format does not
464
                                    support seeking natively. */
465 fb2758c8 Fabrice Bellard
    int nb_index_entries;
466 191e8ca7 Måns Rullgård
    unsigned int index_entries_allocated_size;
467 115329f1 Diego Biurrun
468 b4b87d48 Michael Niedermayer
    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
469 504ee036 Michael Niedermayer
470 0d84a8f6 Baptiste Coudurier
#if LIBAVFORMAT_VERSION_INT < (53<<16)
471
    int64_t unused[4+1];
472
#endif
473 f8d7c9d3 Evgeniy Stepanov
474
    char *filename; /**< source filename of the stream */
475 90c2295b Evgeniy Stepanov
476 4f57fa8c Diego Biurrun
    int disposition; /**< AV_DISPOSITION_* bit field */
477 0bef08e5 Michael Niedermayer
478
    AVProbeData probe_data;
479 0d84a8f6 Baptiste Coudurier
#define MAX_REORDER_DELAY 16
480
    int64_t pts_buffer[MAX_REORDER_DELAY+1];
481 c30a4489 Aurelien Jacobs
482
    /**
483
     * sample aspect ratio (0 if unknown)
484
     * - encoding: Set by user.
485
     * - decoding: Set by libavformat.
486
     */
487
    AVRational sample_aspect_ratio;
488 f526adaf Aurelien Jacobs
489 e232c252 Aurelien Jacobs
    AVMetadata *metadata;
490 3a41c2f7 Michael Niedermayer
491
    /* av_read_frame() support */
492
    const uint8_t *cur_ptr;
493
    int cur_len;
494
    AVPacket cur_pkt;
495 de6d9b64 Fabrice Bellard
} AVStream;
496
497 15afa396 Nico Sabbi
#define AV_PROGRAM_RUNNING 1
498
499 ba66ae94 Michael Niedermayer
/**
500
 * New fields can be added to the end with minor version bumps.
501 8bfb108b Diego Biurrun
 * Removal, reordering and changes to existing fields require a major
502 ba66ae94 Michael Niedermayer
 * version bump.
503 8bfb108b Diego Biurrun
 * sizeof(AVProgram) must not be used outside libav*.
504 ba66ae94 Michael Niedermayer
 */
505 15afa396 Nico Sabbi
typedef struct AVProgram {
506
    int            id;
507 4f57fa8c Diego Biurrun
    char           *provider_name; ///< network name for DVB streams
508
    char           *name;          ///< service name for DVB streams
509 15afa396 Nico Sabbi
    int            flags;
510
    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
511 526efa10 Nico Sabbi
    unsigned int   *stream_index;
512
    unsigned int   nb_stream_indexes;
513 e232c252 Aurelien Jacobs
    AVMetadata *metadata;
514 15afa396 Nico Sabbi
} AVProgram;
515
516 43d414ba Panagiotis Issaris
#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
517 da24c5e3 Fabrice Bellard
                                         (streams are added dynamically) */
518
519 79d7836a Anton Khirnov
typedef struct AVChapter {
520 4f57fa8c Diego Biurrun
    int id;                 ///< unique ID to identify the chapter
521
    AVRational time_base;   ///< time base in which the start/end timestamps are specified
522 8931e7b4 Michael Niedermayer
    int64_t start, end;     ///< chapter start/end time in time_base units
523 c2fb6be4 Michael Niedermayer
    char *title;            ///< chapter title
524 e232c252 Aurelien Jacobs
    AVMetadata *metadata;
525 79d7836a Anton Khirnov
} AVChapter;
526
527 de6d9b64 Fabrice Bellard
#define MAX_STREAMS 20
528
529 252f17e2 Michael Niedermayer
/**
530 4f57fa8c Diego Biurrun
 * Format I/O context.
531 252f17e2 Michael Niedermayer
 * New fields can be added to the end with minor version bumps.
532 8bfb108b Diego Biurrun
 * Removal, reordering and changes to existing fields require a major
533 252f17e2 Michael Niedermayer
 * version bump.
534 8bfb108b Diego Biurrun
 * sizeof(AVFormatContext) must not be used outside libav*.
535 252f17e2 Michael Niedermayer
 */
536 de6d9b64 Fabrice Bellard
typedef struct AVFormatContext {
537 4f57fa8c Diego Biurrun
    const AVClass *av_class; /**< Set by av_alloc_format_context. */
538
    /* Can only be iformat or oformat, not both at the same time. */
539 b9a281db Fabrice Bellard
    struct AVInputFormat *iformat;
540
    struct AVOutputFormat *oformat;
541 de6d9b64 Fabrice Bellard
    void *priv_data;
542 899681cd Björn Axelsson
    ByteIOContext *pb;
543 db69c2e5 Diego Biurrun
    unsigned int nb_streams;
544 de6d9b64 Fabrice Bellard
    AVStream *streams[MAX_STREAMS];
545 43d414ba Panagiotis Issaris
    char filename[1024]; /**< input or output filename */
546 de6d9b64 Fabrice Bellard
    /* stream info */
547 4568325a Roman Shaposhnik
    int64_t timestamp;
548 de6d9b64 Fabrice Bellard
    char title[512];
549
    char author[512];
550
    char copyright[512];
551
    char comment[512];
552 6a58e151 Fabrice Bellard
    char album[512];
553 43d414ba Panagiotis Issaris
    int year;  /**< ID3 year, 0 if none */
554
    int track; /**< track number, 0 if none */
555
    char genre[32]; /**< ID3 genre */
556 6a58e151 Fabrice Bellard
557 4f57fa8c Diego Biurrun
    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
558
    /* private data for pts handling (do not modify directly). */
559 43d414ba Panagiotis Issaris
    /** This buffer is only needed when packets were already buffered but
560 4f57fa8c Diego Biurrun
       not decoded, for example to get the codec parameters in MPEG
561
       streams. */
562 ee404803 Fabrice Bellard
    struct AVPacketList *packet_buffer;
563
564 4f57fa8c Diego Biurrun
    /** Decoding: position of the first frame of the component, in
565 ee404803 Fabrice Bellard
       AV_TIME_BASE fractional seconds. NEVER set this value directly:
566 4f57fa8c Diego Biurrun
       It is deduced from the AVStream values.  */
567 115329f1 Diego Biurrun
    int64_t start_time;
568 4f57fa8c Diego Biurrun
    /** Decoding: duration of the stream, in AV_TIME_BASE fractional
569 ee404803 Fabrice Bellard
       seconds. NEVER set this value directly: it is deduced from the
570
       AVStream values.  */
571
    int64_t duration;
572 4f57fa8c Diego Biurrun
    /** decoding: total file size, 0 if unknown */
573 ee404803 Fabrice Bellard
    int64_t file_size;
574 4f57fa8c Diego Biurrun
    /** Decoding: total stream bitrate in bit/s, 0 if not
575 ee404803 Fabrice Bellard
       available. Never set it directly if the file_size and the
576
       duration are known as ffmpeg can compute it automatically. */
577
    int bit_rate;
578 fb2758c8 Fabrice Bellard
579
    /* av_read_frame() support */
580
    AVStream *cur_st;
581 3a41c2f7 Michael Niedermayer
#if LIBAVFORMAT_VERSION_INT < (53<<16)
582
    const uint8_t *cur_ptr_deprecated;
583
    int cur_len_deprecated;
584
    AVPacket cur_pkt_deprecated;
585
#endif
586 fb2758c8 Fabrice Bellard
587
    /* av_seek_frame() support */
588 43d414ba Panagiotis Issaris
    int64_t data_offset; /** offset of the first packet */
589 fb2758c8 Fabrice Bellard
    int index_built;
590 115329f1 Diego Biurrun
591 2db3c638 Michael Niedermayer
    int mux_rate;
592
    int packet_size;
593 17c88cb0 Michael Niedermayer
    int preload;
594
    int max_delay;
595 8108551a Todd Kirby
596 115329f1 Diego Biurrun
#define AVFMT_NOOUTPUTLOOP -1
597
#define AVFMT_INFINITEOUTPUTLOOP 0
598 43d414ba Panagiotis Issaris
    /** number of times to loop output in formats that support it */
599 8108551a Todd Kirby
    int loop_output;
600 115329f1 Diego Biurrun
601 30bc6613 Michael Niedermayer
    int flags;
602 4f57fa8c Diego Biurrun
#define AVFMT_FLAG_GENPTS       0x0001 ///< Generate pts if missing even if it requires parsing future frames.
603
#define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
604
#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
605 5894e1bb Víctor Paesa
606
    int loop_input;
607 4f57fa8c Diego Biurrun
    /** Decoding: size of data to probe; encoding: unused. */
608 9e6c9470 Nico Sabbi
    unsigned int probesize;
609 a44b3c4d Michael Niedermayer
610
    /**
611 4f57fa8c Diego Biurrun
     * Maximum time (in AV_TIME_BASE units) during which the input should
612
     * be analyzed in av_find_stream_info().
613 a44b3c4d Michael Niedermayer
     */
614
    int max_analyze_duration;
615 c964c2c7 Reimar Döffinger
616
    const uint8_t *key;
617
    int keylen;
618 15afa396 Nico Sabbi
619
    unsigned int nb_programs;
620
    AVProgram **programs;
621 62600469 Michael Niedermayer
622
    /**
623
     * Forced video codec_id.
624 4f57fa8c Diego Biurrun
     * Demuxing: Set by user.
625 62600469 Michael Niedermayer
     */
626
    enum CodecID video_codec_id;
627
    /**
628
     * Forced audio codec_id.
629 4f57fa8c Diego Biurrun
     * Demuxing: Set by user.
630 62600469 Michael Niedermayer
     */
631
    enum CodecID audio_codec_id;
632
    /**
633
     * Forced subtitle codec_id.
634 4f57fa8c Diego Biurrun
     * Demuxing: Set by user.
635 62600469 Michael Niedermayer
     */
636
    enum CodecID subtitle_codec_id;
637 3dea63bd Paul Kelly
638
    /**
639
     * Maximum amount of memory in bytes to use per stream for the index.
640 4f57fa8c Diego Biurrun
     * If the needed index exceeds this size, entries will be discarded as
641 3dea63bd Paul Kelly
     * needed to maintain a smaller size. This can lead to slower or less
642
     * accurate seeking (depends on demuxer).
643 4f57fa8c Diego Biurrun
     * Demuxers for which a full in-memory index is mandatory will ignore
644 3dea63bd Paul Kelly
     * this.
645
     * muxing  : unused
646
     * demuxing: set by user
647
     */
648
    unsigned int max_index_size;
649 ab8ab30c Ramiro Polla
650
    /**
651 ffa71b2b Ramiro Polla
     * Maximum amount of memory in bytes to use for buffering frames
652 4f57fa8c Diego Biurrun
     * obtained from realtime capture devices.
653 ab8ab30c Ramiro Polla
     */
654
    unsigned int max_picture_buffer;
655 79d7836a Anton Khirnov
656 fbabf1e9 Michael Niedermayer
    unsigned int nb_chapters;
657 79d7836a Anton Khirnov
    AVChapter **chapters;
658 45b2b05f Michael Niedermayer
659
    /**
660 4f57fa8c Diego Biurrun
     * Flags to enable debugging.
661 45b2b05f Michael Niedermayer
     */
662
    int debug;
663
#define FF_FDEBUG_TS        0x0001
664 0bef08e5 Michael Niedermayer
665
    /**
666 4f57fa8c Diego Biurrun
     * Raw packets from the demuxer, prior to parsing and decoding.
667 0bef08e5 Michael Niedermayer
     * This buffer is used for buffering packets until the codec can
668
     * be identified, as parsing cannot be done without knowing the
669
     * codec.
670
     */
671
    struct AVPacketList *raw_packet_buffer;
672 5c5b1731 Måns Rullgård
    struct AVPacketList *raw_packet_buffer_end;
673
674
    struct AVPacketList *packet_buffer_end;
675 47146dfb Michael Niedermayer
676 e232c252 Aurelien Jacobs
    AVMetadata *metadata;
677 de6d9b64 Fabrice Bellard
} AVFormatContext;
678
679
typedef struct AVPacketList {
680
    AVPacket pkt;
681
    struct AVPacketList *next;
682
} AVPacketList;
683
684 84be6e72 Michael Niedermayer
#if LIBAVFORMAT_VERSION_INT < (53<<16)
685 b9a281db Fabrice Bellard
extern AVInputFormat *first_iformat;
686
extern AVOutputFormat *first_oformat;
687 84be6e72 Michael Niedermayer
#endif
688
689
AVInputFormat  *av_iformat_next(AVInputFormat  *f);
690
AVOutputFormat *av_oformat_next(AVOutputFormat *f);
691 de6d9b64 Fabrice Bellard
692 5b6d5596 Michael Niedermayer
enum CodecID av_guess_image2_codec(const char *filename);
693 290c5fa6 Fabrice Bellard
694 b9a281db Fabrice Bellard
/* XXX: use automatic init with either ELF sections or C file parser */
695
/* modules */
696 de6d9b64 Fabrice Bellard
697 b9a281db Fabrice Bellard
/* utils.c */
698
void av_register_input_format(AVInputFormat *format);
699
void av_register_output_format(AVOutputFormat *format);
700 115329f1 Diego Biurrun
AVOutputFormat *guess_stream_format(const char *short_name,
701 78cb7273 Diego Biurrun
                                    const char *filename,
702
                                    const char *mime_type);
703 115329f1 Diego Biurrun
AVOutputFormat *guess_format(const char *short_name,
704 78cb7273 Diego Biurrun
                             const char *filename,
705
                             const char *mime_type);
706 3217cb42 Panagiotis Issaris
707
/**
708 4f57fa8c Diego Biurrun
 * Guesses the codec ID based upon muxer and filename.
709 3217cb42 Panagiotis Issaris
 */
710 115329f1 Diego Biurrun
enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
711 78cb7273 Diego Biurrun
                            const char *filename, const char *mime_type,
712
                            enum CodecType type);
713 de6d9b64 Fabrice Bellard
714 3217cb42 Panagiotis Issaris
/**
715 750f0e1f Panagiotis Issaris
 * Send a nice hexadecimal dump of a buffer to the specified file stream.
716
 *
717
 * @param f The file stream pointer where the dump should be sent to.
718 3217cb42 Panagiotis Issaris
 * @param buf buffer
719
 * @param size buffer size
720 750f0e1f Panagiotis Issaris
 *
721
 * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log
722 3217cb42 Panagiotis Issaris
 */
723 fb2758c8 Fabrice Bellard
void av_hex_dump(FILE *f, uint8_t *buf, int size);
724 3217cb42 Panagiotis Issaris
725
/**
726 750f0e1f Panagiotis Issaris
 * Send a nice hexadecimal dump of a buffer to the log.
727
 *
728
 * @param avcl A pointer to an arbitrary struct of which the first field is a
729
 * pointer to an AVClass struct.
730
 * @param level The importance level of the message, lower values signifying
731
 * higher importance.
732
 * @param buf buffer
733
 * @param size buffer size
734
 *
735
 * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log
736
 */
737
void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size);
738
739
/**
740
 * Send a nice dump of a packet to the specified file stream.
741
 *
742
 * @param f The file stream pointer where the dump should be sent to.
743 3217cb42 Panagiotis Issaris
 * @param pkt packet to dump
744 4f57fa8c Diego Biurrun
 * @param dump_payload True if the payload must be displayed, too.
745 3217cb42 Panagiotis Issaris
 */
746 fb2758c8 Fabrice Bellard
void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
747 de6d9b64 Fabrice Bellard
748 750f0e1f Panagiotis Issaris
/**
749
 * Send a nice dump of a packet to the log.
750
 *
751
 * @param avcl A pointer to an arbitrary struct of which the first field is a
752
 * pointer to an AVClass struct.
753
 * @param level The importance level of the message, lower values signifying
754
 * higher importance.
755
 * @param pkt packet to dump
756 4f57fa8c Diego Biurrun
 * @param dump_payload True if the payload must be displayed, too.
757 750f0e1f Panagiotis Issaris
 */
758
void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload);
759
760 4815e246 Stefano Sabatini
/**
761
 * Initialize libavformat and register all the muxers, demuxers and
762
 * protocols. If you do not call this function, then you can select
763
 * exactly which formats you want to support.
764
 *
765
 * @see av_register_input_format()
766
 * @see av_register_output_format()
767
 * @see register_protocol()
768
 */
769 94988531 Fabrice Bellard
void av_register_all(void);
770 de6d9b64 Fabrice Bellard
771 43d414ba Panagiotis Issaris
/** codec tag <-> codec id */
772 15545a09 Stefano Sabatini
enum CodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
773
unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum CodecID id);
774 7caf0cc6 Michael Niedermayer
775 b9a281db Fabrice Bellard
/* media file input */
776 3217cb42 Panagiotis Issaris
777
/**
778 4f57fa8c Diego Biurrun
 * Finds AVInputFormat based on the short name of the input format.
779 3217cb42 Panagiotis Issaris
 */
780 b9a281db Fabrice Bellard
AVInputFormat *av_find_input_format(const char *short_name);
781 3217cb42 Panagiotis Issaris
782
/**
783
 * Guess file format.
784
 *
785 4f57fa8c Diego Biurrun
 * @param is_opened Whether the file is already opened; determines whether
786
 *                  demuxers with or without AVFMT_NOFILE are probed.
787 3217cb42 Panagiotis Issaris
 */
788 94988531 Fabrice Bellard
AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
789 3217cb42 Panagiotis Issaris
790
/**
791
 * Allocates all the structures needed to read an input stream.
792
 *        This does not open the needed codecs for decoding the stream[s].
793
 */
794 115329f1 Diego Biurrun
int av_open_input_stream(AVFormatContext **ic_ptr,
795
                         ByteIOContext *pb, const char *filename,
796 da24c5e3 Fabrice Bellard
                         AVInputFormat *fmt, AVFormatParameters *ap);
797 3217cb42 Panagiotis Issaris
798
/**
799 864ff8c1 Ramiro Polla
 * Open a media file as input. The codecs are not opened. Only the file
800 3217cb42 Panagiotis Issaris
 * header (if present) is read.
801
 *
802 4f57fa8c Diego Biurrun
 * @param ic_ptr The opened media file handle is put here.
803
 * @param filename filename to open
804
 * @param fmt If non-NULL, force the file format to use.
805 3217cb42 Panagiotis Issaris
 * @param buf_size optional buffer size (zero if default is OK)
806 78cb7273 Diego Biurrun
 * @param ap Additional parameters needed when opening the file
807
 *           (NULL if default).
808 4f57fa8c Diego Biurrun
 * @return 0 if OK, AVERROR_xxx otherwise
809 3217cb42 Panagiotis Issaris
 */
810 115329f1 Diego Biurrun
int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
811 b9a281db Fabrice Bellard
                       AVInputFormat *fmt,
812
                       int buf_size,
813
                       AVFormatParameters *ap);
814 88808c60 Michael Niedermayer
/**
815
 * Allocate an AVFormatContext.
816 5d81d641 Diego Biurrun
 * Can be freed with av_free() but do not forget to free everything you
817 88808c60 Michael Niedermayer
 * explicitly allocated as well!
818
 */
819 bc874dae Michel Bardiaux
AVFormatContext *av_alloc_format_context(void);
820 b9a281db Fabrice Bellard
821 3217cb42 Panagiotis Issaris
/**
822
 * Read packets of a media file to get stream information. This
823
 * is useful for file formats with no headers such as MPEG. This
824 4f57fa8c Diego Biurrun
 * function also computes the real frame rate in case of MPEG-2 repeat
825 3217cb42 Panagiotis Issaris
 * frame mode.
826
 * The logical file position is not changed by this function;
827
 * examined packets may be buffered for later processing.
828
 *
829
 * @param ic media file handle
830 4f57fa8c Diego Biurrun
 * @return >=0 if OK, AVERROR_xxx on error
831
 * @todo Let the user decide somehow what information is needed so that
832
 *       we do not waste time getting stuff the user does not need.
833 3217cb42 Panagiotis Issaris
 */
834 b9a281db Fabrice Bellard
int av_find_stream_info(AVFormatContext *ic);
835 3217cb42 Panagiotis Issaris
836
/**
837
 * Read a transport packet from a media file.
838
 *
839 864ff8c1 Ramiro Polla
 * This function is obsolete and should never be used.
840 3217cb42 Panagiotis Issaris
 * Use av_read_frame() instead.
841
 *
842
 * @param s media file handle
843
 * @param pkt is filled
844 4f57fa8c Diego Biurrun
 * @return 0 if OK, AVERROR_xxx on error
845 3217cb42 Panagiotis Issaris
 */
846 de6d9b64 Fabrice Bellard
int av_read_packet(AVFormatContext *s, AVPacket *pkt);
847 3217cb42 Panagiotis Issaris
848
/**
849
 * Return the next frame of a stream.
850
 *
851
 * The returned packet is valid
852
 * until the next av_read_frame() or until av_close_input_file() and
853
 * must be freed with av_free_packet. For video, the packet contains
854
 * exactly one frame. For audio, it contains an integer number of
855
 * frames if each frame has a known fixed size (e.g. PCM or ADPCM
856
 * data). If the audio frames have a variable size (e.g. MPEG audio),
857
 * then it contains one frame.
858
 *
859
 * pkt->pts, pkt->dts and pkt->duration are always set to correct
860 a050f802 Panagiotis Issaris
 * values in AVStream.timebase units (and guessed if the format cannot
861 4f57fa8c Diego Biurrun
 * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
862
 * has B-frames, so it is better to rely on pkt->dts if you do not
863 3217cb42 Panagiotis Issaris
 * decompress the payload.
864
 *
865 4f57fa8c Diego Biurrun
 * @return 0 if OK, < 0 on error or end of file
866 3217cb42 Panagiotis Issaris
 */
867 fb2758c8 Fabrice Bellard
int av_read_frame(AVFormatContext *s, AVPacket *pkt);
868 3217cb42 Panagiotis Issaris
869
/**
870
 * Seek to the key frame at timestamp.
871
 * 'timestamp' in 'stream_index'.
872
 * @param stream_index If stream_index is (-1), a default
873
 * stream is selected, and timestamp is automatically converted
874
 * from AV_TIME_BASE units to the stream specific time_base.
875 4f57fa8c Diego Biurrun
 * @param timestamp Timestamp in AVStream.time_base units
876
 *        or, if no stream is specified, in AV_TIME_BASE units.
877 3217cb42 Panagiotis Issaris
 * @param flags flags which select direction and seeking mode
878
 * @return >= 0 on success
879
 */
880 78cb7273 Diego Biurrun
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
881
                  int flags);
882 3217cb42 Panagiotis Issaris
883
/**
884 4f57fa8c Diego Biurrun
 * Start playing a network based stream (e.g. RTSP stream) at the
885
 * current position.
886 3217cb42 Panagiotis Issaris
 */
887 fb2758c8 Fabrice Bellard
int av_read_play(AVFormatContext *s);
888 3217cb42 Panagiotis Issaris
889
/**
890
 * Pause a network based stream (e.g. RTSP stream).
891
 *
892
 * Use av_read_play() to resume it.
893
 */
894 fb2758c8 Fabrice Bellard
int av_read_pause(AVFormatContext *s);
895 3217cb42 Panagiotis Issaris
896
/**
897 2506fd54 Reimar Döffinger
 * Free a AVFormatContext allocated by av_open_input_stream.
898
 * @param s context to free
899
 */
900
void av_close_input_stream(AVFormatContext *s);
901
902
/**
903 3217cb42 Panagiotis Issaris
 * Close a media file (but not its codecs).
904
 *
905
 * @param s media file handle
906
 */
907 de6d9b64 Fabrice Bellard
void av_close_input_file(AVFormatContext *s);
908 3217cb42 Panagiotis Issaris
909
/**
910
 * Add a new stream to a media file.
911
 *
912
 * Can only be called in the read_header() function. If the flag
913
 * AVFMTCTX_NOHEADER is in the format context, then new streams
914
 * can be added in read_packet too.
915
 *
916
 * @param s media file handle
917 4f57fa8c Diego Biurrun
 * @param id file-format-dependent stream ID
918 3217cb42 Panagiotis Issaris
 */
919 b9a281db Fabrice Bellard
AVStream *av_new_stream(AVFormatContext *s, int id);
920 15afa396 Nico Sabbi
AVProgram *av_new_program(AVFormatContext *s, int id);
921 3217cb42 Panagiotis Issaris
922
/**
923 79d7836a Anton Khirnov
 * Add a new chapter.
924
 * This function is NOT part of the public API
925 4f57fa8c Diego Biurrun
 * and should ONLY be used by demuxers.
926 79d7836a Anton Khirnov
 *
927
 * @param s media file handle
928 4f57fa8c Diego Biurrun
 * @param id unique ID for this chapter
929 abd2256d Michael Niedermayer
 * @param start chapter start time in time_base units
930
 * @param end chapter end time in time_base units
931 79d7836a Anton Khirnov
 * @param title chapter title
932 5c37f43a Michael Niedermayer
 *
933 4f57fa8c Diego Biurrun
 * @return AVChapter or NULL on error
934 79d7836a Anton Khirnov
 */
935 78cb7273 Diego Biurrun
AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base,
936
                          int64_t start, int64_t end, const char *title);
937 79d7836a Anton Khirnov
938
/**
939 3217cb42 Panagiotis Issaris
 * Set the pts for a given stream.
940
 *
941
 * @param s stream
942
 * @param pts_wrap_bits number of bits effectively used by the pts
943
 *        (used for wrap control, 33 is the value for MPEG)
944
 * @param pts_num numerator to convert to seconds (MPEG: 1)
945
 * @param pts_den denominator to convert to seconds (MPEG: 90000)
946
 */
947 9ee91c2f Michael Niedermayer
void av_set_pts_info(AVStream *s, int pts_wrap_bits,
948 916c80e9 Fabrice Bellard
                     int pts_num, int pts_den);
949 de6d9b64 Fabrice Bellard
950 3ba1438d Michael Niedermayer
#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
951
#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
952 4f57fa8c Diego Biurrun
#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non-keyframes
953 3ba1438d Michael Niedermayer
954 b754978a Michael Niedermayer
int av_find_default_stream_index(AVFormatContext *s);
955 3217cb42 Panagiotis Issaris
956
/**
957
 * Gets the index for a specific timestamp.
958 4f57fa8c Diego Biurrun
 * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
959
 *                 to the timestamp which is <= the requested one, if backward
960
 *                 is 0, then it will be >=
961 3217cb42 Panagiotis Issaris
 *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
962
 * @return < 0 if no such timestamp could be found
963
 */
964 dc56fc38 Michael Niedermayer
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
965 3217cb42 Panagiotis Issaris
966
/**
967 3dea63bd Paul Kelly
 * Ensures the index uses less memory than the maximum specified in
968
 * AVFormatContext.max_index_size, by discarding entries if it grows
969
 * too large.
970
 * This function is not part of the public API and should only be called
971
 * by demuxers.
972
 */
973
void ff_reduce_index(AVFormatContext *s, int stream_index);
974
975
/**
976 4f57fa8c Diego Biurrun
 * Add an index entry into a sorted list. Update the entry if the list
977
 * already contains it.
978 3217cb42 Panagiotis Issaris
 *
979 4f57fa8c Diego Biurrun
 * @param timestamp timestamp in the time base of the given stream
980 3217cb42 Panagiotis Issaris
 */
981 78cb7273 Diego Biurrun
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
982
                       int size, int distance, int flags);
983 3217cb42 Panagiotis Issaris
984
/**
985 78cb7273 Diego Biurrun
 * Does a binary search using av_index_search_timestamp() and
986
 * AVCodec.read_timestamp().
987
 * This is not supposed to be called directly by a user application,
988
 * but by demuxers.
989 3217cb42 Panagiotis Issaris
 * @param target_ts target timestamp in the time base of the given stream
990
 * @param stream_index stream number
991
 */
992 78cb7273 Diego Biurrun
int av_seek_frame_binary(AVFormatContext *s, int stream_index,
993
                         int64_t target_ts, int flags);
994 3217cb42 Panagiotis Issaris
995
/**
996 4f57fa8c Diego Biurrun
 * Updates cur_dts of all streams based on the given timestamp and AVStream.
997 3217cb42 Panagiotis Issaris
 *
998 4f57fa8c Diego Biurrun
 * Stream ref_st unchanged, others set cur_dts in their native time base.
999
 * Only needed for timestamp wrapping or if (dts not set and pts!=dts).
1000 3217cb42 Panagiotis Issaris
 * @param timestamp new dts expressed in time_base of param ref_st
1001
 * @param ref_st reference stream giving time_base of param timestamp
1002
 */
1003 22ffac70 Reimar Döffinger
void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
1004 3217cb42 Panagiotis Issaris
1005
/**
1006
 * Does a binary search using read_timestamp().
1007 78cb7273 Diego Biurrun
 * This is not supposed to be called directly by a user application,
1008
 * but by demuxers.
1009 3217cb42 Panagiotis Issaris
 * @param target_ts target timestamp in the time base of the given stream
1010
 * @param stream_index stream number
1011
 */
1012 78cb7273 Diego Biurrun
int64_t av_gen_search(AVFormatContext *s, int stream_index,
1013
                      int64_t target_ts, int64_t pos_min,
1014
                      int64_t pos_max, int64_t pos_limit,
1015
                      int64_t ts_min, int64_t ts_max,
1016
                      int flags, int64_t *ts_ret,
1017
                      int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
1018 b754978a Michael Niedermayer
1019 43d414ba Panagiotis Issaris
/** media file output */
1020 290c5fa6 Fabrice Bellard
int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
1021 3217cb42 Panagiotis Issaris
1022
/**
1023 755bfeab Diego Biurrun
 * Allocate the stream private data and write the stream header to an
1024
 * output media file.
1025 3217cb42 Panagiotis Issaris
 *
1026
 * @param s media file handle
1027 4f57fa8c Diego Biurrun
 * @return 0 if OK, AVERROR_xxx on error
1028 3217cb42 Panagiotis Issaris
 */
1029 b9a281db Fabrice Bellard
int av_write_header(AVFormatContext *s);
1030 3217cb42 Panagiotis Issaris
1031
/**
1032
 * Write a packet to an output media file.
1033
 *
1034
 * The packet shall contain one audio or video frame.
1035 78cb7273 Diego Biurrun
 * The packet must be correctly interleaved according to the container
1036
 * specification, if not then av_interleaved_write_frame must be used.
1037 3217cb42 Panagiotis Issaris
 *
1038
 * @param s media file handle
1039 78cb7273 Diego Biurrun
 * @param pkt The packet, which contains the stream_index, buf/buf_size,
1040
              dts/pts, ...
1041 4f57fa8c Diego Biurrun
 * @return < 0 on error, = 0 if OK, 1 if end of stream wanted
1042 3217cb42 Panagiotis Issaris
 */
1043 e928649b Michael Niedermayer
int av_write_frame(AVFormatContext *s, AVPacket *pkt);
1044 3217cb42 Panagiotis Issaris
1045
/**
1046
 * Writes a packet to an output media file ensuring correct interleaving.
1047
 *
1048
 * The packet must contain one audio or video frame.
1049
 * If the packets are already correctly interleaved the application should
1050 90b5b51e Diego Biurrun
 * call av_write_frame() instead as it is slightly faster. It is also important
1051
 * to keep in mind that completely non-interleaved input will need huge amounts
1052
 * of memory to interleave with this, so it is preferable to interleave at the
1053
 * demuxer level.
1054 3217cb42 Panagiotis Issaris
 *
1055
 * @param s media file handle
1056 78cb7273 Diego Biurrun
 * @param pkt The packet, which contains the stream_index, buf/buf_size,
1057
              dts/pts, ...
1058 4f57fa8c Diego Biurrun
 * @return < 0 on error, = 0 if OK, 1 if end of stream wanted
1059 3217cb42 Panagiotis Issaris
 */
1060 3c895fc0 Michael Niedermayer
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
1061 3217cb42 Panagiotis Issaris
1062
/**
1063 4f57fa8c Diego Biurrun
 * Interleave a packet per dts in an output media file.
1064 3217cb42 Panagiotis Issaris
 *
1065 78cb7273 Diego Biurrun
 * Packets with pkt->destruct == av_destruct_packet will be freed inside this
1066
 * function, so they cannot be used after it, note calling av_free_packet()
1067
 * on them is still safe.
1068 3217cb42 Panagiotis Issaris
 *
1069
 * @param s media file handle
1070
 * @param out the interleaved packet will be output here
1071
 * @param in the input packet
1072
 * @param flush 1 if no further packets are available as input and all
1073
 *              remaining packets should be output
1074
 * @return 1 if a packet was output, 0 if no packet could be output,
1075 d9526386 Diego Biurrun
 *         < 0 if an error occurred
1076 3217cb42 Panagiotis Issaris
 */
1077 78cb7273 Diego Biurrun
int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
1078
                                 AVPacket *pkt, int flush);
1079 e928649b Michael Niedermayer
1080 3217cb42 Panagiotis Issaris
/**
1081
 * @brief Write the stream trailer to an output media file and
1082
 *        free the file private data.
1083
 *
1084 dc76fe13 Reimar Döffinger
 * May only be called after a successful call to av_write_header.
1085
 *
1086 3217cb42 Panagiotis Issaris
 * @param s media file handle
1087 4f57fa8c Diego Biurrun
 * @return 0 if OK, AVERROR_xxx on error
1088 3217cb42 Panagiotis Issaris
 */
1089 b9a281db Fabrice Bellard
int av_write_trailer(AVFormatContext *s);
1090 de6d9b64 Fabrice Bellard
1091
void dump_format(AVFormatContext *ic,
1092 115329f1 Diego Biurrun
                 int index,
1093 de6d9b64 Fabrice Bellard
                 const char *url,
1094
                 int is_output);
1095 3217cb42 Panagiotis Issaris
1096 1ca9133f Stefano Sabatini
#if LIBAVFORMAT_VERSION_MAJOR < 53
1097 3217cb42 Panagiotis Issaris
/**
1098 4f57fa8c Diego Biurrun
 * Parses width and height out of string str.
1099 26ef3220 Stefano Sabatini
 * @deprecated Use av_parse_video_frame_size instead.
1100 3217cb42 Panagiotis Issaris
 */
1101 78cb7273 Diego Biurrun
attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr,
1102
                                          const char *str);
1103 3217cb42 Panagiotis Issaris
1104
/**
1105
 * Converts frame rate from string to a fraction.
1106 26ef3220 Stefano Sabatini
 * @deprecated Use av_parse_video_frame_rate instead.
1107 3217cb42 Panagiotis Issaris
 */
1108 78cb7273 Diego Biurrun
attribute_deprecated int parse_frame_rate(int *frame_rate, int *frame_rate_base,
1109
                                          const char *arg);
1110 1ca9133f Stefano Sabatini
#endif
1111 3217cb42 Panagiotis Issaris
1112
/**
1113 f9436161 Stefano Sabatini
 * Parses \p datestr and returns a corresponding number of microseconds.
1114
 * @param datestr String representing a date or a duration.
1115
 * - If a date the syntax is:
1116 3217cb42 Panagiotis Issaris
 * @code
1117
 *  [{YYYY-MM-DD|YYYYMMDD}]{T| }{HH[:MM[:SS[.m...]]][Z]|HH[MM[SS[.m...]]][Z]}
1118
 * @endcode
1119 4f57fa8c Diego Biurrun
 * Time is local time unless Z is appended, in which case it is
1120 f9436161 Stefano Sabatini
 * interpreted as UTC.
1121 4f57fa8c Diego Biurrun
 * If the year-month-day part is not specified it takes the current
1122 f9436161 Stefano Sabatini
 * year-month-day.
1123
 * Returns the number of microseconds since 1st of January, 1970 up to
1124
 * the time of the parsed date or INT64_MIN if \p datestr cannot be
1125
 * successfully parsed.
1126
 * - If a duration the syntax is:
1127
 * @code
1128
 *  [-]HH[:MM[:SS[.m...]]]
1129
 *  [-]S+[.m...]
1130
 * @endcode
1131
 * Returns the number of microseconds contained in a time interval
1132
 * with the specified duration or INT64_MIN if \p datestr cannot be
1133 7338d368 Diego Biurrun
 * successfully parsed.
1134 f9436161 Stefano Sabatini
 * @param duration Flag which tells how to interpret \p datestr, if
1135
 * not zero \p datestr is interpreted as a duration, otherwise as a
1136
 * date.
1137 3217cb42 Panagiotis Issaris
 */
1138 0c1a9eda Zdenek Kabelac
int64_t parse_date(const char *datestr, int duration);
1139 de6d9b64 Fabrice Bellard
1140 fff5e687 Diego Biurrun
/** Gets the current time in microseconds. */
1141 0c1a9eda Zdenek Kabelac
int64_t av_gettime(void);
1142 94988531 Fabrice Bellard
1143 4f57fa8c Diego Biurrun
/* ffm-specific for ffserver */
1144 de6d9b64 Fabrice Bellard
#define FFM_PACKET_SIZE 4096
1145 bc5c918e Diego Biurrun
int64_t ffm_read_write_index(int fd);
1146
void ffm_write_write_index(int fd, int64_t pos);
1147
void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size);
1148 de6d9b64 Fabrice Bellard
1149 3217cb42 Panagiotis Issaris
/**
1150
 * Attempts to find a specific tag in a URL.
1151
 *
1152
 * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
1153
 * Return 1 if found.
1154
 */
1155 de6d9b64 Fabrice Bellard
int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
1156
1157 3217cb42 Panagiotis Issaris
/**
1158
 * Returns in 'buf' the path with '%d' replaced by number.
1159 4f57fa8c Diego Biurrun
 *
1160 3217cb42 Panagiotis Issaris
 * Also handles the '%0nd' format where 'n' is the total number
1161
 * of digits and '%%'.
1162
 *
1163
 * @param buf destination buffer
1164
 * @param buf_size destination buffer size
1165
 * @param path numbered sequence string
1166 8ea0e802 Panagiotis Issaris
 * @param number frame number
1167 4f57fa8c Diego Biurrun
 * @return 0 if OK, -1 on format error
1168 3217cb42 Panagiotis Issaris
 */
1169 5c07cf53 Michel Bardiaux
int av_get_frame_filename(char *buf, int buf_size,
1170
                          const char *path, int number);
1171 3217cb42 Panagiotis Issaris
1172
/**
1173
 * Check whether filename actually is a numbered sequence generator.
1174
 *
1175
 * @param filename possible numbered sequence string
1176 4f57fa8c Diego Biurrun
 * @return 1 if a valid numbered sequence string, 0 otherwise
1177 3217cb42 Panagiotis Issaris
 */
1178 5c07cf53 Michel Bardiaux
int av_filename_number_test(const char *filename);
1179 96baaa6a Fabrice Bellard
1180 c5388c07 Luca Abeni
/**
1181
 * Generate an SDP for an RTP session.
1182
 *
1183
 * @param ac array of AVFormatContexts describing the RTP streams. If the
1184
 *           array is composed by only one context, such context can contain
1185
 *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
1186
 *           all the contexts in the array (an AVCodecContext per RTP stream)
1187 4f57fa8c Diego Biurrun
 *           must contain only one AVStream.
1188 8767b80f Luca Abeni
 * @param n_files number of AVCodecContexts contained in ac
1189
 * @param buff buffer where the SDP will be stored (must be allocated by
1190 4f57fa8c Diego Biurrun
 *             the caller)
1191 8767b80f Luca Abeni
 * @param size the size of the buffer
1192 4f57fa8c Diego Biurrun
 * @return 0 if OK, AVERROR_xxx on error
1193 c5388c07 Luca Abeni
 */
1194 8767b80f Luca Abeni
int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
1195 c5388c07 Luca Abeni
1196 fb025625 Fabrice Bellard
#ifdef HAVE_AV_CONFIG_H
1197 f71869a4 Fabrice Bellard
1198 903a2e86 Michael Niedermayer
void ff_dynarray_add(unsigned long **tab_ptr, int *nb_ptr, unsigned long elem);
1199 39f472c3 Fabrice Bellard
1200 e4e70d2e Falk Hüffner
#ifdef __GNUC__
1201 39f472c3 Fabrice Bellard
#define dynarray_add(tab, nb_ptr, elem)\
1202
do {\
1203 72ab9d7f Diego Pettenò
    __typeof__(tab) _tab = (tab);\
1204
    __typeof__(elem) _elem = (elem);\
1205 39f472c3 Fabrice Bellard
    (void)sizeof(**_tab == _elem); /* check that types are compatible */\
1206 903a2e86 Michael Niedermayer
    ff_dynarray_add((unsigned long **)_tab, nb_ptr, (unsigned long)_elem);\
1207 39f472c3 Fabrice Bellard
} while(0)
1208 e4e70d2e Falk Hüffner
#else
1209
#define dynarray_add(tab, nb_ptr, elem)\
1210
do {\
1211 903a2e86 Michael Niedermayer
    ff_dynarray_add((unsigned long **)(tab), nb_ptr, (unsigned long)(elem));\
1212 e4e70d2e Falk Hüffner
} while(0)
1213
#endif
1214 39f472c3 Fabrice Bellard
1215 f71869a4 Fabrice Bellard
time_t mktimegm(struct tm *tm);
1216 0c9fc6e1 Roman Shaposhnik
struct tm *brktimegm(time_t secs, struct tm *tm);
1217 115329f1 Diego Biurrun
const char *small_strptime(const char *p, const char *fmt,
1218 f71869a4 Fabrice Bellard
                           struct tm *dt);
1219
1220 fb025625 Fabrice Bellard
struct in_addr;
1221
int resolve_host(struct in_addr *sin_addr, const char *hostname);
1222
1223
void url_split(char *proto, int proto_size,
1224 6ba5cbc6 Petr Doubek
               char *authorization, int authorization_size,
1225 fb025625 Fabrice Bellard
               char *hostname, int hostname_size,
1226
               int *port_ptr,
1227
               char *path, int path_size,
1228
               const char *url);
1229
1230 a941f391 Fabrice Bellard
int match_ext(const char *filename, const char *extensions);
1231
1232 fb025625 Fabrice Bellard
#endif /* HAVE_AV_CONFIG_H */
1233
1234 98790382 Stefano Sabatini
#endif /* AVFORMAT_AVFORMAT_H */