mxfaes-bwf: Handle new custom-constant-sized variant
authorEdward Hervey <edward@centricular.com>
Wed, 14 Jul 2021 05:58:01 +0000 (07:58 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 21 Jul 2021 14:33:19 +0000 (14:33 +0000)
Defined by Amendment 2:2013 to SMPTE ST 382:2007

Also define a new "UNKNOWN" wrapping type to make the difference with known
wrapping types

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

gst/mxf/mxfaes-bwf.c
gst/mxf/mxfessence.h

index d128ab2..f0cd37c 100644 (file)
@@ -1122,7 +1122,8 @@ mxf_is_aes_bwf_essence_track (const MXFMetadataTimelineTrack * track)
         (key->u[14] == 0x01 ||
             key->u[14] == 0x02 ||
             key->u[14] == 0x03 ||
-            key->u[14] == 0x04 || key->u[14] == 0x08 || key->u[14] == 0x09))
+            key->u[14] == 0x04 || key->u[14] == 0x08 || key->u[14] == 0x09 ||
+            key->u[14] == 0x0a || key->u[14] == 0x0b))
       return TRUE;
   }
 
@@ -1160,8 +1161,12 @@ mxf_aes_bwf_get_track_wrapping (const MXFMetadataTimelineTrack * track)
         break;
       case 0x08:
       case 0x09:
-      default:
+      case 0x0a:
+      case 0x0b:
         return MXF_ESSENCE_WRAPPING_CUSTOM_WRAPPING;
+      default:
+        GST_WARNING ("Unknown frame wrapping");
+        return MXF_ESSENCE_WRAPPING_UNKNOWN_WRAPPING;
         break;
     }
   }
@@ -1437,7 +1442,8 @@ mxf_aes_bwf_create_caps (MXFMetadataTimelineTrack * track, GstTagList ** tags,
             descriptor[i])
         && (track->parent.descriptor[i]->essence_container.u[14] == 0x01
             || track->parent.descriptor[i]->essence_container.u[14] == 0x02
-            || track->parent.descriptor[i]->essence_container.u[14] == 0x08)) {
+            || track->parent.descriptor[i]->essence_container.u[14] == 0x08
+            || track->parent.descriptor[i]->essence_container.u[14] == 0x0a)) {
       s = (MXFMetadataGenericSoundEssenceDescriptor *) track->parent.
           descriptor[i];
       bwf = TRUE;
@@ -1447,7 +1453,8 @@ mxf_aes_bwf_create_caps (MXFMetadataTimelineTrack * track, GstTagList ** tags,
             descriptor[i])
         && (track->parent.descriptor[i]->essence_container.u[14] == 0x03
             || track->parent.descriptor[i]->essence_container.u[14] == 0x04
-            || track->parent.descriptor[i]->essence_container.u[14] == 0x09)) {
+            || track->parent.descriptor[i]->essence_container.u[14] == 0x09
+            || track->parent.descriptor[i]->essence_container.u[14] == 0x0b)) {
 
       s = (MXFMetadataGenericSoundEssenceDescriptor *) track->parent.
           descriptor[i];
index 57a57a3..e325151 100644 (file)
@@ -29,7 +29,8 @@
 typedef enum {
   MXF_ESSENCE_WRAPPING_FRAME_WRAPPING,
   MXF_ESSENCE_WRAPPING_CLIP_WRAPPING,
-  MXF_ESSENCE_WRAPPING_CUSTOM_WRAPPING
+  MXF_ESSENCE_WRAPPING_CUSTOM_WRAPPING,
+  MXF_ESSENCE_WRAPPING_UNKNOWN_WRAPPING
 } MXFEssenceWrapping;
 
 typedef GstFlowReturn (*MXFEssenceElementHandleFunc) (const MXFUL *key, GstBuffer *buffer, GstCaps *caps, MXFMetadataTimelineTrack *track, gpointer mapping_data, GstBuffer **outbuf);