summaryrefslogtreecommitdiff
path: root/libavcodec
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
parentd071df888d5896031380b2b1733bd0cec833c3b6 (diff)
parent6cd9d0f77d527491d0c3626f16b8e125a8a9344b (diff)
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')
-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 4f0ed2d385..7c82d737bd 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 6175d8302f..ce8c0993a9 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 adb9c95d94..f06184bded 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, \