deprecate old metadata API
Originally committed as revision 17690 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
bc718b4720
commit
827f7e285b
@ -475,7 +475,9 @@ typedef struct AVStream {
|
|||||||
*/
|
*/
|
||||||
int64_t duration;
|
int64_t duration;
|
||||||
|
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */
|
char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* av_read_frame() support */
|
/* av_read_frame() support */
|
||||||
enum AVStreamParseType need_parsing;
|
enum AVStreamParseType need_parsing;
|
||||||
@ -494,9 +496,9 @@ typedef struct AVStream {
|
|||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
int64_t unused[4+1];
|
int64_t unused[4+1];
|
||||||
#endif
|
|
||||||
|
|
||||||
char *filename; /**< source filename of the stream */
|
char *filename; /**< source filename of the stream */
|
||||||
|
#endif
|
||||||
|
|
||||||
int disposition; /**< AV_DISPOSITION_* bit field */
|
int disposition; /**< AV_DISPOSITION_* bit field */
|
||||||
|
|
||||||
@ -539,8 +541,10 @@ typedef struct AVStream {
|
|||||||
*/
|
*/
|
||||||
typedef struct AVProgram {
|
typedef struct AVProgram {
|
||||||
int id;
|
int id;
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
char *provider_name; ///< network name for DVB streams
|
char *provider_name; ///< network name for DVB streams
|
||||||
char *name; ///< service name for DVB streams
|
char *name; ///< service name for DVB streams
|
||||||
|
#endif
|
||||||
int flags;
|
int flags;
|
||||||
enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller
|
enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller
|
||||||
unsigned int *stream_index;
|
unsigned int *stream_index;
|
||||||
@ -555,7 +559,9 @@ typedef struct AVChapter {
|
|||||||
int id; ///< unique ID to identify the chapter
|
int id; ///< unique ID to identify the chapter
|
||||||
AVRational time_base; ///< time base in which the start/end timestamps are specified
|
AVRational time_base; ///< time base in which the start/end timestamps are specified
|
||||||
int64_t start, end; ///< chapter start/end time in time_base units
|
int64_t start, end; ///< chapter start/end time in time_base units
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
char *title; ///< chapter title
|
char *title; ///< chapter title
|
||||||
|
#endif
|
||||||
AVMetadata *metadata;
|
AVMetadata *metadata;
|
||||||
} AVChapter;
|
} AVChapter;
|
||||||
|
|
||||||
@ -580,6 +586,7 @@ typedef struct AVFormatContext {
|
|||||||
char filename[1024]; /**< input or output filename */
|
char filename[1024]; /**< input or output filename */
|
||||||
/* stream info */
|
/* stream info */
|
||||||
int64_t timestamp;
|
int64_t timestamp;
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
char title[512];
|
char title[512];
|
||||||
char author[512];
|
char author[512];
|
||||||
char copyright[512];
|
char copyright[512];
|
||||||
@ -588,6 +595,7 @@ typedef struct AVFormatContext {
|
|||||||
int year; /**< ID3 year, 0 if none */
|
int year; /**< ID3 year, 0 if none */
|
||||||
int track; /**< track number, 0 if none */
|
int track; /**< track number, 0 if none */
|
||||||
char genre[32]; /**< ID3 genre */
|
char genre[32]; /**< ID3 genre */
|
||||||
|
#endif
|
||||||
|
|
||||||
int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
|
int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
|
||||||
/* private data for pts handling (do not modify directly). */
|
/* private data for pts handling (do not modify directly). */
|
||||||
|
@ -46,8 +46,10 @@ static const AVOption options[]={
|
|||||||
{"fflags", NULL, OFFSET(flags), FF_OPT_TYPE_FLAGS, DEFAULT, INT_MIN, INT_MAX, D|E, "fflags"},
|
{"fflags", NULL, OFFSET(flags), FF_OPT_TYPE_FLAGS, DEFAULT, INT_MIN, INT_MAX, D|E, "fflags"},
|
||||||
{"ignidx", "ignore index", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_IGNIDX, INT_MIN, INT_MAX, D, "fflags"},
|
{"ignidx", "ignore index", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_IGNIDX, INT_MIN, INT_MAX, D, "fflags"},
|
||||||
{"genpts", "generate pts", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_GENPTS, INT_MIN, INT_MAX, D, "fflags"},
|
{"genpts", "generate pts", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_GENPTS, INT_MIN, INT_MAX, D, "fflags"},
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
{"track", " set the track number", OFFSET(track), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, E},
|
{"track", " set the track number", OFFSET(track), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, E},
|
||||||
{"year", "set the year", OFFSET(year), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, E},
|
{"year", "set the year", OFFSET(year), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, E},
|
||||||
|
#endif
|
||||||
{"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), FF_OPT_TYPE_INT, 3*AV_TIME_BASE, 0, INT_MAX, D},
|
{"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), FF_OPT_TYPE_INT, 3*AV_TIME_BASE, 0, INT_MAX, D},
|
||||||
{"cryptokey", "decryption key", OFFSET(key), FF_OPT_TYPE_BINARY, 0, 0, 0, D},
|
{"cryptokey", "decryption key", OFFSET(key), FF_OPT_TYPE_BINARY, 0, 0, 0, D},
|
||||||
{"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), FF_OPT_TYPE_INT, 1<<20, 0, INT_MAX, D},
|
{"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), FF_OPT_TYPE_INT, 1<<20, 0, INT_MAX, D},
|
||||||
|
@ -2301,13 +2301,17 @@ void av_close_input_stream(AVFormatContext *s)
|
|||||||
av_free(st->index_entries);
|
av_free(st->index_entries);
|
||||||
av_free(st->codec->extradata);
|
av_free(st->codec->extradata);
|
||||||
av_free(st->codec);
|
av_free(st->codec);
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
av_free(st->filename);
|
av_free(st->filename);
|
||||||
|
#endif
|
||||||
av_free(st->priv_data);
|
av_free(st->priv_data);
|
||||||
av_free(st);
|
av_free(st);
|
||||||
}
|
}
|
||||||
for(i=s->nb_programs-1; i>=0; i--) {
|
for(i=s->nb_programs-1; i>=0; i--) {
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
av_freep(&s->programs[i]->provider_name);
|
av_freep(&s->programs[i]->provider_name);
|
||||||
av_freep(&s->programs[i]->name);
|
av_freep(&s->programs[i]->name);
|
||||||
|
#endif
|
||||||
av_metadata_free(&s->programs[i]->metadata);
|
av_metadata_free(&s->programs[i]->metadata);
|
||||||
av_freep(&s->programs[i]->stream_index);
|
av_freep(&s->programs[i]->stream_index);
|
||||||
av_freep(&s->programs[i]);
|
av_freep(&s->programs[i]);
|
||||||
@ -2316,7 +2320,9 @@ void av_close_input_stream(AVFormatContext *s)
|
|||||||
flush_packet_queue(s);
|
flush_packet_queue(s);
|
||||||
av_freep(&s->priv_data);
|
av_freep(&s->priv_data);
|
||||||
while(s->nb_chapters--) {
|
while(s->nb_chapters--) {
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
av_free(s->chapters[s->nb_chapters]->title);
|
av_free(s->chapters[s->nb_chapters]->title);
|
||||||
|
#endif
|
||||||
av_metadata_free(&s->chapters[s->nb_chapters]->metadata);
|
av_metadata_free(&s->chapters[s->nb_chapters]->metadata);
|
||||||
av_free(s->chapters[s->nb_chapters]);
|
av_free(s->chapters[s->nb_chapters]);
|
||||||
}
|
}
|
||||||
@ -2414,7 +2420,9 @@ AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int6
|
|||||||
return NULL;
|
return NULL;
|
||||||
dynarray_add(&s->chapters, &s->nb_chapters, chapter);
|
dynarray_add(&s->chapters, &s->nb_chapters, chapter);
|
||||||
}
|
}
|
||||||
|
#if LIBAVFORMAT_VERSION_INT < (53<<16)
|
||||||
av_free(chapter->title);
|
av_free(chapter->title);
|
||||||
|
#endif
|
||||||
av_metadata_set(&chapter->metadata, "title", title);
|
av_metadata_set(&chapter->metadata, "title", title);
|
||||||
chapter->id = id;
|
chapter->id = id;
|
||||||
chapter->time_base= time_base;
|
chapter->time_base= time_base;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user