[FFmpeg-devel] [PATCH 2/2] lavf: Add function for accessing Matroska Codec <-> CodecID table

Derek Buitenhuis derek.buitenhuis at gmail.com
Wed May 30 20:09:41 CEST 2012


Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
 doc/APIchanges         |    3 +++
 libavformat/Makefile   |    1 +
 libavformat/avformat.h |    6 ++++++
 libavformat/utils.c    |    6 ++++++
 4 files changed, 16 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index b14204a..f814d5b 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2011-04-18
 
 API changes, most recent first:
 
+2012-05-30 - xxxxxxx - lavf 54.5.100
+  Add avformat_get_mkv_codec_tags()
+
 2012-05-24 - xxxxxxx - lavu 51.54.100
   Move AVPALETTE_SIZE and AVPALETTE_COUNT macros from
   libavcodec/avcodec.h to libavutil/pixfmt.h.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 18a0e19..729ac51 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -17,6 +17,7 @@ OBJS = allformats.o         \
        options.o            \
        os_support.o         \
        riff.o               \
+       matroska.o           \
        sdp.o                \
        seek.o               \
        utils.o              \
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index c3dba8f..1c0d279 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -321,6 +321,7 @@ typedef struct AVFrac {
 /* input/output formats */
 
 struct AVCodecTag;
+struct CodecTags;
 
 /**
  * This structure contains the data a format has to probe a file.
@@ -1925,6 +1926,11 @@ const struct AVCodecTag *avformat_get_riff_audio_tags(void);
  */
 
 /**
+ * @return the table mapping Matroska Codec IDs to libavcodec CodecIDs.
+ */
+const struct CodecTags *avformat_get_mkv_codec_tags(void);
+
+/**
  * Guesses the sample aspect ratio of a frame, based on both the stream and the
  * frame aspect ratio.
  *
diff --git a/libavformat/utils.c b/libavformat/utils.c
index e7fd04a..d792903 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -39,6 +39,7 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/timestamp.h"
 #include "riff.h"
+#include "matroska.h"
 #include "audiointerleave.h"
 #include "url.h"
 #include <sys/time.h>
@@ -4424,6 +4425,11 @@ const struct AVCodecTag *avformat_get_riff_audio_tags(void)
     return ff_codec_wav_tags;
 }
 
+const CodecTags *avformat_get_mkv_codec_tags(void)
+{
+    return ff_mkv_codec_tags;
+}
+
 AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame)
 {
     AVRational undef = {0, 1};
-- 
1.7.10



More information about the ffmpeg-devel mailing list