summaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-17 14:23:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-17 14:23:20 +0200
commit27fbe31c921f49078764a69ccb701dbb767c7410 (patch)
tree5a80541540a0a72063c3fa854febb77afc6518b7 /libavcodec/utils.c
parentd071df888d5896031380b2b1733bd0cec833c3b6 (diff)
parent6cd9d0f77d527491d0c3626f16b8e125a8a9344b (diff)
downloadffmpeg-streaming-27fbe31c921f49078764a69ccb701dbb767c7410.zip
ffmpeg-streaming-27fbe31c921f49078764a69ccb701dbb767c7410.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: Revert "avconv: use stream copy by default when possible." avconv: print stream copy information. avconv: use stream copy by default when possible. matroskaenc: vertical alignment. matroskaenc: implement query_codec() lavf: add avformat_query_codec(). lavc: add avcodec_get_type() for mapping codec_id -> type. flvenc: use int64_t to store offsets avconv: don't segfault on 0 input files. Do not write ID3v1 tags by default mpegts: log into an AVFormatContext rather than MpegTSContext. Conflicts: doc/APIchanges libavcodec/version.h libavformat/avformat.h libavformat/mp3enc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 6175d83..ce8c099 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1380,3 +1380,17 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count)
return ff_thread_init(s);
}
#endif
+
+enum AVMediaType avcodec_get_type(enum CodecID codec_id)
+{
+ if (codec_id <= CODEC_ID_NONE)
+ return AVMEDIA_TYPE_UNKNOWN;
+ else if (codec_id < CODEC_ID_FIRST_AUDIO)
+ return AVMEDIA_TYPE_VIDEO;
+ else if (codec_id < CODEC_ID_FIRST_SUBTITLE)
+ return AVMEDIA_TYPE_AUDIO;
+ else if (codec_id < CODEC_ID_FIRST_UNKNOWN)
+ return AVMEDIA_TYPE_SUBTITLE;
+
+ return AVMEDIA_TYPE_UNKNOWN;
+}
OpenPOWER on IntegriCloud