diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-12-13 08:06:33 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-12-13 08:06:33 +0000 |
commit | a8ffb0e71da4e18dd65b225346118995dac2b0c2 (patch) | |
tree | b9547afb838a4d01f72379462cd670ae666c6b58 /gst | |
parent | c94b1bd2de42a4b1bbcdd7877e7c737f81229ebc (diff) | |
download | gst-plugins-bad-a8ffb0e71da4e18dd65b225346118995dac2b0c2.tar.gz gst-plugins-bad-a8ffb0e71da4e18dd65b225346118995dac2b0c2.tar.bz2 gst-plugins-bad-a8ffb0e71da4e18dd65b225346118995dac2b0c2.zip |
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.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mxf/mxfdemux.c | 50 |
1 files changed, 48 insertions, 2 deletions
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); |