| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * copyright (c) 2001 Fabrice Bellard | 2  * copyright (c) 2001 Fabrice Bellard | 
| 3  * | 3  * | 
| 4  * This file is part of FFmpeg. | 4  * This file is part of FFmpeg. | 
| 5  * | 5  * | 
| 6  * FFmpeg is free software; you can redistribute it and/or | 6  * FFmpeg is free software; you can redistribute it and/or | 
| 7  * modify it under the terms of the GNU Lesser General Public | 7  * modify it under the terms of the GNU Lesser General Public | 
| 8  * License as published by the Free Software Foundation; either | 8  * License as published by the Free Software Foundation; either | 
| 9  * version 2.1 of the License, or (at your option) any later version. | 9  * version 2.1 of the License, or (at your option) any later version. | 
| 10  * | 10  * | 
| 11  * FFmpeg is distributed in the hope that it will be useful, | 11  * FFmpeg is distributed in the hope that it will be useful, | 
| 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
| 14  * Lesser General Public License for more details. | 14  * Lesser General Public License for more details. | 
| 15  * | 15  * | 
| 16  * You should have received a copy of the GNU Lesser General Public | 16  * You should have received a copy of the GNU Lesser General Public | 
| 17  * License along with FFmpeg; if not, write to the Free Software | 17  * License along with FFmpeg; if not, write to the Free Software | 
| 18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 
| 19  */ | 19  */ | 
| 20 | 20 | 
| 21 #ifndef AVFORMAT_AVFORMAT_H | 21 #ifndef AVFORMAT_AVFORMAT_H | 
| 22 #define AVFORMAT_AVFORMAT_H | 22 #define AVFORMAT_AVFORMAT_H | 
| 23 | 23 | 
| 24 #define LIBAVFORMAT_VERSION_MAJOR 52 | 24 #define LIBAVFORMAT_VERSION_MAJOR 52 | 
| 25 #define LIBAVFORMAT_VERSION_MINOR 80 | 25 #define LIBAVFORMAT_VERSION_MINOR 84 | 
| 26 #define LIBAVFORMAT_VERSION_MICRO  0 | 26 #define LIBAVFORMAT_VERSION_MICRO  0 | 
| 27 | 27 | 
| 28 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ | 28 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ | 
| 29                                                LIBAVFORMAT_VERSION_MINOR, \ | 29                                                LIBAVFORMAT_VERSION_MINOR, \ | 
| 30                                                LIBAVFORMAT_VERSION_MICRO) | 30                                                LIBAVFORMAT_VERSION_MICRO) | 
| 31 #define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \ | 31 #define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \ | 
| 32                                            LIBAVFORMAT_VERSION_MINOR,   \ | 32                                            LIBAVFORMAT_VERSION_MINOR,   \ | 
| 33                                            LIBAVFORMAT_VERSION_MICRO) | 33                                            LIBAVFORMAT_VERSION_MICRO) | 
| 34 #define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT | 34 #define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT | 
| 35 | 35 | 
| 36 #define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) | 36 #define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) | 
| 37 | 37 | 
| 38 /** | 38 /** | 
| 39  * Those FF_API_* defines are not part of public API. | 39  * Those FF_API_* defines are not part of public API. | 
| 40  * They may change, break or disappear at any time. | 40  * They may change, break or disappear at any time. | 
| 41  */ | 41  */ | 
| 42 #ifndef FF_API_MAX_STREAMS | 42 #ifndef FF_API_MAX_STREAMS | 
| 43 #define FF_API_MAX_STREAMS   (LIBAVFORMAT_VERSION_MAJOR < 53) | 43 #define FF_API_MAX_STREAMS             (LIBAVFORMAT_VERSION_MAJOR < 53) | 
| 44 #endif | 44 #endif | 
| 45 #ifndef FF_API_OLD_METADATA | 45 #ifndef FF_API_OLD_METADATA | 
| 46 #define FF_API_OLD_METADATA  (LIBAVFORMAT_VERSION_MAJOR < 53) | 46 #define FF_API_OLD_METADATA            (LIBAVFORMAT_VERSION_MAJOR < 53) | 
| 47 #endif | 47 #endif | 
| 48 #ifndef FF_API_URL_CLASS | 48 #ifndef FF_API_URL_CLASS | 
| 49 #define FF_API_URL_CLASS     (LIBAVFORMAT_VERSION_MAJOR >= 53) | 49 #define FF_API_URL_CLASS               (LIBAVFORMAT_VERSION_MAJOR >= 53) | 
| 50 #endif | 50 #endif | 
| 51 #ifndef FF_API_URL_RESETBUF | 51 #ifndef FF_API_URL_RESETBUF | 
| 52 #define FF_API_URL_RESETBUF       (LIBAVFORMAT_VERSION_MAJOR < 53) | 52 #define FF_API_URL_RESETBUF            (LIBAVFORMAT_VERSION_MAJOR < 53) | 
| 53 #endif | 53 #endif | 
| 54 #ifndef FF_API_REGISTER_PROTOCOL | 54 #ifndef FF_API_REGISTER_PROTOCOL | 
| 55 #define FF_API_REGISTER_PROTOCOL  (LIBAVFORMAT_VERSION_MAJOR < 53) | 55 #define FF_API_REGISTER_PROTOCOL       (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 56 #endif | 
|  | 57 #ifndef FF_API_GUESS_FORMAT | 
|  | 58 #define FF_API_GUESS_FORMAT            (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 59 #endif | 
|  | 60 #ifndef FF_API_UDP_GET_FILE | 
|  | 61 #define FF_API_UDP_GET_FILE            (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 62 #endif | 
|  | 63 #ifndef FF_API_URL_SPLIT | 
|  | 64 #define FF_API_URL_SPLIT               (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 65 #endif | 
|  | 66 #ifndef FF_API_ALLOC_FORMAT_CONTEXT | 
|  | 67 #define FF_API_ALLOC_FORMAT_CONTEXT    (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 68 #endif | 
|  | 69 #ifndef FF_API_PARSE_FRAME_PARAM | 
|  | 70 #define FF_API_PARSE_FRAME_PARAM       (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 71 #endif | 
|  | 72 #ifndef FF_API_READ_SEEK | 
|  | 73 #define FF_API_READ_SEEK               (LIBAVFORMAT_VERSION_MAJOR < 54) | 
|  | 74 #endif | 
|  | 75 #ifndef FF_API_LAVF_UNUSED | 
|  | 76 #define FF_API_LAVF_UNUSED             (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 77 #endif | 
|  | 78 #ifndef FF_API_PARAMETERS_CODEC_ID | 
|  | 79 #define FF_API_PARAMETERS_CODEC_ID     (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 80 #endif | 
|  | 81 #ifndef FF_API_FIRST_FORMAT | 
|  | 82 #define FF_API_FIRST_FORMAT            (LIBAVFORMAT_VERSION_MAJOR < 53) | 
|  | 83 #endif | 
|  | 84 #ifndef FF_API_SYMVER | 
|  | 85 #define FF_API_SYMVER                  (LIBAVFORMAT_VERSION_MAJOR < 53) | 
| 56 #endif | 86 #endif | 
| 57 | 87 | 
| 58 /** | 88 /** | 
| 59  * I return the LIBAVFORMAT_VERSION_INT constant.  You got | 89  * I return the LIBAVFORMAT_VERSION_INT constant.  You got | 
| 60  * a fucking problem with that, douchebag? | 90  * a fucking problem with that, douchebag? | 
| 61  */ | 91  */ | 
| 62 unsigned avformat_version(void); | 92 unsigned avformat_version(void); | 
| 63 | 93 | 
| 64 /** | 94 /** | 
| 65  * Return the libavformat build-time configuration. | 95  * Return the libavformat build-time configuration. | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 100  *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. | 130  *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. | 
| 101  *    a) language -- a tag whose value is localized for a particular language | 131  *    a) language -- a tag whose value is localized for a particular language | 
| 102  *       is appended with the ISO 639-2/B 3-letter language code. | 132  *       is appended with the ISO 639-2/B 3-letter language code. | 
| 103  *       For example: Author-ger=Michael, Author-eng=Mike | 133  *       For example: Author-ger=Michael, Author-eng=Mike | 
| 104  *       The original/default language is in the unqualified "Author" tag. | 134  *       The original/default language is in the unqualified "Author" tag. | 
| 105  *       A demuxer should set a default if it sets any translated tag. | 135  *       A demuxer should set a default if it sets any translated tag. | 
| 106  *    b) sorting  -- a modified version of a tag that should be used for | 136  *    b) sorting  -- a modified version of a tag that should be used for | 
| 107  *       sorting will have '-sort' appended. E.g. artist="The Beatles", | 137  *       sorting will have '-sort' appended. E.g. artist="The Beatles", | 
| 108  *       artist-sort="Beatles, The". | 138  *       artist-sort="Beatles, The". | 
| 109  * | 139  * | 
| 110  * 4. Tag names are normally exported exactly as stored in the container to | 140  * 4. Demuxers attempt to export metadata in a generic format, however tags | 
| 111  *    allow lossless remuxing to the same format. For container-independent | 141  *    with no generic equivalents are left as they are stored in the container. | 
| 112  *    handling of metadata, av_metadata_conv() can convert it to ffmpeg generic | 142  *    Follows a list of generic tag names: | 
| 113  *    format. Follows a list of generic tag names: |  | 
| 114  * | 143  * | 
| 115  * album        -- name of the set this work belongs to | 144  * album        -- name of the set this work belongs to | 
| 116  * album_artist -- main creator of the set/album, if different from artist. | 145  * album_artist -- main creator of the set/album, if different from artist. | 
| 117  *                 e.g. "Various Artists" for compilation albums. | 146  *                 e.g. "Various Artists" for compilation albums. | 
| 118  * artist       -- main creator of the work | 147  * artist       -- main creator of the work | 
| 119  * comment      -- any additional description of the file. | 148  * comment      -- any additional description of the file. | 
| 120  * composer     -- who composed the work, if different from artist. | 149  * composer     -- who composed the work, if different from artist. | 
| 121  * copyright    -- name of copyright holder. | 150  * copyright    -- name of copyright holder. | 
| 122  * date         -- date when the work was created, preferably in ISO 8601. | 151  * date         -- date when the work was created, preferably in ISO 8601. | 
| 123  * disc         -- number of a subset, e.g. disc in a multi-disc collection. | 152  * disc         -- number of a subset, e.g. disc in a multi-disc collection. | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
| 140 #define AV_METADATA_DONT_STRDUP_KEY 4 | 169 #define AV_METADATA_DONT_STRDUP_KEY 4 | 
| 141 #define AV_METADATA_DONT_STRDUP_VAL 8 | 170 #define AV_METADATA_DONT_STRDUP_VAL 8 | 
| 142 #define AV_METADATA_DONT_OVERWRITE 16   ///< Don't overwrite existing tags. | 171 #define AV_METADATA_DONT_OVERWRITE 16   ///< Don't overwrite existing tags. | 
| 143 | 172 | 
| 144 typedef struct { | 173 typedef struct { | 
| 145     char *key; | 174     char *key; | 
| 146     char *value; | 175     char *value; | 
| 147 }AVMetadataTag; | 176 }AVMetadataTag; | 
| 148 | 177 | 
| 149 typedef struct AVMetadata AVMetadata; | 178 typedef struct AVMetadata AVMetadata; | 
|  | 179 #if FF_API_OLD_METADATA | 
| 150 typedef struct AVMetadataConv AVMetadataConv; | 180 typedef struct AVMetadataConv AVMetadataConv; | 
|  | 181 #endif | 
| 151 | 182 | 
| 152 /** | 183 /** | 
| 153  * Get a metadata element with matching key. | 184  * Get a metadata element with matching key. | 
| 154  * | 185  * | 
| 155  * @param prev Set to the previous matching element to find the next. | 186  * @param prev Set to the previous matching element to find the next. | 
| 156  *             If set to NULL the first matching element is returned. | 187  *             If set to NULL the first matching element is returned. | 
| 157  * @param flags Allows case as well as suffix-insensitive comparisons. | 188  * @param flags Allows case as well as suffix-insensitive comparisons. | 
| 158  * @return Found tag or NULL, changing key or value leads to undefined behavior. | 189  * @return Found tag or NULL, changing key or value leads to undefined behavior. | 
| 159  */ | 190  */ | 
| 160 AVMetadataTag * | 191 AVMetadataTag * | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
| 179  * | 210  * | 
| 180  * @param pm pointer to a pointer to a metadata struct. If *pm is NULL | 211  * @param pm pointer to a pointer to a metadata struct. If *pm is NULL | 
| 181  * a metadata struct is allocated and put in *pm. | 212  * a metadata struct is allocated and put in *pm. | 
| 182  * @param key tag key to add to *pm (will be av_strduped depending on flags) | 213  * @param key tag key to add to *pm (will be av_strduped depending on flags) | 
| 183  * @param value tag value to add to *pm (will be av_strduped depending on flags)
      . | 214  * @param value tag value to add to *pm (will be av_strduped depending on flags)
      . | 
| 184  *        Passing a NULL value will cause an existing tag to be deleted. | 215  *        Passing a NULL value will cause an existing tag to be deleted. | 
| 185  * @return >= 0 on success otherwise an error code <0 | 216  * @return >= 0 on success otherwise an error code <0 | 
| 186  */ | 217  */ | 
| 187 int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int fl
      ags); | 218 int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int fl
      ags); | 
| 188 | 219 | 
|  | 220 #if FF_API_OLD_METADATA | 
| 189 /** | 221 /** | 
| 190  * Convert all the metadata sets from ctx according to the source and | 222  * This function is provided for compatibility reason and currently does nothing
      . | 
| 191  * destination conversion tables. If one of the tables is NULL, then |  | 
| 192  * tags are converted to/from ffmpeg generic tag names. |  | 
| 193  * |  | 
| 194  * @param d_conv destination tags format conversion table |  | 
| 195  * @param s_conv source tags format conversion table |  | 
| 196  */ | 223  */ | 
| 197 void av_metadata_conv(struct AVFormatContext *ctx, const AVMetadataConv *d_conv, | 224 attribute_deprecated void av_metadata_conv(struct AVFormatContext *ctx, const AV
      MetadataConv *d_conv, | 
| 198                                                    const AVMetadataConv *s_conv)
      ; | 225                                                                         const AV
      MetadataConv *s_conv); | 
|  | 226 #endif | 
| 199 | 227 | 
| 200 /** | 228 /** | 
| 201  * Free all the memory allocated for an AVMetadata struct. | 229  * Free all the memory allocated for an AVMetadata struct. | 
| 202  */ | 230  */ | 
| 203 void av_metadata_free(AVMetadata **m); | 231 void av_metadata_free(AVMetadata **m); | 
| 204 | 232 | 
| 205 | 233 | 
| 206 /* packet functions */ | 234 /* packet functions */ | 
| 207 | 235 | 
| 208 | 236 | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 254     enum PixelFormat pix_fmt; | 282     enum PixelFormat pix_fmt; | 
| 255     int channel; /**< Used to select DV channel. */ | 283     int channel; /**< Used to select DV channel. */ | 
| 256     const char *standard; /**< TV standard, NTSC, PAL, SECAM */ | 284     const char *standard; /**< TV standard, NTSC, PAL, SECAM */ | 
| 257     unsigned int mpeg2ts_raw:1;  /**< Force raw MPEG-2 transport stream output, 
      if possible. */ | 285     unsigned int mpeg2ts_raw:1;  /**< Force raw MPEG-2 transport stream output, 
      if possible. */ | 
| 258     unsigned int mpeg2ts_compute_pcr:1; /**< Compute exact PCR for each transpor
      t | 286     unsigned int mpeg2ts_compute_pcr:1; /**< Compute exact PCR for each transpor
      t | 
| 259                                             stream packet (only meaningful if | 287                                             stream packet (only meaningful if | 
| 260                                             mpeg2ts_raw is TRUE). */ | 288                                             mpeg2ts_raw is TRUE). */ | 
| 261     unsigned int initial_pause:1;       /**< Do not begin to play the stream | 289     unsigned int initial_pause:1;       /**< Do not begin to play the stream | 
| 262                                             immediately (RTSP only). */ | 290                                             immediately (RTSP only). */ | 
| 263     unsigned int prealloced_context:1; | 291     unsigned int prealloced_context:1; | 
| 264 #if LIBAVFORMAT_VERSION_INT < (53<<16) | 292 #if FF_API_PARAMETERS_CODEC_ID | 
| 265     enum CodecID video_codec_id; | 293     attribute_deprecated enum CodecID video_codec_id; | 
| 266     enum CodecID audio_codec_id; | 294     attribute_deprecated enum CodecID audio_codec_id; | 
| 267 #endif | 295 #endif | 
| 268 } AVFormatParameters; | 296 } AVFormatParameters; | 
| 269 | 297 | 
| 270 //! Demuxer will use url_fopen, no opened file should be provided by the caller. | 298 //! Demuxer will use url_fopen, no opened file should be provided by the caller. | 
| 271 #define AVFMT_NOFILE        0x0001 | 299 #define AVFMT_NOFILE        0x0001 | 
| 272 #define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */ | 300 #define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */ | 
| 273 #define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */ | 301 #define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */ | 
| 274 #define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for | 302 #define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for | 
| 275                                       raw picture data. */ | 303                                       raw picture data. */ | 
| 276 #define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */ | 304 #define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */ | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 312                              AVPacket *in, int flush); | 340                              AVPacket *in, int flush); | 
| 313 | 341 | 
| 314     /** | 342     /** | 
| 315      * List of supported codec_id-codec_tag pairs, ordered by "better | 343      * List of supported codec_id-codec_tag pairs, ordered by "better | 
| 316      * choice first". The arrays are all terminated by CODEC_ID_NONE. | 344      * choice first". The arrays are all terminated by CODEC_ID_NONE. | 
| 317      */ | 345      */ | 
| 318     const struct AVCodecTag * const *codec_tag; | 346     const struct AVCodecTag * const *codec_tag; | 
| 319 | 347 | 
| 320     enum CodecID subtitle_codec; /**< default subtitle codec */ | 348     enum CodecID subtitle_codec; /**< default subtitle codec */ | 
| 321 | 349 | 
|  | 350 #if FF_API_OLD_METADATA | 
| 322     const AVMetadataConv *metadata_conv; | 351     const AVMetadataConv *metadata_conv; | 
|  | 352 #endif | 
| 323 | 353 | 
| 324     /* private fields */ | 354     /* private fields */ | 
| 325     struct AVOutputFormat *next; | 355     struct AVOutputFormat *next; | 
| 326 } AVOutputFormat; | 356 } AVOutputFormat; | 
| 327 | 357 | 
| 328 typedef struct AVInputFormat { | 358 typedef struct AVInputFormat { | 
| 329     /** | 359     /** | 
| 330      * A comma separated list of short names for the format. New names | 360      * A comma separated list of short names for the format. New names | 
| 331      * may be appended with a minor bump. | 361      * may be appended with a minor bump. | 
| 332      */ | 362      */ | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 370      *         or must be freed before returning | 400      *         or must be freed before returning | 
| 371      */ | 401      */ | 
| 372     int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); | 402     int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); | 
| 373 | 403 | 
| 374     /** | 404     /** | 
| 375      * Close the stream. The AVFormatContext and AVStreams are not | 405      * Close the stream. The AVFormatContext and AVStreams are not | 
| 376      * freed by this function | 406      * freed by this function | 
| 377      */ | 407      */ | 
| 378     int (*read_close)(struct AVFormatContext *); | 408     int (*read_close)(struct AVFormatContext *); | 
| 379 | 409 | 
| 380 #if LIBAVFORMAT_VERSION_MAJOR < 53 | 410 #if FF_API_READ_SEEK | 
| 381     /** | 411     /** | 
| 382      * Seek to a given timestamp relative to the frames in | 412      * Seek to a given timestamp relative to the frames in | 
| 383      * stream component stream_index. | 413      * stream component stream_index. | 
| 384      * @param stream_index Must not be -1. | 414      * @param stream_index Must not be -1. | 
| 385      * @param flags Selects which direction should be preferred if no exact | 415      * @param flags Selects which direction should be preferred if no exact | 
| 386      *              match is available. | 416      *              match is available. | 
| 387      * @return >= 0 on success (but not necessarily the new offset) | 417      * @return >= 0 on success (but not necessarily the new offset) | 
| 388      */ | 418      */ | 
| 389     int (*read_seek)(struct AVFormatContext *, | 419     attribute_deprecated int (*read_seek)(struct AVFormatContext *, | 
| 390                      int stream_index, int64_t timestamp, int flags); | 420                                           int stream_index, int64_t timestamp, i
      nt flags); | 
| 391 #endif | 421 #endif | 
| 392     /** | 422     /** | 
| 393      * Gets the next timestamp in stream[stream_index].time_base units. | 423      * Gets the next timestamp in stream[stream_index].time_base units. | 
| 394      * @return the timestamp or AV_NOPTS_VALUE if an error occurred | 424      * @return the timestamp or AV_NOPTS_VALUE if an error occurred | 
| 395      */ | 425      */ | 
| 396     int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index, | 426     int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index, | 
| 397                               int64_t *pos, int64_t pos_limit); | 427                               int64_t *pos, int64_t pos_limit); | 
| 398 | 428 | 
| 399     /** | 429     /** | 
| 400      * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. | 430      * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 428     const struct AVCodecTag * const *codec_tag; | 458     const struct AVCodecTag * const *codec_tag; | 
| 429 | 459 | 
| 430     /** | 460     /** | 
| 431      * Seek to timestamp ts. | 461      * Seek to timestamp ts. | 
| 432      * Seeking will be done so that the point from which all active streams | 462      * Seeking will be done so that the point from which all active streams | 
| 433      * can be presented successfully will be closest to ts and within min/max_ts
      . | 463      * can be presented successfully will be closest to ts and within min/max_ts
      . | 
| 434      * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL
      . | 464      * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL
      . | 
| 435      */ | 465      */ | 
| 436     int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_t
      s, int64_t ts, int64_t max_ts, int flags); | 466     int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_t
      s, int64_t ts, int64_t max_ts, int flags); | 
| 437 | 467 | 
|  | 468 #if FF_API_OLD_METADATA | 
| 438     const AVMetadataConv *metadata_conv; | 469     const AVMetadataConv *metadata_conv; | 
|  | 470 #endif | 
| 439 | 471 | 
| 440     /* private fields */ | 472     /* private fields */ | 
| 441     struct AVInputFormat *next; | 473     struct AVInputFormat *next; | 
| 442 } AVInputFormat; | 474 } AVInputFormat; | 
| 443 | 475 | 
| 444 enum AVStreamParseType { | 476 enum AVStreamParseType { | 
| 445     AVSTREAM_PARSE_NONE, | 477     AVSTREAM_PARSE_NONE, | 
| 446     AVSTREAM_PARSE_FULL,       /**< full parsing and repack */ | 478     AVSTREAM_PARSE_FULL,       /**< full parsing and repack */ | 
| 447     AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */ | 479     AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */ | 
| 448     AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps
       for frames not starting on a packet boundary */ | 480     AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps
       for frames not starting on a packet boundary */ | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 531     int64_t start_time; | 563     int64_t start_time; | 
| 532 | 564 | 
| 533     /** | 565     /** | 
| 534      * Decoding: duration of the stream, in stream time base. | 566      * Decoding: duration of the stream, in stream time base. | 
| 535      * If a source file does not specify a duration, but does specify | 567      * If a source file does not specify a duration, but does specify | 
| 536      * a bitrate, this value will be estimated from bitrate and file size. | 568      * a bitrate, this value will be estimated from bitrate and file size. | 
| 537      */ | 569      */ | 
| 538     int64_t duration; | 570     int64_t duration; | 
| 539 | 571 | 
| 540 #if FF_API_OLD_METADATA | 572 #if FF_API_OLD_METADATA | 
| 541     char language[4]; /**< ISO 639-2/B 3-letter language code (empty string if u
      ndefined) */ | 573     attribute_deprecated char language[4]; /**< ISO 639-2/B 3-letter language co
      de (empty string if undefined) */ | 
| 542 #endif | 574 #endif | 
| 543 | 575 | 
| 544     /* av_read_frame() support */ | 576     /* av_read_frame() support */ | 
| 545     enum AVStreamParseType need_parsing; | 577     enum AVStreamParseType need_parsing; | 
| 546     struct AVCodecParserContext *parser; | 578     struct AVCodecParserContext *parser; | 
| 547 | 579 | 
| 548     int64_t cur_dts; | 580     int64_t cur_dts; | 
| 549     int last_IP_duration; | 581     int last_IP_duration; | 
| 550     int64_t last_IP_pts; | 582     int64_t last_IP_pts; | 
| 551     /* av_seek_frame() support */ | 583     /* av_seek_frame() support */ | 
| 552     AVIndexEntry *index_entries; /**< Only used if the format does not | 584     AVIndexEntry *index_entries; /**< Only used if the format does not | 
| 553                                     support seeking natively. */ | 585                                     support seeking natively. */ | 
| 554     int nb_index_entries; | 586     int nb_index_entries; | 
| 555     unsigned int index_entries_allocated_size; | 587     unsigned int index_entries_allocated_size; | 
| 556 | 588 | 
| 557     int64_t nb_frames;                 ///< number of frames in this stream if k
      nown or 0 | 589     int64_t nb_frames;                 ///< number of frames in this stream if k
      nown or 0 | 
| 558 | 590 | 
| 559 #if LIBAVFORMAT_VERSION_INT < (53<<16) | 591 #if FF_API_LAVF_UNUSED | 
| 560     int64_t unused[4+1]; | 592     attribute_deprecated int64_t unused[4+1]; | 
| 561 #endif | 593 #endif | 
| 562 | 594 | 
| 563 #if FF_API_OLD_METADATA | 595 #if FF_API_OLD_METADATA | 
| 564     char *filename; /**< source filename of the stream */ | 596     attribute_deprecated char *filename; /**< source filename of the stream */ | 
| 565 #endif | 597 #endif | 
| 566 | 598 | 
| 567     int disposition; /**< AV_DISPOSITION_* bit field */ | 599     int disposition; /**< AV_DISPOSITION_* bit field */ | 
| 568 | 600 | 
| 569     AVProbeData probe_data; | 601     AVProbeData probe_data; | 
| 570 #define MAX_REORDER_DELAY 16 | 602 #define MAX_REORDER_DELAY 16 | 
| 571     int64_t pts_buffer[MAX_REORDER_DELAY+1]; | 603     int64_t pts_buffer[MAX_REORDER_DELAY+1]; | 
| 572 | 604 | 
| 573     /** | 605     /** | 
| 574      * sample aspect ratio (0 if unknown) | 606      * sample aspect ratio (0 if unknown) | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 635 | 667 | 
| 636 /** | 668 /** | 
| 637  * New fields can be added to the end with minor version bumps. | 669  * New fields can be added to the end with minor version bumps. | 
| 638  * Removal, reordering and changes to existing fields require a major | 670  * Removal, reordering and changes to existing fields require a major | 
| 639  * version bump. | 671  * version bump. | 
| 640  * sizeof(AVProgram) must not be used outside libav*. | 672  * sizeof(AVProgram) must not be used outside libav*. | 
| 641  */ | 673  */ | 
| 642 typedef struct AVProgram { | 674 typedef struct AVProgram { | 
| 643     int            id; | 675     int            id; | 
| 644 #if FF_API_OLD_METADATA | 676 #if FF_API_OLD_METADATA | 
| 645     char           *provider_name; ///< network name for DVB streams | 677     attribute_deprecated char           *provider_name; ///< network name for DV
      B streams | 
| 646     char           *name;          ///< service name for DVB streams | 678     attribute_deprecated char           *name;          ///< service name for DV
      B streams | 
| 647 #endif | 679 #endif | 
| 648     int            flags; | 680     int            flags; | 
| 649     enum AVDiscard discard;        ///< selects which program to discard and whi
      ch to feed to the caller | 681     enum AVDiscard discard;        ///< selects which program to discard and whi
      ch to feed to the caller | 
| 650     unsigned int   *stream_index; | 682     unsigned int   *stream_index; | 
| 651     unsigned int   nb_stream_indexes; | 683     unsigned int   nb_stream_indexes; | 
| 652     AVMetadata *metadata; | 684     AVMetadata *metadata; | 
| 653 } AVProgram; | 685 } AVProgram; | 
| 654 | 686 | 
| 655 #define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present | 687 #define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present | 
| 656                                          (streams are added dynamically) */ | 688                                          (streams are added dynamically) */ | 
| 657 | 689 | 
| 658 typedef struct AVChapter { | 690 typedef struct AVChapter { | 
| 659     int id;                 ///< unique ID to identify the chapter | 691     int id;                 ///< unique ID to identify the chapter | 
| 660     AVRational time_base;   ///< time base in which the start/end timestamps are
       specified | 692     AVRational time_base;   ///< time base in which the start/end timestamps are
       specified | 
| 661     int64_t start, end;     ///< chapter start/end time in time_base units | 693     int64_t start, end;     ///< chapter start/end time in time_base units | 
| 662 #if FF_API_OLD_METADATA | 694 #if FF_API_OLD_METADATA | 
| 663     char *title;            ///< chapter title | 695     attribute_deprecated char *title;            ///< chapter title | 
| 664 #endif | 696 #endif | 
| 665     AVMetadata *metadata; | 697     AVMetadata *metadata; | 
| 666 } AVChapter; | 698 } AVChapter; | 
| 667 | 699 | 
| 668 #if FF_API_MAX_STREAMS | 700 #if FF_API_MAX_STREAMS | 
| 669 #define MAX_STREAMS 20 | 701 #define MAX_STREAMS 20 | 
| 670 #endif | 702 #endif | 
| 671 | 703 | 
| 672 /** | 704 /** | 
| 673  * Format I/O context. | 705  * Format I/O context. | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 686     unsigned int nb_streams; | 718     unsigned int nb_streams; | 
| 687 #if FF_API_MAX_STREAMS | 719 #if FF_API_MAX_STREAMS | 
| 688     AVStream *streams[MAX_STREAMS]; | 720     AVStream *streams[MAX_STREAMS]; | 
| 689 #else | 721 #else | 
| 690     AVStream **streams; | 722     AVStream **streams; | 
| 691 #endif | 723 #endif | 
| 692     char filename[1024]; /**< input or output filename */ | 724     char filename[1024]; /**< input or output filename */ | 
| 693     /* stream info */ | 725     /* stream info */ | 
| 694     int64_t timestamp; | 726     int64_t timestamp; | 
| 695 #if FF_API_OLD_METADATA | 727 #if FF_API_OLD_METADATA | 
| 696     char title[512]; | 728     attribute_deprecated char title[512]; | 
| 697     char author[512]; | 729     attribute_deprecated char author[512]; | 
| 698     char copyright[512]; | 730     attribute_deprecated char copyright[512]; | 
| 699     char comment[512]; | 731     attribute_deprecated char comment[512]; | 
| 700     char album[512]; | 732     attribute_deprecated char album[512]; | 
| 701     int year;  /**< ID3 year, 0 if none */ | 733     attribute_deprecated int year;  /**< ID3 year, 0 if none */ | 
| 702     int track; /**< track number, 0 if none */ | 734     attribute_deprecated int track; /**< track number, 0 if none */ | 
| 703     char genre[32]; /**< ID3 genre */ | 735     attribute_deprecated char genre[32]; /**< ID3 genre */ | 
| 704 #endif | 736 #endif | 
| 705 | 737 | 
| 706     int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */ | 738     int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */ | 
| 707     /* private data for pts handling (do not modify directly). */ | 739     /* private data for pts handling (do not modify directly). */ | 
| 708     /** | 740     /** | 
| 709      * This buffer is only needed when packets were already buffered but | 741      * This buffer is only needed when packets were already buffered but | 
| 710      * not decoded, for example to get the codec parameters in MPEG | 742      * not decoded, for example to get the codec parameters in MPEG | 
| 711      * streams. | 743      * streams. | 
| 712      */ | 744      */ | 
| 713     struct AVPacketList *packet_buffer; | 745     struct AVPacketList *packet_buffer; | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
| 734 | 766 | 
| 735     /** | 767     /** | 
| 736      * Decoding: total stream bitrate in bit/s, 0 if not | 768      * Decoding: total stream bitrate in bit/s, 0 if not | 
| 737      * available. Never set it directly if the file_size and the | 769      * available. Never set it directly if the file_size and the | 
| 738      * duration are known as FFmpeg can compute it automatically. | 770      * duration are known as FFmpeg can compute it automatically. | 
| 739      */ | 771      */ | 
| 740     int bit_rate; | 772     int bit_rate; | 
| 741 | 773 | 
| 742     /* av_read_frame() support */ | 774     /* av_read_frame() support */ | 
| 743     AVStream *cur_st; | 775     AVStream *cur_st; | 
| 744 #if LIBAVFORMAT_VERSION_INT < (53<<16) | 776 #if FF_API_LAVF_UNUSED | 
| 745     const uint8_t *cur_ptr_deprecated; | 777     const uint8_t *cur_ptr_deprecated; | 
| 746     int cur_len_deprecated; | 778     int cur_len_deprecated; | 
| 747     AVPacket cur_pkt_deprecated; | 779     AVPacket cur_pkt_deprecated; | 
| 748 #endif | 780 #endif | 
| 749 | 781 | 
| 750     /* av_seek_frame() support */ | 782     /* av_seek_frame() support */ | 
| 751     int64_t data_offset; /**< offset of the first packet */ | 783     int64_t data_offset; /**< offset of the first packet */ | 
| 752     int index_built; | 784     int index_built; | 
| 753 | 785 | 
| 754     int mux_rate; | 786     int mux_rate; | 
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 864      * - decoding: Unused. | 896      * - decoding: Unused. | 
| 865      */ | 897      */ | 
| 866     int64_t start_time_realtime; | 898     int64_t start_time_realtime; | 
| 867 } AVFormatContext; | 899 } AVFormatContext; | 
| 868 | 900 | 
| 869 typedef struct AVPacketList { | 901 typedef struct AVPacketList { | 
| 870     AVPacket pkt; | 902     AVPacket pkt; | 
| 871     struct AVPacketList *next; | 903     struct AVPacketList *next; | 
| 872 } AVPacketList; | 904 } AVPacketList; | 
| 873 | 905 | 
| 874 #if LIBAVFORMAT_VERSION_INT < (53<<16) | 906 #if FF_API_FIRST_FORMAT | 
| 875 extern AVInputFormat *first_iformat; | 907 attribute_deprecated extern AVInputFormat *first_iformat; | 
| 876 extern AVOutputFormat *first_oformat; | 908 attribute_deprecated extern AVOutputFormat *first_oformat; | 
| 877 #endif | 909 #endif | 
| 878 | 910 | 
| 879 /** | 911 /** | 
| 880  * If f is NULL, returns the first registered input format, | 912  * If f is NULL, returns the first registered input format, | 
| 881  * if f is non-NULL, returns the next registered input format after f | 913  * if f is non-NULL, returns the next registered input format after f | 
| 882  * or NULL if f is the last one. | 914  * or NULL if f is the last one. | 
| 883  */ | 915  */ | 
| 884 AVInputFormat  *av_iformat_next(AVInputFormat  *f); | 916 AVInputFormat  *av_iformat_next(AVInputFormat  *f); | 
| 885 | 917 | 
| 886 /** | 918 /** | 
| 887  * If f is NULL, returns the first registered output format, | 919  * If f is NULL, returns the first registered output format, | 
| 888  * if f is non-NULL, returns the next registered output format after f | 920  * if f is non-NULL, returns the next registered output format after f | 
| 889  * or NULL if f is the last one. | 921  * or NULL if f is the last one. | 
| 890  */ | 922  */ | 
| 891 AVOutputFormat *av_oformat_next(AVOutputFormat *f); | 923 AVOutputFormat *av_oformat_next(AVOutputFormat *f); | 
| 892 | 924 | 
| 893 enum CodecID av_guess_image2_codec(const char *filename); | 925 enum CodecID av_guess_image2_codec(const char *filename); | 
| 894 | 926 | 
| 895 /* XXX: Use automatic init with either ELF sections or C file parser */ | 927 /* XXX: Use automatic init with either ELF sections or C file parser */ | 
| 896 /* modules. */ | 928 /* modules. */ | 
| 897 | 929 | 
| 898 /* utils.c */ | 930 /* utils.c */ | 
| 899 void av_register_input_format(AVInputFormat *format); | 931 void av_register_input_format(AVInputFormat *format); | 
| 900 void av_register_output_format(AVOutputFormat *format); | 932 void av_register_output_format(AVOutputFormat *format); | 
| 901 #if LIBAVFORMAT_VERSION_MAJOR < 53 | 933 #if FF_API_GUESS_FORMAT | 
| 902 attribute_deprecated AVOutputFormat *guess_stream_format(const char *short_name, | 934 attribute_deprecated AVOutputFormat *guess_stream_format(const char *short_name, | 
| 903                                     const char *filename, | 935                                     const char *filename, | 
| 904                                     const char *mime_type); | 936                                     const char *mime_type); | 
| 905 | 937 | 
| 906 /** | 938 /** | 
| 907  * @deprecated Use av_guess_format() instead. | 939  * @deprecated Use av_guess_format() instead. | 
| 908  */ | 940  */ | 
| 909 attribute_deprecated AVOutputFormat *guess_format(const char *short_name, | 941 attribute_deprecated AVOutputFormat *guess_format(const char *short_name, | 
| 910                                                   const char *filename, | 942                                                   const char *filename, | 
| 911                                                   const char *mime_type); | 943                                                   const char *mime_type); | 
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1055  * @param buf_size optional buffer size (zero if default is OK) | 1087  * @param buf_size optional buffer size (zero if default is OK) | 
| 1056  * @param ap Additional parameters needed when opening the file | 1088  * @param ap Additional parameters needed when opening the file | 
| 1057  *           (NULL if default). | 1089  *           (NULL if default). | 
| 1058  * @return 0 if OK, AVERROR_xxx otherwise | 1090  * @return 0 if OK, AVERROR_xxx otherwise | 
| 1059  */ | 1091  */ | 
| 1060 int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, | 1092 int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, | 
| 1061                        AVInputFormat *fmt, | 1093                        AVInputFormat *fmt, | 
| 1062                        int buf_size, | 1094                        int buf_size, | 
| 1063                        AVFormatParameters *ap); | 1095                        AVFormatParameters *ap); | 
| 1064 | 1096 | 
| 1065 #if LIBAVFORMAT_VERSION_MAJOR < 53 | 1097 #if FF_API_ALLOC_FORMAT_CONTEXT | 
| 1066 /** | 1098 /** | 
| 1067  * @deprecated Use avformat_alloc_context() instead. | 1099  * @deprecated Use avformat_alloc_context() instead. | 
| 1068  */ | 1100  */ | 
| 1069 attribute_deprecated AVFormatContext *av_alloc_format_context(void); | 1101 attribute_deprecated AVFormatContext *av_alloc_format_context(void); | 
| 1070 #endif | 1102 #endif | 
| 1071 | 1103 | 
| 1072 /** | 1104 /** | 
| 1073  * Allocate an AVFormatContext. | 1105  * Allocate an AVFormatContext. | 
| 1074  * Can be freed with av_free() but do not forget to free everything you | 1106  * Can be freed with av_free() but do not forget to free everything you | 
| 1075  * explicitly allocated as well! | 1107  * explicitly allocated as well! | 
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1406  * @param s media file handle | 1438  * @param s media file handle | 
| 1407  * @return 0 if OK, AVERROR_xxx on error | 1439  * @return 0 if OK, AVERROR_xxx on error | 
| 1408  */ | 1440  */ | 
| 1409 int av_write_trailer(AVFormatContext *s); | 1441 int av_write_trailer(AVFormatContext *s); | 
| 1410 | 1442 | 
| 1411 void dump_format(AVFormatContext *ic, | 1443 void dump_format(AVFormatContext *ic, | 
| 1412                  int index, | 1444                  int index, | 
| 1413                  const char *url, | 1445                  const char *url, | 
| 1414                  int is_output); | 1446                  int is_output); | 
| 1415 | 1447 | 
| 1416 #if LIBAVFORMAT_VERSION_MAJOR < 53 | 1448 #if FF_API_PARSE_FRAME_PARAM | 
| 1417 /** | 1449 /** | 
| 1418  * Parse width and height out of string str. | 1450  * Parse width and height out of string str. | 
| 1419  * @deprecated Use av_parse_video_frame_size instead. | 1451  * @deprecated Use av_parse_video_frame_size instead. | 
| 1420  */ | 1452  */ | 
| 1421 attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr, | 1453 attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr, | 
| 1422                                           const char *str); | 1454                                           const char *str); | 
| 1423 | 1455 | 
| 1424 /** | 1456 /** | 
| 1425  * Convert framerate from a string to a fraction. | 1457  * Convert framerate from a string to a fraction. | 
| 1426  * @deprecated Use av_parse_video_frame_rate instead. | 1458  * @deprecated Use av_parse_video_frame_rate instead. | 
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1518 | 1550 | 
| 1519 /** | 1551 /** | 
| 1520  * Return a positive value if the given filename has one of the given | 1552  * Return a positive value if the given filename has one of the given | 
| 1521  * extensions, 0 otherwise. | 1553  * extensions, 0 otherwise. | 
| 1522  * | 1554  * | 
| 1523  * @param extensions a comma-separated list of filename extensions | 1555  * @param extensions a comma-separated list of filename extensions | 
| 1524  */ | 1556  */ | 
| 1525 int av_match_ext(const char *filename, const char *extensions); | 1557 int av_match_ext(const char *filename, const char *extensions); | 
| 1526 | 1558 | 
| 1527 #endif /* AVFORMAT_AVFORMAT_H */ | 1559 #endif /* AVFORMAT_AVFORMAT_H */ | 
| OLD | NEW | 
|---|