From a8ffb0e71da4e18dd65b225346118995dac2b0c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 13 Dec 2008 08:06:33 +0000 Subject: [PATCH] gst/mxf/mxfdemux.c: Add a generic handler for descriptive metadata so we can get some debug output and let users file... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_descriptive_metadata), (gst_mxf_demux_handle_klv_packet): Add a generic handler for descriptive metadata so we can get some debug output and let users file bugs for unsupport descriptive metadata schemes. --- ChangeLog | 8 ++++++++ common | 2 +- gst/mxf/mxfdemux.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b31b7e..ed935c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-12-13 Sebastian Dröge + + * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_descriptive_metadata), + (gst_mxf_demux_handle_klv_packet): + Add a generic handler for descriptive metadata so we can get some + debug output and let users file bugs for unsupport descriptive + metadata schemes. + 2008-12-12 Sebastian Dröge * gst/mxf/mxfaes-bwf.c: diff --git a/common b/common index 55e579e..1c24dce 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 55e579eeead04cfde7c63b3a4f5b3d4f72c2f61d +Subproject commit 1c24dce4e32f0a725ebd1b8ba2cd48d373818f75 diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 79d58cb..f8a2b3b 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -1341,8 +1341,9 @@ gst_mxf_demux_handle_header_metadata_resolve_references (GstMXFDemux * demux) MXFMetadataEssenceContainerData, i); for (j = 0; j < demux->content_storage.n_essence_container_data; j++) { - if (mxf_ul_is_equal (&demux->content_storage. - essence_container_data_uids[j], &data->instance_uid)) { + if (mxf_ul_is_equal (&demux-> + content_storage.essence_container_data_uids[j], + &data->instance_uid)) { demux->content_storage.essence_container_data[j] = data; break; } @@ -2137,6 +2138,49 @@ gst_mxf_demux_handle_metadata (GstMXFDemux * demux, const MXFUL * key, } static GstFlowReturn +gst_mxf_demux_handle_descriptive_metadata (GstMXFDemux * demux, + const MXFUL * key, GstBuffer * buffer) +{ + guint32 type; + guint8 scheme; + GstFlowReturn ret = GST_FLOW_OK; + + scheme = GST_READ_UINT8 (key->u + 12); + type = GST_READ_UINT24_BE (key->u + 13); + + GST_DEBUG_OBJECT (demux, + "Handling descriptive metadata of size %u at offset %" + G_GUINT64_FORMAT " with scheme 0x%02x and type 0x%06x", + GST_BUFFER_SIZE (buffer), demux->offset, scheme, type); + + if (G_UNLIKELY (!demux->partition.valid)) { + GST_ERROR_OBJECT (demux, "Partition pack doesn't exist"); + return GST_FLOW_ERROR; + } + + if (G_UNLIKELY (!demux->primer.valid)) { + GST_ERROR_OBJECT (demux, "Primer pack doesn't exists"); + return GST_FLOW_ERROR; + } + + if (!demux->update_metadata) { + GST_DEBUG_OBJECT (demux, + "Skipping parsing of metadata because it's older than what we have"); + return GST_FLOW_OK; + } + + switch (type) { + default: + GST_WARNING_OBJECT (demux, + "Unknown or unhandled descriptive metadata of scheme 0x%02x and type 0x%06x", + scheme, type); + break; + } + + return ret; +} + +static GstFlowReturn gst_mxf_demux_handle_generic_container_system_item (GstMXFDemux * demux, const MXFUL * key, GstBuffer * buffer) { @@ -2670,6 +2714,8 @@ gst_mxf_demux_handle_klv_packet (GstMXFDemux * demux, const MXFUL * key, ret = gst_mxf_demux_handle_primer_pack (demux, key, buffer); } else if (mxf_is_metadata (key)) { ret = gst_mxf_demux_handle_metadata (demux, key, buffer); + } else if (mxf_is_descriptive_metadata (key)) { + ret = gst_mxf_demux_handle_descriptive_metadata (demux, key, buffer); } else if (mxf_is_generic_container_system_item (key)) { ret = gst_mxf_demux_handle_generic_container_system_item (demux, key, buffer); -- 2.7.4