diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-08-11 20:35:46 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-08-16 20:24:20 +0200 |
commit | 15c14ce6b2473528f7114028dc0732a4b467b624 (patch) | |
tree | fb54eb87cfd977843fd10f99abc98d1b575fa66b /libavformat | |
parent | 48f9e457ea0143e14b04f7ae9cc5358904f9475a (diff) | |
download | ffmpeg-15c14ce6b2473528f7114028dc0732a4b467b624.tar.gz |
matroskaenc: implement query_codec()
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskaenc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index b08f546eb4..6ba750f11a 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1191,6 +1191,22 @@ static int mkv_write_trailer(AVFormatContext *s) return 0; } +static int mkv_query_codec(enum CodecID codec_id, int std_compliance) +{ + int i; + for (i = 0; ff_mkv_codec_tags[i].id != CODEC_ID_NONE; i++) + if (ff_mkv_codec_tags[i].id == codec_id) + return 1; + + if (std_compliance < FF_COMPLIANCE_NORMAL) { // mkv theoretically supports any + enum AVMediaType type = avcodec_get_type(codec_id); // video/audio through VFW/ACM + if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO) + return 1; + } + + return 0; +} + #if CONFIG_MATROSKA_MUXER AVOutputFormat ff_matroska_muxer = { .name = "matroska", @@ -1206,6 +1222,7 @@ AVOutputFormat ff_matroska_muxer = { .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, .codec_tag = (const AVCodecTag* const []){ff_codec_bmp_tags, ff_codec_wav_tags, 0}, .subtitle_codec = CODEC_ID_SSA, + .query_codec = mkv_query_codec, }; #endif |