diff avformat.h @ 1677:2a85c82b8538 libavformat

add codec_id <-> codec_tag tables to AVIn/OutputFormat
author michael
date Sun, 21 Jan 2007 01:39:17 +0000
parents b8656dd86312
children ba58d49d4685
line wrap: on
line diff
--- a/avformat.h	Sat Jan 20 23:09:27 2007 +0000
+++ b/avformat.h	Sun Jan 21 01:39:17 2007 +0000
@@ -25,8 +25,8 @@
 extern "C" {
 #endif
 
-#define LIBAVFORMAT_VERSION_INT ((51<<16)+(7<<8)+0)
-#define LIBAVFORMAT_VERSION     51.7.0
+#define LIBAVFORMAT_VERSION_INT ((51<<16)+(8<<8)+0)
+#define LIBAVFORMAT_VERSION     51.8.0
 #define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
 
 #define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
@@ -96,6 +96,8 @@
 /*************************************************/
 /* input/output formats */
 
+struct AVCodecTag;
+
 struct AVFormatContext;
 
 /* this structure contains the data a format has to probe a file */
@@ -155,6 +157,13 @@
     /* currently only used to set pixel format if not YUV420P */
     int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *);
     int (*interleave_packet)(struct AVFormatContext *, AVPacket *out, AVPacket *in, int flush);
+
+    /**
+     * list of supported codec_id-codec_tag pairs, ordered by "better choice first"
+     * the arrays are all CODEC_ID_NONE terminated
+     */
+    const struct AVCodecTag *codec_tag[4];
+
     /* private fields */
     struct AVOutputFormat *next;
 } AVOutputFormat;
@@ -210,6 +219,8 @@
        (RTSP) */
     int (*read_pause)(struct AVFormatContext *);
 
+    const struct AVCodecTag *codec_tag[4];
+
     /* private fields */
     struct AVInputFormat *next;
 } AVInputFormat;
@@ -396,6 +407,10 @@
 
 void av_register_all(void);
 
+/* codec tag <-> codec id */
+enum CodecID av_codec_get_id(const struct AVCodecTag *tags[4], unsigned int tag);
+unsigned int av_codec_get_tag(const struct AVCodecTag *tags[4], enum CodecID id);
+
 /* media file input */
 AVInputFormat *av_find_input_format(const char *short_name);
 AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);