Commit 4c88087f authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mxfenc: Replace more literal magic numbers by enum values.

This also moves the enum table up as it is needed earlier
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 183216b2
...@@ -100,27 +100,7 @@ typedef struct MXFContainerEssenceEntry { ...@@ -100,27 +100,7 @@ typedef struct MXFContainerEssenceEntry {
void (*write_desc)(AVFormatContext *, AVStream *); void (*write_desc)(AVFormatContext *, AVStream *);
} MXFContainerEssenceEntry; } MXFContainerEssenceEntry;
static const struct { enum ULIndex {
enum AVCodecID id;
int index;
} mxf_essence_mappings[] = {
{ AV_CODEC_ID_MPEG2VIDEO, 0 },
{ AV_CODEC_ID_PCM_S24LE, 1 },
{ AV_CODEC_ID_PCM_S16LE, 1 },
{ AV_CODEC_ID_DVVIDEO, 15 },
{ AV_CODEC_ID_DNXHD, 24 },
{ AV_CODEC_ID_JPEG2000, 34 },
{ AV_CODEC_ID_H264, 35 },
{ AV_CODEC_ID_NONE }
};
static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st);
enum {
INDEX_MPEG2 = 0, INDEX_MPEG2 = 0,
INDEX_AES3, INDEX_AES3,
INDEX_WAV, INDEX_WAV,
...@@ -159,6 +139,26 @@ enum { ...@@ -159,6 +139,26 @@ enum {
INDEX_H264, INDEX_H264,
}; };
static const struct {
enum AVCodecID id;
enum ULIndex index;
} mxf_essence_mappings[] = {
{ AV_CODEC_ID_MPEG2VIDEO, INDEX_MPEG2 },
{ AV_CODEC_ID_PCM_S24LE, INDEX_AES3 },
{ AV_CODEC_ID_PCM_S16LE, INDEX_AES3 },
{ AV_CODEC_ID_DVVIDEO, INDEX_DV },
{ AV_CODEC_ID_DNXHD, INDEX_DNXHD_1080p_10bit_HIGH },
{ AV_CODEC_ID_JPEG2000, INDEX_JPEG2000 },
{ AV_CODEC_ID_H264, INDEX_H264 },
{ AV_CODEC_ID_NONE }
};
static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st);
static const MXFContainerEssenceEntry mxf_essence_container_uls[] = { static const MXFContainerEssenceEntry mxf_essence_container_uls[] = {
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 },
{ 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 }, { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment