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
This commit is contained in:
Aurelien Jacobs 2009-03-01 00:12:08 +00:00
parent f610a9f284
commit 719e721a14
8 changed files with 30 additions and 2 deletions

View File

@ -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 }
};

View File

@ -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

View File

@ -1087,4 +1087,5 @@ AVInputFormat asf_demuxer = {
asf_read_close,
asf_read_seek,
asf_read_pts,
.metadata_conv = ff_asf_metadata_conv,
};

View File

@ -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

View File

@ -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;

View File

@ -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 }
};

View File

@ -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 */

View File

@ -1839,4 +1839,5 @@ AVInputFormat matroska_demuxer = {
matroska_read_packet,
matroska_read_close,
matroska_read_seek,
.metadata_conv = ff_mkv_metadata_conv,
};