Hi,

This is another attempt to submit patches for clip-wrapped MXF files support (generated by Panasonic's P2 camera).

Benjamin, Tomas, may be it is time to commit now?


--
________________________________________
Maksym Veremeyenko
>From 8a003a3c9f296b5e6acf54ffdb0ffff174868ba9 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Sat, 3 Jul 2010 13:18:36 +0300
Subject: [PATCH 1/8] add MXFContainerUL struct for containers UL dict

---
 libavformat/mxfdec.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 39c7fea..b2dc4fd 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -149,6 +149,13 @@ typedef struct {
     enum MXFMetadataSetType type;
 } MXFMetadataReadTableEntry;
 
+typedef struct {
+    UID uid;
+    unsigned matching_len;
+    int id;
+    enum MXFWrappingScheme wrapping;
+} MXFContainerUL;
+
 /* partial keys to match */
 static const uint8_t mxf_header_partition_pack_key[]       = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02 };
 static const uint8_t mxf_essence_element_key[]             = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01 };
@@ -634,6 +641,16 @@ static const MXFCodecUL *mxf_get_codec_ul(const MXFCodecUL *uls, UID *uid)
     return uls;
 }
 
+static const MXFContainerUL *mxf_get_container_ul(const MXFContainerUL *uls, UID *uid)
+{
+    while (uls->uid[0]) {
+        if(mxf_match_uid(uls->uid, *uid, uls->matching_len))
+            break;
+        uls++;
+    }
+    return uls;
+}
+
 static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMetadataSetType type)
 {
     int i;
@@ -649,7 +666,7 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
     return NULL;
 }
 
-static const MXFCodecUL mxf_essence_container_uls[] = {
+static const MXFContainerUL mxf_essence_container_uls[] = {
     // video essence container uls
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14, CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14,    CODEC_ID_DVVIDEO }, /* DV 625 25mbps */
@@ -686,7 +703,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
         MXFStructuralComponent *component = NULL;
         UID *essence_container_ul = NULL;
         const MXFCodecUL *codec_ul = NULL;
-        const MXFCodecUL *container_ul = NULL;
+        const MXFContainerUL *container_ul = NULL;
         AVStream *st;
 
         if (!(material_track = mxf_resolve_strong_ref(mxf, &material_package->tracks_refs[i], Track))) {
@@ -803,7 +820,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
             st->codec->extradata_size = descriptor->extradata_size;
         }
         if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul);
+            container_ul = mxf_get_container_ul(mxf_essence_container_uls, essence_container_ul);
             if (st->codec->codec_id == CODEC_ID_NONE)
                 st->codec->codec_id = container_ul->id;
             st->codec->width = descriptor->width;
@@ -812,7 +829,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
                 st->codec->pix_fmt = descriptor->pix_fmt;
             st->need_parsing = AVSTREAM_PARSE_HEADERS;
         } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul);
+            container_ul = mxf_get_container_ul(mxf_essence_container_uls, essence_container_ul);
             if (st->codec->codec_id == CODEC_ID_NONE)
                 st->codec->codec_id = container_ul->id;
             st->codec->channels = descriptor->channels;
-- 
1.7.4

>From c4ee91801a483c0773aa36452a8bd7dbd5abd7d6 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Sat, 3 Jul 2010 13:24:07 +0300
Subject: [PATCH 2/8] revert container wrapping detection from r11567

---
 libavformat/mxfdec.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index b2dc4fd..f345f78 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -668,13 +668,19 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
 
 static const MXFContainerUL mxf_essence_container_uls[] = {
     // video essence container uls
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14, CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14,    CODEC_ID_DVVIDEO }, /* DV 625 25mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 16, CODEC_ID_MPEG2VIDEO, Frame }, /* MPEG-ES Frame wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xe0,0x02 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* MPEG-ES Clip wrapped, 0xe0 MPV stream id */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x04,0x61,0x07 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* MPEG-ES Custom wrapped, 0x61 ??? stream id */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* DV 625 25mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x3F,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* DV IEC 625 25mbps */
     // sound essence container uls
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14, CODEC_ID_PCM_S16LE }, /* BWF Frame wrapped */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 14,       CODEC_ID_MP2 }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14, CODEC_ID_PCM_S16LE }, /* D-10 Mapping 50Mbps PAL Extended Template */
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0,      CODEC_ID_NONE },
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 16,  CODEC_ID_PCM_S16LE, Frame }, /* BWF Frame wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x03,0x00 }, 16,  CODEC_ID_PCM_S16LE, Frame }, /* AES Frame wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 16,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x01 }, 16,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0xc0 MPA stream id */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x02 }, 16,        CODEC_ID_MP2,  Clip }, /* MPEG-ES Clip wrapped, 0xc0 MPA stream id */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14,  CODEC_ID_PCM_S16LE, Frame }, /* D-10 Mapping 50Mbps PAL Extended Template */
+    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 16,       CODEC_ID_NONE, Frame },
 };
 
 static int mxf_parse_structural_metadata(MXFContext *mxf)
@@ -850,7 +856,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
                 st->need_parsing = AVSTREAM_PARSE_FULL;
             }
         }
-        if (st->codec->codec_type != AVMEDIA_TYPE_DATA && (*essence_container_ul)[15] > 0x01) {
+        if (st->codec->codec_type != AVMEDIA_TYPE_DATA && container_ul && container_ul->wrapping == Clip) {
             av_log(mxf->fc, AV_LOG_WARNING, "only frame wrapped mappings are correctly supported\n");
             st->need_parsing = AVSTREAM_PARSE_FULL;
         }
-- 
1.7.4

>From 5fe71ae1ba3aa581c1e805b0c42c5475d4e073a3 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Tue, 25 Jan 2011 11:50:13 +0200
Subject: [PATCH 3/8] make key output in RP 224.10 form

---
 libavformat/mxf.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mxf.h b/libavformat/mxf.h
index beb6628..ed7d968 100644
--- a/libavformat/mxf.h
+++ b/libavformat/mxf.h
@@ -63,7 +63,8 @@ extern const MXFCodecUL ff_mxf_codec_uls[];
 
 int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum PixelFormat *pix_fmt);
 
-#define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
-                             (x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
+#define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X %02X.%02X.%02X.%02X.%02X.%02X.%02x.%02X\n", s, \
+                                    (x)[0], (x)[1], (x)[2],   (x)[3],  (x)[4],  (x)[5],  (x)[6],  (x)[7], \
+                                    (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
 
 #endif /* AVFORMAT_MXF_H */
-- 
1.7.4

>From 61adb34b6da8be1b7fe3f673b4d014e3be57964d Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Tue, 25 Jan 2011 11:54:07 +0200
Subject: [PATCH 4/8] add new essence container uls

---
 libavformat/mxfdec.c |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index f345f78..5a3e52b 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -669,17 +669,50 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
 static const MXFContainerUL mxf_essence_container_uls[] = {
     // video essence container uls
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 16, CODEC_ID_MPEG2VIDEO, Frame }, /* MPEG-ES Frame wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x02 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* Clip-wrapped MPEG-ES VideoStream-0 */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x61,0x01 }, 16, CODEC_ID_MPEG2VIDEO, Frame }, /* Frame-wrapped MPEG-ES VideoStream-1 */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x61,0x02 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* Clip-wrapped MPEG-ES VideoStream-1 */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xe0,0x02 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* MPEG-ES Clip wrapped, 0xe0 MPV stream id */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x04,0x61,0x07 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* MPEG-ES Custom wrapped, 0x61 ??? stream id */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* DV 625 25mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x3F,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* DV IEC 625 25mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x02,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped IEC-DV 625x50I 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x02,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped IEC-DV 625x50I 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x03,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped IEC-DV 525x59.94I 25Mbps SMPTE-322M */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x03,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped IEC-DV 525x59.94I 25Mbps SMPTE-322M */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x04,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped IEC-DV 625x50I 25Mbps SMPTE-322M */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x04,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped IEC-DV 625x50I 25Mbps SMPTE-322M */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x3F,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped IEC-DV UndefinedSource 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x3F,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped IEC-DV UndefinedSource 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x40,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 525x59.94I 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x40,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 525x59.94I 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 625x50I 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 625x50I 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 625x50I 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 625x50I 25Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x51,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 625x50I 50Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x51,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 625x50I 50Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x60,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 1080x59.94I 100Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x60,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 1080x59.94I 100Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x61,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 1080x50I 100Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x61,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 1080x50I 100Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x62,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 720x59.94P 100Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x62,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 720x59.94P 100Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x63,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 720x50P 100Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x63,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 720x50P 100Mbps */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x7F,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* MXF-GC Frame-wrapped DV-based UndefinedSource */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x7F,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* MXF-GC Clip-wrapped DV-based UndefinedSource */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x0D,0x01,0x03,0x01,0x02,0x10,0x60,0x01 }, 16,    CODEC_ID_H264,    Frame }, /* MXF-GC AVC Byte Stream With VideoStream-0 SID Frame-wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x0D,0x01,0x03,0x01,0x02,0x10,0x60,0x02 }, 16,    CODEC_ID_H264,     Clip }, /* MXF-GC  AVC Byte Stream With VideoStream-0 SID Clip-wrapped */
+
     // sound essence container uls
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 16,  CODEC_ID_PCM_S16LE, Frame }, /* BWF Frame wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x02,0x00 }, 16,  CODEC_ID_PCM_S16LE,  Clip }, /* Clip-wrapped Broadcast Wave audio data */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x03,0x00 }, 16,  CODEC_ID_PCM_S16LE, Frame }, /* AES Frame wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x04,0x00 }, 16,  CODEC_ID_PCM_S16LE,  Clip }, /* Clip-wrapped AES3 audio data */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 16,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x01 }, 16,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0xc0 MPA stream id */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x02 }, 16,        CODEC_ID_MP2,  Clip }, /* MPEG-ES Clip wrapped, 0xc0 MPA stream id */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14,  CODEC_ID_PCM_S16LE, Frame }, /* D-10 Mapping 50Mbps PAL Extended Template */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x0D,0x01,0x03,0x01,0x02,0x0A,0x01,0x00 }, 16,   CODEC_ID_PCM_ALAW, Frame }, /* Frame-wrapped A-law Audio */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x0D,0x01,0x03,0x01,0x02,0x0A,0x02,0x00 }, 16,   CODEC_ID_PCM_ALAW,  Clip }, /* Clip-wrapped A-law Audio */
     { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 16,       CODEC_ID_NONE, Frame },
 };
 
-- 
1.7.4

>From ab643a516ca81422cb785c2e470a7e7505fb2dd2 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Sat, 3 Jul 2010 14:01:01 +0300
Subject: [PATCH 5/8] extend MXFIndexTableSegment

---
 libavformat/mxfdec.c |   40 ++++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 5a3e52b..329285e 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -107,6 +107,12 @@ typedef struct {
 typedef struct {
     UID uid;
     enum MXFMetadataSetType type;
+    int edit_unit_byte_count;
+    int index_sid;
+    int body_sid;
+    AVRational index_edit_rate;
+    uint64_t index_start_position;
+    uint64_t index_duration;
 } MXFIndexTableSegment;
 
 typedef struct {
@@ -524,13 +530,35 @@ static int mxf_read_source_package(void *arg, AVIOContext *pb, int tag, int size
 
 static int mxf_read_index_table_segment(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
+    MXFIndexTableSegment *segment = arg;
+
     switch(tag) {
-    case 0x3F05: av_dlog(NULL, "EditUnitByteCount %d\n", avio_rb32(pb)); break;
-    case 0x3F06: av_dlog(NULL, "IndexSID %d\n", avio_rb32(pb)); break;
-    case 0x3F07: av_dlog(NULL, "BodySID %d\n", avio_rb32(pb)); break;
-    case 0x3F0B: av_dlog(NULL, "IndexEditRate %d/%d\n", avio_rb32(pb), avio_rb32(pb)); break;
-    case 0x3F0C: av_dlog(NULL, "IndexStartPosition %lld\n", avio_rb64(pb)); break;
-    case 0x3F0D: av_dlog(NULL, "IndexDuration %lld\n", avio_rb64(pb)); break;
+    case 0x3F05:
+        segment->edit_unit_byte_count = avio_rb32(pb);
+        av_dlog(NULL, "EditUnitByteCount %d\n", segment->edit_unit_byte_count);
+        break;
+    case 0x3F06:
+        segment->index_sid = avio_rb32(pb);
+        av_dlog(NULL, "IndexSID %d\n", segment->index_sid);
+        break;
+    case 0x3F07:
+        segment->body_sid = avio_rb32(pb);
+        av_dlog(NULL, "BodySID %d\n", segment->body_sid);
+        break;
+    case 0x3F0B:
+        segment->index_edit_rate.num = avio_rb32(pb);
+        segment->index_edit_rate.den = avio_rb32(pb);
+        av_dlog(NULL, "IndexEditRate %d/%d\n", segment->index_edit_rate.num,
+                segment->index_edit_rate.num);
+        break;
+    case 0x3F0C:
+        segment->index_start_position = avio_rb64(pb);
+        av_dlog(NULL, "IndexStartPosition %lld\n", segment->index_start_position);
+        break;
+    case 0x3F0D:
+        segment->index_duration = avio_rb64(pb);
+        av_dlog(NULL, "IndexDuration %lld\n", segment->index_duration);
+        break;
     }
     return 0;
 }
-- 
1.7.4

>From 2206edd740cc9d3e1c6223c8c8a4e9a0fc7785e4 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Tue, 25 Jan 2011 12:22:02 +0200
Subject: [PATCH 6/8] extend MXFTrack with wrapping field

---
 libavformat/mxfdec.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 329285e..66c61b5 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -50,6 +50,11 @@
 #include "avformat.h"
 #include "mxf.h"
 
+enum MXFWrappingScheme {
+    Frame,
+    Clip,
+};
+
 typedef struct {
     UID uid;
     enum MXFMetadataSetType type;
@@ -83,6 +88,7 @@ typedef struct {
     int track_id;
     uint8_t track_number[4];
     AVRational edit_rate;
+    enum MXFWrappingScheme wrapping;
 } MXFTrack;
 
 typedef struct {
@@ -141,11 +147,6 @@ typedef struct {
     int local_tags_count;
 } MXFContext;
 
-enum MXFWrappingScheme {
-    Frame,
-    Clip,
-};
-
 typedef int MXFMetadataReadFunc(void *arg, AVIOContext *pb, int tag, int size, UID uid);
 
 typedef struct {
@@ -920,6 +921,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
         if (st->codec->codec_type != AVMEDIA_TYPE_DATA && container_ul && container_ul->wrapping == Clip) {
             av_log(mxf->fc, AV_LOG_WARNING, "only frame wrapped mappings are correctly supported\n");
             st->need_parsing = AVSTREAM_PARSE_FULL;
+            source_track->wrapping = Clip;
         }
     }
     return 0;
-- 
1.7.4

>From c118d276f436ce489c7390e32ce54f3b41b7bb85 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Tue, 25 Jan 2011 13:28:51 +0200
Subject: [PATCH 7/8] Clip wrapped code

---
 libavformat/mxfdec.c |   57 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 66c61b5..1dabdb1 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -145,6 +145,9 @@ typedef struct {
     struct AVAES *aesc;
     uint8_t *local_tags;
     int local_tags_count;
+    KLVPacket current_klv_data;
+    int current_klv_index;
+    int current_klv_bsize;
 } MXFContext;
 
 typedef int MXFMetadataReadFunc(void *arg, AVIOContext *pb, int tag, int size, UID uid);
@@ -318,8 +321,26 @@ static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv
 static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     KLVPacket klv;
+    int index;
+    MXFContext* mxf = s->priv_data;
 
     while (!s->pb->eof_reached) {
+        if (mxf->current_klv_data.length) {
+            /* store */
+            klv = mxf->current_klv_data;
+            index = mxf->current_klv_index;
+
+            /* setup length */
+            klv.length = FFMIN(mxf->current_klv_bsize, mxf->current_klv_data.length);
+
+            /* modify size, length */
+            mxf->current_klv_data.offset += klv.length;
+            mxf->current_klv_data.length -= klv.length;
+
+            /* read packet */
+            goto read_data;
+        };
+
         if (klv_read_packet(&klv, s->pb) < 0)
             return -1;
         PRINT_KEY(s, "read packet", klv.key);
@@ -333,13 +354,47 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
             return 0;
         }
         if (IS_KLV_KEY(klv.key, mxf_essence_element_key)) {
-            int index = mxf_get_stream_index(s, &klv);
+            index = mxf_get_stream_index(s, &klv);
             if (index < 0) {
                 av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12));
                 goto skip;
             }
             if (s->streams[index]->discard == AVDISCARD_ALL)
                 goto skip;
+
+            /* check for clip wrapped */
+            if (((MXFTrack*)s->streams[index]->priv_data)->wrapping == Clip) {
+                int k;
+
+                /* store current klv information */
+                mxf->current_klv_data = klv;
+                mxf->current_klv_index = index;
+                mxf->current_klv_bsize = 0;
+
+                /* find block size */
+                for (k = 0; k < mxf->metadata_sets_count; k++) {
+                    MXFMetadataSet *metadata = mxf->metadata_sets[k];
+                    if (IndexTableSegment == metadata->type) {
+                        mxf->current_klv_bsize = ((MXFIndexTableSegment *)metadata)->edit_unit_byte_count;
+                        break;
+                    }
+                }
+
+                /* check small EditUnitByteCount for audio */
+                if (!mxf->current_klv_bsize | mxf->current_klv_bsize == 1)
+                    mxf->current_klv_bsize = 1024 * 64;
+                else if (mxf->current_klv_bsize < 32)
+                    mxf->current_klv_bsize *= 1024;
+
+                av_dlog(s, "Clip-wrapped reading. mxf->current_klv_bsize=%d, klv.length=%"PRId64"\n",
+                        mxf->current_klv_bsize, klv.length);
+
+                return mxf_read_packet(s, pkt);
+            }
+read_data:
+            PRINT_KEY(s, "read packet data", klv.key);
+            av_dlog(s, "data size %lld offset %#llx\n", klv.length, klv.offset);
+
             /* check for 8 channels AES3 element */
             if (klv.key[12] == 0x06 && klv.key[13] == 0x01 && klv.key[14] == 0x10) {
                 if (mxf_get_d10_aes3_packet(s->pb, s->streams[index], pkt, klv.length) < 0) {
-- 
1.7.4

>From dfcda7eeb543edce86a680494830ad68a60dda27 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Tue, 22 Feb 2011 16:41:18 +0200
Subject: [PATCH 8/8] compact ULs list

---
 libavformat/mxfdec.c |   70 +++++++++++++++----------------------------------
 1 files changed, 22 insertions(+), 48 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 1dabdb1..b20ad77 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -162,6 +162,7 @@ typedef struct {
 typedef struct {
     UID uid;
     unsigned matching_len;
+    unsigned matching_mask;
     int id;
     enum MXFWrappingScheme wrapping;
 } MXFContainerUL;
@@ -705,11 +706,11 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int
  * Match an uid independently of the version byte and up to len common bytes
  * Returns: boolean
  */
-static int mxf_match_uid(const UID key, const UID uid, int len)
+static int mxf_match_uid(const UID key, const UID uid, int len, int mask)
 {
     int i;
     for (i = 0; i < len; i++) {
-        if (i != 7 && key[i] != uid[i])
+        if (i != 7 && key[i] != uid[i] && !(mask & (1 << i)))
             return 0;
     }
     return 1;
@@ -718,7 +719,7 @@ static int mxf_match_uid(const UID key, const UID uid, int len)
 static const MXFCodecUL *mxf_get_codec_ul(const MXFCodecUL *uls, UID *uid)
 {
     while (uls->uid[0]) {
-        if(mxf_match_uid(uls->uid, *uid, uls->matching_len))
+        if(mxf_match_uid(uls->uid, *uid, uls->matching_len, 0))
             break;
         uls++;
     }
@@ -728,7 +729,7 @@ static const MXFCodecUL *mxf_get_codec_ul(const MXFCodecUL *uls, UID *uid)
 static const MXFContainerUL *mxf_get_container_ul(const MXFContainerUL *uls, UID *uid)
 {
     while (uls->uid[0]) {
-        if(mxf_match_uid(uls->uid, *uid, uls->matching_len))
+        if(mxf_match_uid(uls->uid, *uid, uls->matching_len, uls->matching_mask))
             break;
         uls++;
     }
@@ -752,52 +753,25 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
 
 static const MXFContainerUL mxf_essence_container_uls[] = {
     // video essence container uls
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 16, CODEC_ID_MPEG2VIDEO, Frame }, /* MPEG-ES Frame wrapped */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x02 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* Clip-wrapped MPEG-ES VideoStream-0 */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x61,0x01 }, 16, CODEC_ID_MPEG2VIDEO, Frame }, /* Frame-wrapped MPEG-ES VideoStream-1 */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x61,0x02 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* Clip-wrapped MPEG-ES VideoStream-1 */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xe0,0x02 }, 16, CODEC_ID_MPEG2VIDEO,  Clip }, /* MPEG-ES Clip wrapped, 0xe0 MPV stream id */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x02,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped IEC-DV 625x50I 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x02,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped IEC-DV 625x50I 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x03,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped IEC-DV 525x59.94I 25Mbps SMPTE-322M */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x03,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped IEC-DV 525x59.94I 25Mbps SMPTE-322M */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x04,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped IEC-DV 625x50I 25Mbps SMPTE-322M */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x04,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped IEC-DV 625x50I 25Mbps SMPTE-322M */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x3F,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped IEC-DV UndefinedSource 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x3F,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped IEC-DV UndefinedSource 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x40,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 525x59.94I 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x40,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 525x59.94I 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 625x50I 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 625x50I 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 625x50I 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 625x50I 25Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x51,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 625x50I 50Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x51,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 625x50I 50Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x60,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 1080x59.94I 100Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x60,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 1080x59.94I 100Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x61,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 1080x50I 100Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x61,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 1080x50I 100Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x62,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 720x59.94P 100Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x62,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 720x59.94P 100Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x63,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* Frame-wrapped DV-based 720x50P 100Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x63,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* Clip-wrapped DV-based 720x50P 100Mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x7F,0x01 }, 16,    CODEC_ID_DVVIDEO, Frame }, /* MXF-GC Frame-wrapped DV-based UndefinedSource */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x7F,0x02 }, 16,    CODEC_ID_DVVIDEO,  Clip }, /* MXF-GC Clip-wrapped DV-based UndefinedSource */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x0D,0x01,0x03,0x01,0x02,0x10,0x60,0x01 }, 16,    CODEC_ID_H264,    Frame }, /* MXF-GC AVC Byte Stream With VideoStream-0 SID Frame-wrapped */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x0D,0x01,0x03,0x01,0x02,0x10,0x60,0x02 }, 16,    CODEC_ID_H264,     Clip }, /* MXF-GC  AVC Byte Stream With VideoStream-0 SID Clip-wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xFF,0x01 }, 16, 0x4000, CODEC_ID_MPEG2VIDEO, Frame },
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xFF,0x02 }, 16, 0x4000, CODEC_ID_MPEG2VIDEO,  Clip },
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0xFF,0x01 }, 16, 0x4000,    CODEC_ID_DVVIDEO, Frame },
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0xFF,0x02 }, 16, 0x4000,    CODEC_ID_DVVIDEO,  Clip },
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x0D,0x01,0x03,0x01,0x02,0x10,0xFF,0x01 }, 16, 0x4000,       CODEC_ID_H264, Frame },
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x0D,0x01,0x03,0x01,0x02,0x10,0xFF,0x02 }, 16, 0x4000,       CODEC_ID_H264,  Clip },
 
     // sound essence container uls
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 16,  CODEC_ID_PCM_S16LE, Frame }, /* BWF Frame wrapped */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x02,0x00 }, 16,  CODEC_ID_PCM_S16LE,  Clip }, /* Clip-wrapped Broadcast Wave audio data */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x03,0x00 }, 16,  CODEC_ID_PCM_S16LE, Frame }, /* AES Frame wrapped */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x04,0x00 }, 16,  CODEC_ID_PCM_S16LE,  Clip }, /* Clip-wrapped AES3 audio data */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 16,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x01 }, 16,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0xc0 MPA stream id */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x02 }, 16,        CODEC_ID_MP2,  Clip }, /* MPEG-ES Clip wrapped, 0xc0 MPA stream id */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14,  CODEC_ID_PCM_S16LE, Frame }, /* D-10 Mapping 50Mbps PAL Extended Template */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x0D,0x01,0x03,0x01,0x02,0x0A,0x01,0x00 }, 16,   CODEC_ID_PCM_ALAW, Frame }, /* Frame-wrapped A-law Audio */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x0D,0x01,0x03,0x01,0x02,0x0A,0x02,0x00 }, 16,   CODEC_ID_PCM_ALAW,  Clip }, /* Clip-wrapped A-law Audio */
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 16,       CODEC_ID_NONE, Frame },
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 16, 0x0000,  CODEC_ID_PCM_S16LE, Frame }, /* BWF Frame wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x02,0x00 }, 16, 0x0000,  CODEC_ID_PCM_S16LE,  Clip }, /* Clip-wrapped Broadcast Wave audio data */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x03,0x00 }, 16, 0x0000,  CODEC_ID_PCM_S16LE, Frame }, /* AES Frame wrapped */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x04,0x00 }, 16, 0x0000,  CODEC_ID_PCM_S16LE,  Clip }, /* Clip-wrapped AES3 audio data */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 16, 0x0000,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x01 }, 16, 0x0000,        CODEC_ID_MP2, Frame }, /* MPEG-ES Frame wrapped, 0xc0 MPA stream id */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0xc0,0x02 }, 16, 0x0000,        CODEC_ID_MP2,  Clip }, /* MPEG-ES Clip wrapped, 0xc0 MPA stream id */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14, 0x0000,  CODEC_ID_PCM_S16LE, Frame }, /* D-10 Mapping 50Mbps PAL Extended Template */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x0D,0x01,0x03,0x01,0x02,0x0A,0x01,0x00 }, 16, 0x0000,   CODEC_ID_PCM_ALAW, Frame }, /* Frame-wrapped A-law Audio */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x0D,0x01,0x03,0x01,0x02,0x0A,0x02,0x00 }, 16, 0x0000,   CODEC_ID_PCM_ALAW,  Clip }, /* Clip-wrapped A-law Audio */
+    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 16, 0x0000,       CODEC_ID_NONE, Frame },
 };
 
 static int mxf_parse_structural_metadata(MXFContext *mxf)
-- 
1.7.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to