From 8dc9f2ea4d01ebefa87b77b879d577b5bed115eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 7 Feb 2009 10:38:26 +0100 Subject: mxfdemux: Add support for non-standard Avid MXF files containing DNxHD essence Avid uses a custom essence container UL and custom essence element keys that are fortunately compatible with the generic container essence elements. Partially fixes bug #561922. --- gst/mxf/mxfvc3.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gst/mxf/mxfvc3.c') diff --git a/gst/mxf/mxfvc3.c b/gst/mxf/mxfvc3.c index 497355ef..e0f9b804 100644 --- a/gst/mxf/mxfvc3.c +++ b/gst/mxf/mxfvc3.c @@ -33,6 +33,11 @@ GST_DEBUG_CATEGORY_EXTERN (mxf_debug); #define GST_CAT_DEFAULT mxf_debug +static const guint8 picture_essence_coding_vc3_avid[] = { + 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x0e, 0x04, 0x02, 0x01, 0x02, + 0x04, 0x01, 0x00 +}; + static gboolean mxf_is_vc3_essence_track (const MXFMetadataTimelineTrack * track) { @@ -54,8 +59,19 @@ mxf_is_vc3_essence_track (const MXFMetadataTimelineTrack * track) /* SMPTE S2019-4 7 */ if (mxf_is_generic_container_essence_container_label (key) && key->u[12] == 0x02 && key->u[13] == 0x11 && - (key->u[14] == 0x01 || key->u[14] == 0x02)) + (key->u[14] == 0x01 || key->u[14] == 0x02)) { return TRUE; + } else if (mxf_is_avid_essence_container_label (key)) { + MXFMetadataGenericPictureEssenceDescriptor *p; + + if (!MXF_IS_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (d)) + return FALSE; + p = MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (d); + + key = &p->picture_essence_coding; + if (memcmp (key, picture_essence_coding_vc3_avid, 16) == 0) + return TRUE; + } } return FALSE; -- cgit v1.2.1