comparison mxfenc.c @ 4320:3524125567f3 libavformat

add aes3 pcm wrapping and use it by default
author bcoudurier
date Sat, 31 Jan 2009 07:02:20 +0000
parents 28d38c1fb5fa
children 68de70aa392b
comparison
equal deleted inserted replaced
4319:28d38c1fb5fa 4320:3524125567f3
68 enum CodecID id; 68 enum CodecID id;
69 void (*write_desc)(); 69 void (*write_desc)();
70 } MXFContainerEssenceEntry; 70 } MXFContainerEssenceEntry;
71 71
72 static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st); 72 static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st);
73 static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st);
73 static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st); 74 static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st);
74 75
75 static const MXFContainerEssenceEntry mxf_essence_container_uls[] = { 76 static const MXFContainerEssenceEntry mxf_essence_container_uls[] = {
76 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 77 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 },
77 { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 }, 78 { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 },
78 { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x00,0x00,0x00 }, 79 { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x00,0x00,0x00 },
79 CODEC_ID_MPEG2VIDEO, mxf_write_mpegvideo_desc }, 80 CODEC_ID_MPEG2VIDEO, mxf_write_mpegvideo_desc },
81 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x03,0x00 },
82 { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x16,0x01,0x03,0x00 },
83 { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
84 CODEC_ID_PCM_S16LE, mxf_write_aes3_desc },
80 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 85 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 },
81 { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x16,0x01,0x01,0x00 }, 86 { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x16,0x01,0x01,0x00 },
82 { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 }, 87 { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
83 CODEC_ID_PCM_S16LE, mxf_write_wav_desc }, 88 CODEC_ID_PCM_S16LE, mxf_write_wav_desc },
84 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 89 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
573 put_buffer(pb, mxf_essence_container_uls[sc->index].container_ul, 16); 578 put_buffer(pb, mxf_essence_container_uls[sc->index].container_ul, 16);
574 } 579 }
575 580
576 static const UID mxf_mpegvideo_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 }; 581 static const UID mxf_mpegvideo_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 };
577 static const UID mxf_wav_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 }; 582 static const UID mxf_wav_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 };
583 static const UID mxf_aes3_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 };
578 584
579 static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st) 585 static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st)
580 { 586 {
581 MXFStreamContext *sc = st->priv_data; 587 MXFStreamContext *sc = st->priv_data;
582 ByteIOContext *pb = s->pb; 588 ByteIOContext *pb = s->pb;
627 } 633 }
628 634
629 static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st) 635 static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st)
630 { 636 {
631 mxf_write_generic_sound_desc(s, st, mxf_wav_descriptor_key, 93); 637 mxf_write_generic_sound_desc(s, st, mxf_wav_descriptor_key, 93);
638 }
639
640 static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st)
641 {
642 mxf_write_generic_sound_desc(s, st, mxf_aes3_descriptor_key, 93);
632 } 643 }
633 644
634 static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type) 645 static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type)
635 { 646 {
636 ByteIOContext *pb = s->pb; 647 ByteIOContext *pb = s->pb;