aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2009-03-01 00:12:08 +0000
committerAurelien Jacobs <aurel@gnuage.org>2009-03-01 00:12:08 +0000
commit719e721a145680bec580f644788179435b43754a (patch)
tree35ee2a65509d2e760c22a7d126210cafdf7c75dc
parentf610a9f284e8319907962b1be4d93051444bcf90 (diff)
downloadffmpeg-719e721a145680bec580f644788179435b43754a.tar.gz
Add some basic metadata conversion tables for matroska and asf.
Add missing const qualifiers for metadata_conv in AV{In|Out}putFormat. Originally committed as revision 17671 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/asf.c12
-rw-r--r--libavformat/asf.h3
-rw-r--r--libavformat/asfdec.c1
-rw-r--r--libavformat/asfenc.c2
-rw-r--r--libavformat/avformat.h4
-rw-r--r--libavformat/matroska.c7
-rw-r--r--libavformat/matroska.h2
-rw-r--r--libavformat/matroskadec.c1
8 files changed, 30 insertions, 2 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c
index b6908bad93..bca212b140 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -111,3 +111,15 @@ const GUID ff_asf_metadata_header = {
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 }
+};
diff --git a/libavformat/asf.h b/libavformat/asf.h
index 86d3be2320..a36013bdd2 100644
--- a/libavformat/asf.h
+++ b/libavformat/asf.h
@@ -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_ext_stream_audio_stream;
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
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 40913c849d..4d61739719 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1087,4 +1087,5 @@ AVInputFormat asf_demuxer = {
asf_read_close,
asf_read_seek,
asf_read_pts,
+ .metadata_conv = ff_asf_metadata_conv,
};
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index f9dfa97c5b..8c5aec738f 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -855,6 +855,7 @@ AVOutputFormat asf_muxer = {
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 @@ AVOutputFormat asf_stream_muxer = {
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
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 94764f3875..d1d6d02b2f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -309,7 +309,7 @@ typedef struct AVOutputFormat {
enum CodecID subtitle_codec; /**< default subtitle codec */
- AVMetadataConv *metadata_conv;
+ const AVMetadataConv *metadata_conv;
/* private fields */
struct AVOutputFormat *next;
@@ -390,7 +390,7 @@ typedef struct AVInputFormat {
*/
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;
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index f967f3e909..482a155577 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -88,3 +88,10 @@ const CodecMime ff_mkv_mime_tags[] = {
{"" , CODEC_ID_NONE}
};
+
+const AVMetadataConv ff_mkv_metadata_conv[] = {
+ { "ARTIST" , "artist" },
+ { "LEAD_PERFORMER", "artist" },
+ { "PART_NUMBER" , "track" },
+ { 0 }
+};
diff --git a/libavformat/matroska.h b/libavformat/matroska.h
index a66c10e1d3..40ab3a7424 100644
--- a/libavformat/matroska.h
+++ b/libavformat/matroska.h
@@ -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 @@ typedef struct CodecMime{
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 */
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 2f2d4447f9..ac12f1ea66 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1839,4 +1839,5 @@ AVInputFormat matroska_demuxer = {
matroska_read_packet,
matroska_read_close,
matroska_read_seek,
+ .metadata_conv = ff_mkv_metadata_conv,
};