summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h8
-rw-r--r--libavcodec/utils.c14
-rw-r--r--libavcodec/version.h2
3 files changed, 23 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 4f0ed2d..7c82d73 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -212,6 +212,7 @@ enum CodecID {
CODEC_ID_G2M,
/* various PCM "codecs" */
+ CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
CODEC_ID_PCM_S16LE= 0x10000,
CODEC_ID_PCM_S16BE,
CODEC_ID_PCM_U16LE,
@@ -343,6 +344,7 @@ enum CodecID {
CODEC_ID_CELT,
/* subtitle codecs */
+ CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
CODEC_ID_DVD_SUBTITLE= 0x17000,
CODEC_ID_DVB_SUBTITLE,
CODEC_ID_TEXT, ///< raw UTF-8 text
@@ -355,6 +357,7 @@ enum CodecID {
CODEC_ID_MICRODVD,
/* other specific kind of codecs (generally used for attachments) */
+ CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
CODEC_ID_TTF= 0x18000,
CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
@@ -4342,4 +4345,9 @@ enum AVLockOp {
*/
int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
+/**
+ * Get the type of the given codec.
+ */
+enum AVMediaType avcodec_get_type(enum CodecID codec_id);
+
#endif /* AVCODEC_AVCODEC_H */
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;
+}
diff --git a/libavcodec/version.h b/libavcodec/version.h
index adb9c95..f06184b 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -21,7 +21,7 @@
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 53
-#define LIBAVCODEC_VERSION_MINOR 10
+#define LIBAVCODEC_VERSION_MINOR 11
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
OpenPOWER on IntegriCloud