[FFmpeg-soc] [soc]: r3354 - mxf/mxfenc.c

spyfeng subversion at mplayerhq.hu
Sat Aug 16 14:28:40 CEST 2008


Author: spyfeng
Date: Sat Aug 16 14:28:40 2008
New Revision: 3354

Log:
remove MXFEssenceElementKey struct, use MXFCodecUL instead


Modified:
   mxf/mxfenc.c

Modified: mxf/mxfenc.c
==============================================================================
--- mxf/mxfenc.c	(original)
+++ mxf/mxfenc.c	Sat Aug 16 14:28:40 2008
@@ -41,11 +41,6 @@ typedef struct {
 } MXFLocalTagPair;
 
 typedef struct {
-    UID uid;
-    enum CodecID type;
-} MXFEssenceElementKey;
-
-typedef struct {
     UID track_essence_element_key;
 } MXFStreamContext;
 
@@ -81,10 +76,10 @@ static const uint8_t primer_pack_key[]  
  */
 static const uint8_t header_metadata_key[]  = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01 };
 
-static const MXFEssenceElementKey mxf_essence_element_key[] = {
-    { { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 }, CODEC_ID_MPEG2VIDEO},
-    { { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x16,0x01,0x01,0x00 }, CODEC_ID_PCM_S16LE},
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, CODEC_ID_NONE},
+static const MXFCodecUL mxf_essence_element_key[] = {
+    { { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 }, 14, CODEC_ID_MPEG2VIDEO},
+    { { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x16,0x01,0x01,0x00 }, 14, CODEC_ID_PCM_S16LE},
+    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, CODEC_ID_NONE},
 };
 
 static const uint8_t multiple_desc_ul[] = { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x0D,0x01,0x03,0x01,0x02,0x7F,0x01,0x00 };
@@ -461,9 +456,9 @@ static int mxf_write_track(AVFormatConte
     ByteIOContext *pb = s->pb;
     AVStream *st;
     MXFStreamContext *sc;
-    const MXFEssenceElementKey *element;
+    const MXFCodecUL *element;
     int i = 0;
-    int track_number_sign[sizeof(mxf_essence_element_key)/sizeof(MXFEssenceElementKey)] = { 0 };
+    int track_number_sign[sizeof(mxf_essence_element_key)/sizeof(MXFCodecUL)] = { 0 };
 
     AV_WB24(klv->key + 13, 0x013b00);
 
@@ -486,8 +481,8 @@ static int mxf_write_track(AVFormatConte
 
     mxf_write_local_tag(pb, 4, 0x4804);
     if (type != MaterialPackage) {
-        for (element = mxf_essence_element_key; element->type != CODEC_ID_NONE; element++) {
-            if (st->codec->codec_id== element->type) {
+        for (element = mxf_essence_element_key; element->id != CODEC_ID_NONE; element++) {
+            if (st->codec->codec_id== element->id) {
                 // write track number
                 put_buffer(pb, element->uid + 12, 3);
                 put_byte(pb, element->uid[15] + track_number_sign[i]);



More information about the FFmpeg-soc mailing list