Originally committed as revision 24825 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -35,11 +35,11 @@ · 34 unmodified lines | |||
| 35 | 35 | ||
| 36 | #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) | 36 | #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) |
| 37 | 37 | ||
| 38 | #ifndef LAVF_API_MAX_STREAMS | 38 | #ifndef FF_API_MAX_STREAMS |
| 39 | #define LAVF_API_MAX_STREAMS (LIBAVFORMAT_VERSION_MAJOR < 53) | 39 | #define FF_API_MAX_STREAMS (LIBAVFORMAT_VERSION_MAJOR < 53) |
| 40 | #endif | 40 | #endif |
| 41 | #ifndef LAVF_API_OLD_METADATA | 41 | #ifndef FF_API_OLD_METADATA |
| 42 | #define LAVF_API_OLD_METADATA (LIBAVFORMAT_VERSION_MAJOR < 53) | 42 | #define FF_API_OLD_METADATA (LIBAVFORMAT_VERSION_MAJOR < 53) |
| 43 | #endif | 43 | #endif |
| 44 | 44 | ||
| 45 | /** | 45 | /** |
| @@ -147,7 +147,7 @@ typedef struct AVMetadataConv AVMetadataConv; · 101 unmodified lines | |||
| 147 | AVMetadataTag * | 147 | AVMetadataTag * |
| 148 | av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags); | 148 | av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags); |
| 149 | 149 | ||
| 150 | #if LAVF_API_OLD_METADATA | 150 | #if FF_API_OLD_METADATA |
| 151 | /** | 151 | /** |
| 152 | * Set the given tag in *pm, overwriting an existing tag. | 152 | * Set the given tag in *pm, overwriting an existing tag. |
| 153 | * | 153 | * |
| @@ -523,7 +523,7 @@ typedef struct AVStream { · 369 unmodified lines | |||
| 523 | */ | 523 | */ |
| 524 | int64_t duration; | 524 | int64_t duration; |
| 525 | 525 | ||
| 526 | #if LAVF_API_OLD_METADATA | 526 | #if FF_API_OLD_METADATA |
| 527 | char language[4]; /**< ISO 639-2/B 3-letter language code (empty string if undefined) */ | 527 | char language[4]; /**< ISO 639-2/B 3-letter language code (empty string if undefined) */ |
| 528 | #endif | 528 | #endif |
| 529 | 529 | ||
| @@ -546,7 +546,7 @@ typedef struct AVStream { · 16 unmodified lines | |||
| 546 | int64_t unused[4+1]; | 546 | int64_t unused[4+1]; |
| 547 | #endif | 547 | #endif |
| 548 | 548 | ||
| 549 | #if LAVF_API_OLD_METADATA | 549 | #if FF_API_OLD_METADATA |
| 550 | char *filename; /**< source filename of the stream */ | 550 | char *filename; /**< source filename of the stream */ |
| 551 | #endif | 551 | #endif |
| 552 | 552 | ||
| @@ -615,7 +615,7 @@ typedef struct AVStream { · 62 unmodified lines | |||
| 615 | */ | 615 | */ |
| 616 | typedef struct AVProgram { | 616 | typedef struct AVProgram { |
| 617 | int id; | 617 | int id; |
| 618 | #if LAVF_API_OLD_METADATA | 618 | #if FF_API_OLD_METADATA |
| 619 | char *provider_name; ///< network name for DVB streams | 619 | char *provider_name; ///< network name for DVB streams |
| 620 | char *name; ///< service name for DVB streams | 620 | char *name; ///< service name for DVB streams |
| 621 | #endif | 621 | #endif |
| @@ -633,13 +633,13 @@ typedef struct AVChapter { · 11 unmodified lines | |||
| 633 | int id; ///< unique ID to identify the chapter | 633 | int id; ///< unique ID to identify the chapter |
| 634 | AVRational time_base; ///< time base in which the start/end timestamps are specified | 634 | AVRational time_base; ///< time base in which the start/end timestamps are specified |
| 635 | int64_t start, end; ///< chapter start/end time in time_base units | 635 | int64_t start, end; ///< chapter start/end time in time_base units |
| 636 | #if LAVF_API_OLD_METADATA | 636 | #if FF_API_OLD_METADATA |
| 637 | char *title; ///< chapter title | 637 | char *title; ///< chapter title |
| 638 | #endif | 638 | #endif |
| 639 | AVMetadata *metadata; | 639 | AVMetadata *metadata; |
| 640 | } AVChapter; | 640 | } AVChapter; |
| 641 | 641 | ||
| 642 | #if LAVF_API_MAX_STREAMS | 642 | #if FF_API_MAX_STREAMS |
| 643 | #define MAX_STREAMS 20 | 643 | #define MAX_STREAMS 20 |
| 644 | #endif | 644 | #endif |
| 645 | 645 | ||
| @@ -662,7 +662,7 @@ typedef struct AVFormatContext { · 16 unmodified lines | |||
| 662 | char filename[1024]; /**< input or output filename */ | 662 | char filename[1024]; /**< input or output filename */ |
| 663 | /* stream info */ | 663 | /* stream info */ |
| 664 | int64_t timestamp; | 664 | int64_t timestamp; |
| 665 | #if LAVF_API_OLD_METADATA | 665 | #if FF_API_OLD_METADATA |
| 666 | char title[512]; | 666 | char title[512]; |
| 667 | char author[512]; | 667 | char author[512]; |
| 668 | char copyright[512]; | 668 | char copyright[512]; |
| @@ -86,7 +86,7 @@ int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int fl · 85 unmodified lines | |||
| 86 | return 0; | 86 | return 0; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | #if LAVF_API_OLD_METADATA | 89 | #if FF_API_OLD_METADATA |
| 90 | int av_metadata_set(AVMetadata **pm, const char *key, const char *value) | 90 | int av_metadata_set(AVMetadata **pm, const char *key, const char *value) |
| 91 | { | 91 | { |
| 92 | return av_metadata_set2(pm, key, value, 0); | 92 | return av_metadata_set2(pm, key, value, 0); |
| @@ -40,7 +40,7 @@ struct AVMetadataConv{ · 39 unmodified lines | |||
| 40 | const char *generic; | 40 | const char *generic; |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | #if LAVF_API_OLD_METADATA | 43 | #if FF_API_OLD_METADATA |
| 44 | void ff_metadata_demux_compat(AVFormatContext *s); | 44 | void ff_metadata_demux_compat(AVFormatContext *s); |
| 45 | void ff_metadata_mux_compat(AVFormatContext *s); | 45 | void ff_metadata_mux_compat(AVFormatContext *s); |
| 46 | #endif | 46 | #endif |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include "metadata.h" | 23 | #include "metadata.h" |
| 24 | #include "libavutil/avstring.h" | 24 | #include "libavutil/avstring.h" |
| 25 | 25 | ||
| 26 | #if LAVF_API_OLD_METADATA | 26 | #if FF_API_OLD_METADATA |
| 27 | 27 | ||
| 28 | #define SIZE_OFFSET(x) sizeof(((AVFormatContext*)0)->x),offsetof(AVFormatContext,x) | 28 | #define SIZE_OFFSET(x) sizeof(((AVFormatContext*)0)->x),offsetof(AVFormatContext,x) |
| 29 | 29 | ||
| @@ -145,4 +145,4 @@ void ff_metadata_mux_compat(AVFormatContext *ctx) · 115 unmodified lines | |||
| 145 | } | 145 | } |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | #endif /* LAVF_API_OLD_METADATA */ | 148 | #endif /* FF_API_OLD_METADATA */ |
| @@ -686,7 +686,7 @@ static int mpegts_push_data(MpegTSFilter *filter, · 685 unmodified lines | |||
| 686 | code == 0x1be) /* padding_stream */ | 686 | code == 0x1be) /* padding_stream */ |
| 687 | goto skip; | 687 | goto skip; |
| 688 | 688 | ||
| 689 | #if LAVF_API_MAX_STREAMS | 689 | #if FF_API_MAX_STREAMS |
| 690 | if (!pes->st && pes->stream->nb_streams == MAX_STREAMS) | 690 | if (!pes->st && pes->stream->nb_streams == MAX_STREAMS) |
| 691 | goto skip; | 691 | goto skip; |
| 692 | #endif | 692 | #endif |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | |||
| 29 | #undef NDEBUG | 29 | #undef NDEBUG |
| 30 | #include <assert.h> | 30 | #include <assert.h> |
| 31 | 31 | ||
| 32 | #if LAVF_API_MAX_STREAMS | 32 | #if FF_API_MAX_STREAMS |
| 33 | #define NUT_MAX_STREAMS MAX_STREAMS | 33 | #define NUT_MAX_STREAMS MAX_STREAMS |
| 34 | #else | 34 | #else |
| 35 | #define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */ | 35 | #define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */ |
| @@ -50,7 +50,7 @@ static const AVOption options[]={ · 49 unmodified lines | |||
| 50 | {"noparse", "disable AVParsers, this needs nofillin too", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_NOPARSE, INT_MIN, INT_MAX, D, "fflags"}, | 50 | {"noparse", "disable AVParsers, this needs nofillin too", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_NOPARSE, INT_MIN, INT_MAX, D, "fflags"}, |
| 51 | {"igndts", "ignore dts", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_IGNDTS, INT_MIN, INT_MAX, D, "fflags"}, | 51 | {"igndts", "ignore dts", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_IGNDTS, INT_MIN, INT_MAX, D, "fflags"}, |
| 52 | {"rtphint", "add rtp hinting", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_RTP_HINT, INT_MIN, INT_MAX, E, "fflags"}, | 52 | {"rtphint", "add rtp hinting", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_RTP_HINT, INT_MIN, INT_MAX, E, "fflags"}, |
| 53 | #if LAVF_API_OLD_METADATA | 53 | #if FF_API_OLD_METADATA |
| 54 | {"track", " set the track number", OFFSET(track), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, E}, | 54 | {"track", " set the track number", OFFSET(track), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, E}, |
| 55 | {"year", "set the year", OFFSET(year), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, E}, | 55 | {"year", "set the year", OFFSET(year), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, E}, |
| 56 | #endif | 56 | #endif |
| @@ -457,7 +457,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr, · 456 unmodified lines | |||
| 457 | if (pb && !ic->data_offset) | 457 | if (pb && !ic->data_offset) |
| 458 | ic->data_offset = url_ftell(ic->pb); | 458 | ic->data_offset = url_ftell(ic->pb); |
| 459 | 459 | ||
| 460 | #if LAVF_API_OLD_METADATA | 460 | #if FF_API_OLD_METADATA |
| 461 | ff_metadata_demux_compat(ic); | 461 | ff_metadata_demux_compat(ic); |
| 462 | #endif | 462 | #endif |
| 463 | 463 | ||
| @@ -2460,14 +2460,14 @@ void av_close_input_stream(AVFormatContext *s) · 1996 unmodified lines | |||
| 2460 | av_free(st->index_entries); | 2460 | av_free(st->index_entries); |
| 2461 | av_free(st->codec->extradata); | 2461 | av_free(st->codec->extradata); |
| 2462 | av_free(st->codec); | 2462 | av_free(st->codec); |
| 2463 | #if LAVF_API_OLD_METADATA | 2463 | #if FF_API_OLD_METADATA |
| 2464 | av_free(st->filename); | 2464 | av_free(st->filename); |
| 2465 | #endif | 2465 | #endif |
| 2466 | av_free(st->priv_data); | 2466 | av_free(st->priv_data); |
| 2467 | av_free(st); | 2467 | av_free(st); |
| 2468 | } | 2468 | } |
| 2469 | for(i=s->nb_programs-1; i>=0; i--) { | 2469 | for(i=s->nb_programs-1; i>=0; i--) { |
| 2470 | #if LAVF_API_OLD_METADATA | 2470 | #if FF_API_OLD_METADATA |
| 2471 | av_freep(&s->programs[i]->provider_name); | 2471 | av_freep(&s->programs[i]->provider_name); |
| 2472 | av_freep(&s->programs[i]->name); | 2472 | av_freep(&s->programs[i]->name); |
| 2473 | #endif | 2473 | #endif |
| @@ -2479,7 +2479,7 @@ void av_close_input_stream(AVFormatContext *s) · 5 unmodified lines | |||
| 2479 | flush_packet_queue(s); | 2479 | flush_packet_queue(s); |
| 2480 | av_freep(&s->priv_data); | 2480 | av_freep(&s->priv_data); |
| 2481 | while(s->nb_chapters--) { | 2481 | while(s->nb_chapters--) { |
| 2482 | #if LAVF_API_OLD_METADATA | 2482 | #if FF_API_OLD_METADATA |
| 2483 | av_free(s->chapters[s->nb_chapters]->title); | 2483 | av_free(s->chapters[s->nb_chapters]->title); |
| 2484 | #endif | 2484 | #endif |
| 2485 | av_metadata_free(&s->chapters[s->nb_chapters]->metadata); | 2485 | av_metadata_free(&s->chapters[s->nb_chapters]->metadata); |
| @@ -2582,7 +2582,7 @@ AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int6 · 96 unmodified lines | |||
| 2582 | return NULL; | 2582 | return NULL; |
| 2583 | dynarray_add(&s->chapters, &s->nb_chapters, chapter); | 2583 | dynarray_add(&s->chapters, &s->nb_chapters, chapter); |
| 2584 | } | 2584 | } |
| 2585 | #if LAVF_API_OLD_METADATA | 2585 | #if FF_API_OLD_METADATA |
| 2586 | av_free(chapter->title); | 2586 | av_free(chapter->title); |
| 2587 | #endif | 2587 | #endif |
| 2588 | av_metadata_set2(&chapter->metadata, "title", title, 0); | 2588 | av_metadata_set2(&chapter->metadata, "title", title, 0); |
| @@ -2718,7 +2718,7 @@ int av_write_header(AVFormatContext *s) · 129 unmodified lines | |||
| 2718 | return AVERROR(ENOMEM); | 2718 | return AVERROR(ENOMEM); |
| 2719 | } | 2719 | } |
| 2720 | 2720 | ||
| 2721 | #if LAVF_API_OLD_METADATA | 2721 | #if FF_API_OLD_METADATA |
| 2722 | ff_metadata_mux_compat(s); | 2722 | ff_metadata_mux_compat(s); |
| 2723 | #endif | 2723 | #endif |
| 2724 | 2724 | ||