Browse Source

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
tags/v0.5
Aurelien Jacobs 16 years ago
parent
commit
719e721a14
8 changed files with 30 additions and 2 deletions
  1. +12
    -0
      libavformat/asf.c
  2. +3
    -0
      libavformat/asf.h
  3. +1
    -0
      libavformat/asfdec.c
  4. +2
    -0
      libavformat/asfenc.c
  5. +2
    -2
      libavformat/avformat.h
  6. +7
    -0
      libavformat/matroska.c
  7. +2
    -0
      libavformat/matroska.h
  8. +1
    -0
      libavformat/matroskadec.c

+ 12
- 0
libavformat/asf.c View File

@@ -111,3 +111,15 @@ const GUID ff_asf_metadata_header = {
const GUID ff_asf_my_guid = { const GUID ff_asf_my_guid = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 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 }
};

+ 3
- 0
libavformat/asf.h View File

@@ -23,6 +23,7 @@


#include <stdint.h> #include <stdint.h>
#include "avformat.h" #include "avformat.h"
#include "metadata.h"


#define PACKET_SIZE 3200 #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_metadata_header;
extern const GUID ff_asf_my_guid; extern const GUID ff_asf_my_guid;


extern const AVMetadataConv ff_asf_metadata_conv[];

#define ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT 0x80 //1000 0000 #define ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT 0x80 //1000 0000






+ 1
- 0
libavformat/asfdec.c View File

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

+ 2
- 0
libavformat/asfenc.c View File

@@ -855,6 +855,7 @@ AVOutputFormat asf_muxer = {
asf_write_trailer, asf_write_trailer,
.flags = AVFMT_GLOBALHEADER, .flags = AVFMT_GLOBALHEADER,
.codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0}, .codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0},
.metadata_conv = ff_asf_metadata_conv,
}; };
#endif #endif


@@ -876,5 +877,6 @@ AVOutputFormat asf_stream_muxer = {
asf_write_trailer, asf_write_trailer,
.flags = AVFMT_GLOBALHEADER, .flags = AVFMT_GLOBALHEADER,
.codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0}, .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 #endif //CONFIG_ASF_STREAM_MUXER

+ 2
- 2
libavformat/avformat.h View File

@@ -309,7 +309,7 @@ typedef struct AVOutputFormat {


enum CodecID subtitle_codec; /**< default subtitle codec */ enum CodecID subtitle_codec; /**< default subtitle codec */


AVMetadataConv *metadata_conv;
const AVMetadataConv *metadata_conv;


/* private fields */ /* private fields */
struct AVOutputFormat *next; 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); 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 */ /* private fields */
struct AVInputFormat *next; struct AVInputFormat *next;


+ 7
- 0
libavformat/matroska.c View File

@@ -88,3 +88,10 @@ const CodecMime ff_mkv_mime_tags[] = {


{"" , CODEC_ID_NONE} {"" , CODEC_ID_NONE}
}; };

const AVMetadataConv ff_mkv_metadata_conv[] = {
{ "ARTIST" , "artist" },
{ "LEAD_PERFORMER", "artist" },
{ "PART_NUMBER" , "track" },
{ 0 }
};

+ 2
- 0
libavformat/matroska.h View File

@@ -23,6 +23,7 @@
#define AVFORMAT_MATROSKA_H #define AVFORMAT_MATROSKA_H


#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "metadata.h"


/* EBML version supported */ /* EBML version supported */
#define EBML_VERSION 1 #define EBML_VERSION 1
@@ -235,5 +236,6 @@ typedef struct CodecMime{


extern const CodecTags ff_mkv_codec_tags[]; extern const CodecTags ff_mkv_codec_tags[];
extern const CodecMime ff_mkv_mime_tags[]; extern const CodecMime ff_mkv_mime_tags[];
extern const AVMetadataConv ff_mkv_metadata_conv[];


#endif /* AVFORMAT_MATROSKA_H */ #endif /* AVFORMAT_MATROSKA_H */

+ 1
- 0
libavformat/matroskadec.c View File

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

Loading…
Cancel
Save