changeset 4618:5b9eddbee9c4 libavformat

Add some basic metadata conversion tables for matroska and asf. Add missing const qualifiers for metadata_conv in AV{In|Out}putFormat.
author aurel
date Sun, 01 Mar 2009 00:12:08 +0000
parents f04bc8b70940
children 108bb305ba6f
files asf.c asf.h asfdec.c asfenc.c avformat.h matroska.c matroska.h matroskadec.c
diffstat 8 files changed, 30 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/asf.c	Sat Feb 28 23:34:16 2009 +0000
+++ b/asf.c	Sun Mar 01 00:12:08 2009 +0000
@@ -111,3 +111,15 @@
 const GUID ff_asf_my_guid = {
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
+
+
+const AVMetadataConv ff_asf_metadata_conv[] = {
+    { "AlbumArtist", "artist"    },
+    { "AlbumTitle" , "album"     },
+    { "Author"     , "author"    },
+    { "Genre"      , "genre"     },
+    { "Copyright"  , "copyright" },
+    { "TrackNumber", "track"     },
+    { "Year"       , "year"      },
+    { 0 }
+};
--- a/asf.h	Sat Feb 28 23:34:16 2009 +0000
+++ b/asf.h	Sun Mar 01 00:12:08 2009 +0000
@@ -23,6 +23,7 @@
 
 #include <stdint.h>
 #include "avformat.h"
+#include "metadata.h"
 
 #define PACKET_SIZE 3200
 
@@ -157,6 +158,8 @@
 extern const GUID ff_asf_metadata_header;
 extern const GUID ff_asf_my_guid;
 
+extern const AVMetadataConv ff_asf_metadata_conv[];
+
 #define ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT 0x80 //1000 0000
 
 
--- a/asfdec.c	Sat Feb 28 23:34:16 2009 +0000
+++ b/asfdec.c	Sun Mar 01 00:12:08 2009 +0000
@@ -1087,4 +1087,5 @@
     asf_read_close,
     asf_read_seek,
     asf_read_pts,
+    .metadata_conv = ff_asf_metadata_conv,
 };
--- a/asfenc.c	Sat Feb 28 23:34:16 2009 +0000
+++ b/asfenc.c	Sun Mar 01 00:12:08 2009 +0000
@@ -855,6 +855,7 @@
     asf_write_trailer,
     .flags = AVFMT_GLOBALHEADER,
     .codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0},
+    .metadata_conv = ff_asf_metadata_conv,
 };
 #endif
 
@@ -876,5 +877,6 @@
     asf_write_trailer,
     .flags = AVFMT_GLOBALHEADER,
     .codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0},
+    .metadata_conv = ff_asf_metadata_conv,
 };
 #endif //CONFIG_ASF_STREAM_MUXER
--- a/avformat.h	Sat Feb 28 23:34:16 2009 +0000
+++ b/avformat.h	Sun Mar 01 00:12:08 2009 +0000
@@ -309,7 +309,7 @@
 
     enum CodecID subtitle_codec; /**< default subtitle codec */
 
-    AVMetadataConv *metadata_conv;
+    const AVMetadataConv *metadata_conv;
 
     /* private fields */
     struct AVOutputFormat *next;
@@ -390,7 +390,7 @@
      */
     int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
 
-    AVMetadataConv *metadata_conv;
+    const AVMetadataConv *metadata_conv;
 
     /* private fields */
     struct AVInputFormat *next;
--- a/matroska.c	Sat Feb 28 23:34:16 2009 +0000
+++ b/matroska.c	Sun Mar 01 00:12:08 2009 +0000
@@ -88,3 +88,10 @@
 
     {""                           , CODEC_ID_NONE}
 };
+
+const AVMetadataConv ff_mkv_metadata_conv[] = {
+    { "ARTIST"        , "artist" },
+    { "LEAD_PERFORMER", "artist" },
+    { "PART_NUMBER"   , "track"  },
+    { 0 }
+};
--- a/matroska.h	Sat Feb 28 23:34:16 2009 +0000
+++ b/matroska.h	Sun Mar 01 00:12:08 2009 +0000
@@ -23,6 +23,7 @@
 #define AVFORMAT_MATROSKA_H
 
 #include "libavcodec/avcodec.h"
+#include "metadata.h"
 
 /* EBML version supported */
 #define EBML_VERSION 1
@@ -235,5 +236,6 @@
 
 extern const CodecTags ff_mkv_codec_tags[];
 extern const CodecMime ff_mkv_mime_tags[];
+extern const AVMetadataConv ff_mkv_metadata_conv[];
 
 #endif /* AVFORMAT_MATROSKA_H */
--- a/matroskadec.c	Sat Feb 28 23:34:16 2009 +0000
+++ b/matroskadec.c	Sun Mar 01 00:12:08 2009 +0000
@@ -1839,4 +1839,5 @@
     matroska_read_packet,
     matroska_read_close,
     matroska_read_seek,
+    .metadata_conv = ff_mkv_metadata_conv,
 };