diff options
-rw-r--r-- | ChangeLog | 8 | ||||
m--------- | common | 0 | ||||
-rw-r--r-- | gst/mxf/mxfdemux.c | 50 |
3 files changed, 56 insertions, 2 deletions
@@ -1,3 +1,11 @@ +2008-12-13 Sebastian Dröge <sebastian.droege@collabora.co.uk> + + * 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 <sebastian.droege@collabora.co.uk> * gst/mxf/mxfaes-bwf.c: diff --git a/common b/common -Subproject 55e579eeead04cfde7c63b3a4f5b3d4f72c2f61 +Subproject 1c24dce4e32f0a725ebd1b8ba2cd48d373818f7 diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 79d58cba..f8a2b3b1 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); |