gst/mxf/: Rewrite parsing of descriptors to go top-down instead of bottom-up which makes it possible to have the buff...

Original commit message from CVS:
* gst/mxf/mxfaes-bwf.c:
(mxf_metadata_wave_audio_essence_descriptor_handle_tag):
* gst/mxf/mxfaes-bwf.h:
* gst/mxf/mxfdemux.c:
(gst_mxf_demux_handle_metadata_generic_descriptor),
(gst_mxf_demux_handle_metadata_file_descriptor),
(gst_mxf_demux_handle_metadata_multiple_descriptor),
(gst_mxf_demux_handle_metadata_generic_picture_essence_descriptor),
(gst_mxf_demux_handle_metadata_cdci_picture_essence_descriptor),
(gst_mxf_demux_handle_metadata_mpeg_video_descriptor),
(gst_mxf_demux_handle_metadata_generic_sound_essence_descriptor),
(gst_mxf_demux_handle_metadata_wave_audio_essence_descriptor),
(gst_mxf_demux_handle_header_metadata_resolve_references),
(gst_mxf_demux_handle_metadata):
* gst/mxf/mxfmpeg.c:
(mxf_metadata_mpeg_video_descriptor_handle_tag):
* gst/mxf/mxfmpeg.h:
* gst/mxf/mxfparse.c: (mxf_partition_pack_parse),
(mxf_primer_pack_parse), (mxf_metadata_preface_parse),
(mxf_metadata_identification_parse),
(mxf_metadata_content_storage_parse),
(mxf_metadata_essence_container_data_parse),
(mxf_metadata_generic_package_parse), (mxf_metadata_track_parse),
(mxf_metadata_sequence_parse),
(mxf_metadata_structural_component_parse),
(mxf_metadata_descriptor_parse),
(mxf_metadata_generic_descriptor_handle_tag),
(mxf_metadata_generic_descriptor_reset),
(mxf_metadata_file_descriptor_handle_tag),
(mxf_metadata_generic_sound_essence_descriptor_handle_tag),
(mxf_metadata_generic_picture_essence_descriptor_handle_tag),
(mxf_metadata_cdci_picture_essence_descriptor_handle_tag),
(mxf_metadata_multiple_descriptor_handle_tag),
(mxf_metadata_locator_parse):
* gst/mxf/mxfparse.h:
Rewrite parsing of descriptors to go top-down instead of bottom-up
which makes it possible to have the buffer data non-writable.
Improve debugging a bit.
This commit is contained in:
Sebastian Dröge 2008-11-25 09:38:26 +00:00
parent a485e4c252
commit fb8d2b901d
8 changed files with 1105 additions and 1211 deletions

View file

@ -1,3 +1,45 @@
2008-11-25 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* gst/mxf/mxfaes-bwf.c:
(mxf_metadata_wave_audio_essence_descriptor_handle_tag):
* gst/mxf/mxfaes-bwf.h:
* gst/mxf/mxfdemux.c:
(gst_mxf_demux_handle_metadata_generic_descriptor),
(gst_mxf_demux_handle_metadata_file_descriptor),
(gst_mxf_demux_handle_metadata_multiple_descriptor),
(gst_mxf_demux_handle_metadata_generic_picture_essence_descriptor),
(gst_mxf_demux_handle_metadata_cdci_picture_essence_descriptor),
(gst_mxf_demux_handle_metadata_mpeg_video_descriptor),
(gst_mxf_demux_handle_metadata_generic_sound_essence_descriptor),
(gst_mxf_demux_handle_metadata_wave_audio_essence_descriptor),
(gst_mxf_demux_handle_header_metadata_resolve_references),
(gst_mxf_demux_handle_metadata):
* gst/mxf/mxfmpeg.c:
(mxf_metadata_mpeg_video_descriptor_handle_tag):
* gst/mxf/mxfmpeg.h:
* gst/mxf/mxfparse.c: (mxf_partition_pack_parse),
(mxf_primer_pack_parse), (mxf_metadata_preface_parse),
(mxf_metadata_identification_parse),
(mxf_metadata_content_storage_parse),
(mxf_metadata_essence_container_data_parse),
(mxf_metadata_generic_package_parse), (mxf_metadata_track_parse),
(mxf_metadata_sequence_parse),
(mxf_metadata_structural_component_parse),
(mxf_metadata_descriptor_parse),
(mxf_metadata_generic_descriptor_handle_tag),
(mxf_metadata_generic_descriptor_reset),
(mxf_metadata_file_descriptor_handle_tag),
(mxf_metadata_generic_sound_essence_descriptor_handle_tag),
(mxf_metadata_generic_picture_essence_descriptor_handle_tag),
(mxf_metadata_cdci_picture_essence_descriptor_handle_tag),
(mxf_metadata_multiple_descriptor_handle_tag),
(mxf_metadata_locator_parse):
* gst/mxf/mxfparse.h:
Rewrite parsing of descriptors to go top-down instead of bottom-up
which makes it possible to have the buffer data non-writable.
Improve debugging a bit.
2008-11-24 Michael Smith <msmith@songbirdnest.com> 2008-11-24 Michael Smith <msmith@songbirdnest.com>
* configure.ac: * configure.ac:

View file

@ -41,154 +41,134 @@ GST_DEBUG_CATEGORY_EXTERN (mxf_debug);
/* SMPTE 382M Annex 1 */ /* SMPTE 382M Annex 1 */
gboolean gboolean
mxf_metadata_wave_audio_essence_descriptor_parse (const MXFUL * key, mxf_metadata_wave_audio_essence_descriptor_handle_tag
MXFMetadataWaveAudioEssenceDescriptor * descriptor, (MXFMetadataGenericDescriptor * d, const MXFPrimerPack * primer,
const MXFPrimerPack * primer, guint16 type, const guint8 * data, guint size) guint16 tag, const guint8 * tag_data, guint16 tag_size)
{ {
guint16 tag, tag_size; MXFMetadataWaveAudioEssenceDescriptor *descriptor =
const guint8 *tag_data; (MXFMetadataWaveAudioEssenceDescriptor *) d;
gboolean ret = FALSE;
gchar str[48]; gchar str[48];
g_return_val_if_fail (data != NULL, FALSE); switch (tag) {
case 0x3d0a:
memset (descriptor, 0, sizeof (MXFMetadataWaveAudioEssenceDescriptor)); if (tag_size != 2)
goto error;
if (!mxf_metadata_generic_sound_essence_descriptor_parse (key, descriptor->block_align = GST_READ_UINT16_BE (tag_data);
(MXFMetadataGenericSoundEssenceDescriptor *) descriptor, primer, type, GST_DEBUG (" block align = %u", descriptor->block_align);
data, size)) ret = TRUE;
goto error; break;
case 0x3d0b:
while (mxf_local_tag_parse (data, size, &tag, &tag_size, &tag_data)) { if (tag_size != 1)
if (tag_size == 0 || tag == 0x0000) goto error;
goto next; descriptor->sequence_offset = GST_READ_UINT8 (tag_data);
GST_DEBUG (" sequence offset = %u", descriptor->sequence_offset);
switch (tag) { ret = TRUE;
case 0x3d0a: break;
GST_WRITE_UINT16_BE (data, 0x0000); case 0x3d09:
if (tag_size != 2) if (tag_size != 4)
goto error; goto error;
descriptor->block_align = GST_READ_UINT16_BE (tag_data); descriptor->avg_bps = GST_READ_UINT32_BE (tag_data);
break; GST_DEBUG (" average bps = %u", descriptor->avg_bps);
case 0x3d0b: ret = TRUE;
GST_WRITE_UINT16_BE (data, 0x0000); break;
if (tag_size != 1) case 0x3d32:
goto error; if (tag_size != 16)
descriptor->sequence_offset = GST_READ_UINT8 (tag_data); goto error;
break; memcpy (&descriptor->channel_assignment, tag_data, 16);
case 0x3d09: GST_DEBUG (" channel assignment = %s",
GST_WRITE_UINT16_BE (data, 0x0000); mxf_ul_to_string (&descriptor->channel_assignment, str));
if (tag_size != 4) ret = TRUE;
goto error; break;
descriptor->avg_bps = GST_READ_UINT32_BE (tag_data); case 0x3d29:
break; if (tag_size != 4)
case 0x3d32: goto error;
GST_WRITE_UINT16_BE (data, 0x0000); descriptor->peak_envelope_version = GST_READ_UINT32_BE (tag_data);
if (tag_size != 16) GST_DEBUG (" peak envelope version = %u",
goto error; descriptor->peak_envelope_version);
memcpy (&descriptor->channel_assignment, tag_data, 16); ret = TRUE;
break; break;
case 0x3d29: case 0x3d2a:
GST_WRITE_UINT16_BE (data, 0x0000); if (tag_size != 4)
if (tag_size != 4) goto error;
goto error; descriptor->peak_envelope_format = GST_READ_UINT32_BE (tag_data);
descriptor->peak_envelope_version = GST_READ_UINT32_BE (tag_data); GST_DEBUG (" peak envelope format = %u",
break; descriptor->peak_envelope_format);
case 0x3d2a: ret = TRUE;
GST_WRITE_UINT16_BE (data, 0x0000); break;
if (tag_size != 4) case 0x3d2b:
goto error; if (tag_size != 4)
descriptor->peak_envelope_format = GST_READ_UINT32_BE (tag_data); goto error;
break; descriptor->points_per_peak_value = GST_READ_UINT32_BE (tag_data);
case 0x3d2b: GST_DEBUG (" points per peak value = %u",
GST_WRITE_UINT16_BE (data, 0x0000); descriptor->points_per_peak_value);
if (tag_size != 4) ret = TRUE;
goto error; break;
descriptor->points_per_peak_value = GST_READ_UINT32_BE (tag_data); case 0x3d2c:
break; if (tag_size != 4)
case 0x3d2c: goto error;
GST_WRITE_UINT16_BE (data, 0x0000); descriptor->peak_envelope_block_size = GST_READ_UINT32_BE (tag_data);
if (tag_size != 4) GST_DEBUG (" peak envelope block size = %u",
goto error; descriptor->peak_envelope_block_size);
descriptor->peak_envelope_block_size = GST_READ_UINT32_BE (tag_data); ret = TRUE;
break; break;
case 0x3d2d: case 0x3d2d:
GST_WRITE_UINT16_BE (data, 0x0000); if (tag_size != 4)
if (tag_size != 4) goto error;
goto error; descriptor->peak_channels = GST_READ_UINT32_BE (tag_data);
descriptor->peak_channels = GST_READ_UINT32_BE (tag_data); GST_DEBUG (" peak channels = %u", descriptor->peak_channels);
break; ret = TRUE;
case 0x3d2e: break;
GST_WRITE_UINT16_BE (data, 0x0000); case 0x3d2e:
if (tag_size != 4) if (tag_size != 4)
goto error; goto error;
descriptor->peak_frames = GST_READ_UINT32_BE (tag_data); descriptor->peak_frames = GST_READ_UINT32_BE (tag_data);
break; GST_DEBUG (" peak frames = %u", descriptor->peak_frames);
case 0x3d2f: ret = TRUE;
GST_WRITE_UINT16_BE (data, 0x0000); break;
if (tag_size != 8) case 0x3d2f:
goto error; if (tag_size != 8)
descriptor->peak_of_peaks_position = GST_READ_UINT64_BE (tag_data); goto error;
break; descriptor->peak_of_peaks_position = GST_READ_UINT64_BE (tag_data);
case 0x3d30: GST_DEBUG (" peak of peaks position = %" G_GINT64_FORMAT,
GST_WRITE_UINT16_BE (data, 0x0000); descriptor->peak_of_peaks_position);
if (!mxf_timestamp_parse (&descriptor->peak_envelope_timestamp, ret = TRUE;
tag_data, tag_size)) break;
goto error; case 0x3d30:
break; if (!mxf_timestamp_parse (&descriptor->peak_envelope_timestamp,
case 0x3d31: tag_data, tag_size))
GST_WRITE_UINT16_BE (data, 0x0000); goto error;
descriptor->peak_envelope_data = g_memdup (tag_data, tag_size); GST_DEBUG (" peak envelope timestamp = %d/%u/%u %u:%u:%u.%u",
descriptor->peak_envelope_data_length = tag_size; descriptor->peak_envelope_timestamp.year,
break; descriptor->peak_envelope_timestamp.month,
default: descriptor->peak_envelope_timestamp.day,
if (type != MXF_METADATA_WAVE_AUDIO_ESSENCE_DESCRIPTOR) descriptor->peak_envelope_timestamp.hour,
goto next; descriptor->peak_envelope_timestamp.minute,
GST_WRITE_UINT16_BE (data, 0x0000); descriptor->peak_envelope_timestamp.second,
if (!gst_metadata_add_custom_tag (primer, tag, tag_data, tag_size, (descriptor->peak_envelope_timestamp.quarter_msecond * 1000) / 256);
&((MXFMetadataGenericDescriptor *) descriptor)->other_tags)) ret = TRUE;
goto error; break;
break; case 0x3d31:
} descriptor->peak_envelope_data = g_memdup (tag_data, tag_size);
descriptor->peak_envelope_data_length = tag_size;
next: GST_DEBUG (" peak evelope data size = %u",
data += 4 + tag_size; descriptor->peak_envelope_data_length);
size -= 4 + tag_size; ret = TRUE;
break;
default:
ret =
mxf_metadata_generic_sound_essence_descriptor_handle_tag (d, primer,
tag, tag_data, tag_size);
break;
} }
GST_DEBUG ("Parsed wave audio essence descriptor:"); return ret;
GST_DEBUG (" block align = %u", descriptor->block_align);
GST_DEBUG (" sequence offset = %u", descriptor->sequence_offset);
GST_DEBUG (" average bps = %u", descriptor->avg_bps);
GST_DEBUG (" channel assignment = %s",
mxf_ul_to_string (&descriptor->channel_assignment, str));
GST_DEBUG (" peak envelope version = %u", descriptor->peak_envelope_version);
GST_DEBUG (" peak envelope format = %u", descriptor->peak_envelope_format);
GST_DEBUG (" points per peak value = %u", descriptor->points_per_peak_value);
GST_DEBUG (" peak envelope block size = %u",
descriptor->peak_envelope_block_size);
GST_DEBUG (" peak channels = %u", descriptor->peak_channels);
GST_DEBUG (" peak frames = %u", descriptor->peak_frames);
GST_DEBUG (" peak of peaks position = %" G_GINT64_FORMAT,
descriptor->peak_of_peaks_position);
GST_DEBUG (" peak envelope timestamp = %d/%u/%u %u:%u:%u.%u",
descriptor->peak_envelope_timestamp.year,
descriptor->peak_envelope_timestamp.month,
descriptor->peak_envelope_timestamp.day,
descriptor->peak_envelope_timestamp.hour,
descriptor->peak_envelope_timestamp.minute,
descriptor->peak_envelope_timestamp.second,
(descriptor->peak_envelope_timestamp.quarter_msecond * 1000) / 256);
GST_DEBUG (" peak evelope data size = %u",
descriptor->peak_envelope_data_length);
return TRUE;
error: error:
GST_ERROR ("Invalid wave audio essence descriptor"); GST_ERROR ("Invalid wave audio essence descriptor tag 0x%04x of size %u", tag,
mxf_metadata_wave_audio_essence_descriptor_reset (descriptor); tag_size);
return FALSE; return TRUE;
} }
void mxf_metadata_wave_audio_essence_descriptor_reset void mxf_metadata_wave_audio_essence_descriptor_reset

View file

@ -55,7 +55,8 @@ typedef struct {
guint16 peak_envelope_data_length; guint16 peak_envelope_data_length;
} MXFMetadataWaveAudioEssenceDescriptor; } MXFMetadataWaveAudioEssenceDescriptor;
gboolean mxf_metadata_wave_audio_essence_descriptor_parse (const MXFUL *key, MXFMetadataWaveAudioEssenceDescriptor *descriptor, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_wave_audio_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
void mxf_metadata_wave_audio_essence_descriptor_reset (MXFMetadataWaveAudioEssenceDescriptor *descriptor); void mxf_metadata_wave_audio_essence_descriptor_reset (MXFMetadataWaveAudioEssenceDescriptor *descriptor);
gboolean mxf_is_aes_bwf_essence_track (const MXFMetadataTrack *track); gboolean mxf_is_aes_bwf_essence_track (const MXFMetadataTrack *track);

View file

@ -703,21 +703,26 @@ gst_mxf_demux_handle_metadata_generic_descriptor (GstMXFDemux * demux,
{ {
MXFMetadataGenericDescriptor descriptor; MXFMetadataGenericDescriptor descriptor;
memset (&descriptor, 0, sizeof (descriptor));
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"Handling metadata generic descriptor of size %u" "Handling metadata generic descriptor of size %u"
" at offset %" G_GUINT64_FORMAT " with type 0x%04d", " at offset %" G_GUINT64_FORMAT " with type 0x%04d",
GST_BUFFER_SIZE (buffer), demux->offset, type); GST_BUFFER_SIZE (buffer), demux->offset, type);
if (!mxf_metadata_generic_descriptor_parse (key, &descriptor, if (!mxf_metadata_descriptor_parse (key,
&demux->primer, type, GST_BUFFER_DATA (buffer), (MXFMetadataGenericDescriptor *) & descriptor, &demux->primer,
GST_BUFFER_SIZE (buffer))) { type, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer),
(MXFMetadataDescriptorHandleTag)
mxf_metadata_generic_descriptor_handle_tag,
(MXFMetadataDescriptorReset) mxf_metadata_generic_descriptor_reset)) {
GST_ERROR_OBJECT (demux, "Parsing metadata generic descriptor failed"); GST_ERROR_OBJECT (demux, "Parsing metadata generic descriptor failed");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
if (!demux->generic_descriptor) if (!demux->generic_descriptor)
demux->generic_descriptor = demux->generic_descriptor =
g_array_new (FALSE, FALSE, sizeof (MXFMetadataGenericDescriptor)); g_array_new (FALSE, TRUE, sizeof (MXFMetadataGenericDescriptor));
g_array_append_val (demux->generic_descriptor, descriptor); g_array_append_val (demux->generic_descriptor, descriptor);
@ -730,21 +735,26 @@ gst_mxf_demux_handle_metadata_file_descriptor (GstMXFDemux * demux,
{ {
MXFMetadataFileDescriptor descriptor; MXFMetadataFileDescriptor descriptor;
memset (&descriptor, 0, sizeof (descriptor));
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"Handling metadata file descriptor of size %u" "Handling metadata file descriptor of size %u"
" at offset %" G_GUINT64_FORMAT " with type 0x%04d", " at offset %" G_GUINT64_FORMAT " with type 0x%04d",
GST_BUFFER_SIZE (buffer), demux->offset, type); GST_BUFFER_SIZE (buffer), demux->offset, type);
if (!mxf_metadata_file_descriptor_parse (key, &descriptor, if (!mxf_metadata_descriptor_parse (key,
&demux->primer, type, GST_BUFFER_DATA (buffer), (MXFMetadataGenericDescriptor *) & descriptor, &demux->primer,
GST_BUFFER_SIZE (buffer))) { type, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer),
(MXFMetadataDescriptorHandleTag)
mxf_metadata_file_descriptor_handle_tag,
(MXFMetadataDescriptorReset) mxf_metadata_file_descriptor_reset)) {
GST_ERROR_OBJECT (demux, "Parsing metadata file descriptor failed"); GST_ERROR_OBJECT (demux, "Parsing metadata file descriptor failed");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
if (!demux->file_descriptor) if (!demux->file_descriptor)
demux->file_descriptor = demux->file_descriptor =
g_array_new (FALSE, FALSE, sizeof (MXFMetadataFileDescriptor)); g_array_new (FALSE, TRUE, sizeof (MXFMetadataFileDescriptor));
g_array_append_val (demux->file_descriptor, descriptor); g_array_append_val (demux->file_descriptor, descriptor);
@ -757,21 +767,27 @@ gst_mxf_demux_handle_metadata_multiple_descriptor (GstMXFDemux * demux,
{ {
MXFMetadataMultipleDescriptor descriptor; MXFMetadataMultipleDescriptor descriptor;
memset (&descriptor, 0, sizeof (descriptor));
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"Handling metadata multiple descriptor of size %u" "Handling metadata multiple descriptor of size %u"
" at offset %" G_GUINT64_FORMAT " with type 0x%04d", " at offset %" G_GUINT64_FORMAT " with type 0x%04d",
GST_BUFFER_SIZE (buffer), demux->offset, type); GST_BUFFER_SIZE (buffer), demux->offset, type);
if (!mxf_metadata_multiple_descriptor_parse (key, &descriptor, if (!mxf_metadata_descriptor_parse (key,
&demux->primer, type, GST_BUFFER_DATA (buffer), (MXFMetadataGenericDescriptor *) & descriptor, &demux->primer,
GST_BUFFER_SIZE (buffer))) { type, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer),
(MXFMetadataDescriptorHandleTag)
mxf_metadata_multiple_descriptor_handle_tag,
(MXFMetadataDescriptorReset) mxf_metadata_multiple_descriptor_reset))
{
GST_ERROR_OBJECT (demux, "Parsing metadata multiple descriptor failed"); GST_ERROR_OBJECT (demux, "Parsing metadata multiple descriptor failed");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
if (!demux->multiple_descriptor) if (!demux->multiple_descriptor)
demux->multiple_descriptor = demux->multiple_descriptor =
g_array_new (FALSE, FALSE, sizeof (MXFMetadataMultipleDescriptor)); g_array_new (FALSE, TRUE, sizeof (MXFMetadataMultipleDescriptor));
g_array_append_val (demux->multiple_descriptor, descriptor); g_array_append_val (demux->multiple_descriptor, descriptor);
@ -784,14 +800,20 @@ gst_mxf_demux_handle_metadata_generic_picture_essence_descriptor (GstMXFDemux *
{ {
MXFMetadataGenericPictureEssenceDescriptor descriptor; MXFMetadataGenericPictureEssenceDescriptor descriptor;
memset (&descriptor, 0, sizeof (descriptor));
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"Handling metadata generic picture essence descriptor of size %u" "Handling metadata generic picture essence descriptor of size %u"
" at offset %" G_GUINT64_FORMAT " with type 0x%04d", " at offset %" G_GUINT64_FORMAT " with type 0x%04d",
GST_BUFFER_SIZE (buffer), demux->offset, type); GST_BUFFER_SIZE (buffer), demux->offset, type);
if (!mxf_metadata_generic_picture_essence_descriptor_parse (key, &descriptor, if (!mxf_metadata_descriptor_parse (key,
&demux->primer, type, GST_BUFFER_DATA (buffer), (MXFMetadataGenericDescriptor *) & descriptor, &demux->primer,
GST_BUFFER_SIZE (buffer))) { type, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer),
(MXFMetadataDescriptorHandleTag)
mxf_metadata_generic_picture_essence_descriptor_handle_tag,
(MXFMetadataDescriptorReset)
mxf_metadata_generic_picture_essence_descriptor_reset)) {
GST_ERROR_OBJECT (demux, GST_ERROR_OBJECT (demux,
"Parsing metadata generic picture essence descriptor failed"); "Parsing metadata generic picture essence descriptor failed");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
@ -799,7 +821,7 @@ gst_mxf_demux_handle_metadata_generic_picture_essence_descriptor (GstMXFDemux *
if (!demux->generic_picture_essence_descriptor) if (!demux->generic_picture_essence_descriptor)
demux->generic_picture_essence_descriptor = demux->generic_picture_essence_descriptor =
g_array_new (FALSE, FALSE, g_array_new (FALSE, TRUE,
sizeof (MXFMetadataGenericPictureEssenceDescriptor)); sizeof (MXFMetadataGenericPictureEssenceDescriptor));
g_array_append_val (demux->generic_picture_essence_descriptor, descriptor); g_array_append_val (demux->generic_picture_essence_descriptor, descriptor);
@ -813,14 +835,20 @@ gst_mxf_demux_handle_metadata_cdci_picture_essence_descriptor (GstMXFDemux *
{ {
MXFMetadataCDCIPictureEssenceDescriptor descriptor; MXFMetadataCDCIPictureEssenceDescriptor descriptor;
memset (&descriptor, 0, sizeof (descriptor));
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"Handling metadata CDCI picture essence descriptor of size %u" "Handling metadata CDCI picture essence descriptor of size %u"
" at offset %" G_GUINT64_FORMAT " with type 0x%04d", " at offset %" G_GUINT64_FORMAT " with type 0x%04d",
GST_BUFFER_SIZE (buffer), demux->offset, type); GST_BUFFER_SIZE (buffer), demux->offset, type);
if (!mxf_metadata_cdci_picture_essence_descriptor_parse (key, &descriptor, if (!mxf_metadata_descriptor_parse (key,
&demux->primer, type, GST_BUFFER_DATA (buffer), (MXFMetadataGenericDescriptor *) & descriptor, &demux->primer,
GST_BUFFER_SIZE (buffer))) { type, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer),
(MXFMetadataDescriptorHandleTag)
mxf_metadata_cdci_picture_essence_descriptor_handle_tag,
(MXFMetadataDescriptorReset)
mxf_metadata_cdci_picture_essence_descriptor_reset)) {
GST_ERROR_OBJECT (demux, GST_ERROR_OBJECT (demux,
"Parsing metadata CDCI picture essence descriptor failed"); "Parsing metadata CDCI picture essence descriptor failed");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
@ -828,7 +856,7 @@ gst_mxf_demux_handle_metadata_cdci_picture_essence_descriptor (GstMXFDemux *
if (!demux->cdci_picture_essence_descriptor) if (!demux->cdci_picture_essence_descriptor)
demux->cdci_picture_essence_descriptor = demux->cdci_picture_essence_descriptor =
g_array_new (FALSE, FALSE, g_array_new (FALSE, TRUE,
sizeof (MXFMetadataCDCIPictureEssenceDescriptor)); sizeof (MXFMetadataCDCIPictureEssenceDescriptor));
g_array_append_val (demux->cdci_picture_essence_descriptor, descriptor); g_array_append_val (demux->cdci_picture_essence_descriptor, descriptor);
@ -842,21 +870,27 @@ gst_mxf_demux_handle_metadata_mpeg_video_descriptor (GstMXFDemux * demux,
{ {
MXFMetadataMPEGVideoDescriptor descriptor; MXFMetadataMPEGVideoDescriptor descriptor;
memset (&descriptor, 0, sizeof (descriptor));
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"Handling metadata MPEG video descriptor of size %u" "Handling metadata MPEG video descriptor of size %u"
" at offset %" G_GUINT64_FORMAT " with type 0x%04d", " at offset %" G_GUINT64_FORMAT " with type 0x%04d",
GST_BUFFER_SIZE (buffer), demux->offset, type); GST_BUFFER_SIZE (buffer), demux->offset, type);
if (!mxf_metadata_mpeg_video_descriptor_parse (key, &descriptor, if (!mxf_metadata_descriptor_parse (key,
&demux->primer, type, GST_BUFFER_DATA (buffer), (MXFMetadataGenericDescriptor *) & descriptor, &demux->primer,
GST_BUFFER_SIZE (buffer))) { type, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer),
(MXFMetadataDescriptorHandleTag)
mxf_metadata_mpeg_video_descriptor_handle_tag,
(MXFMetadataDescriptorReset)
mxf_metadata_mpeg_video_descriptor_reset)) {
GST_ERROR_OBJECT (demux, "Parsing metadata MPEG video descriptor failed"); GST_ERROR_OBJECT (demux, "Parsing metadata MPEG video descriptor failed");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
if (!demux->mpeg_video_descriptor) if (!demux->mpeg_video_descriptor)
demux->mpeg_video_descriptor = demux->mpeg_video_descriptor =
g_array_new (FALSE, FALSE, sizeof (MXFMetadataMPEGVideoDescriptor)); g_array_new (FALSE, TRUE, sizeof (MXFMetadataMPEGVideoDescriptor));
g_array_append_val (demux->mpeg_video_descriptor, descriptor); g_array_append_val (demux->mpeg_video_descriptor, descriptor);
@ -869,14 +903,20 @@ gst_mxf_demux_handle_metadata_generic_sound_essence_descriptor (GstMXFDemux *
{ {
MXFMetadataGenericSoundEssenceDescriptor descriptor; MXFMetadataGenericSoundEssenceDescriptor descriptor;
memset (&descriptor, 0, sizeof (descriptor));
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"Handling metadata generic sound essence descriptor of size %u" "Handling metadata generic sound essence descriptor of size %u"
" at offset %" G_GUINT64_FORMAT " with type 0x%04d", " at offset %" G_GUINT64_FORMAT " with type 0x%04d",
GST_BUFFER_SIZE (buffer), demux->offset, type); GST_BUFFER_SIZE (buffer), demux->offset, type);
if (!mxf_metadata_generic_sound_essence_descriptor_parse (key, &descriptor, if (!mxf_metadata_descriptor_parse (key,
&demux->primer, type, GST_BUFFER_DATA (buffer), (MXFMetadataGenericDescriptor *) & descriptor, &demux->primer,
GST_BUFFER_SIZE (buffer))) { type, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer),
(MXFMetadataDescriptorHandleTag)
mxf_metadata_generic_sound_essence_descriptor_handle_tag,
(MXFMetadataDescriptorReset)
mxf_metadata_generic_sound_essence_descriptor_reset)) {
GST_ERROR_OBJECT (demux, GST_ERROR_OBJECT (demux,
"Parsing metadata generic sound essence descriptor failed"); "Parsing metadata generic sound essence descriptor failed");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
@ -884,7 +924,7 @@ gst_mxf_demux_handle_metadata_generic_sound_essence_descriptor (GstMXFDemux *
if (!demux->generic_sound_essence_descriptor) if (!demux->generic_sound_essence_descriptor)
demux->generic_sound_essence_descriptor = demux->generic_sound_essence_descriptor =
g_array_new (FALSE, FALSE, g_array_new (FALSE, TRUE,
sizeof (MXFMetadataGenericSoundEssenceDescriptor)); sizeof (MXFMetadataGenericSoundEssenceDescriptor));
g_array_append_val (demux->generic_sound_essence_descriptor, descriptor); g_array_append_val (demux->generic_sound_essence_descriptor, descriptor);
@ -898,14 +938,20 @@ gst_mxf_demux_handle_metadata_wave_audio_essence_descriptor (GstMXFDemux *
{ {
MXFMetadataWaveAudioEssenceDescriptor descriptor; MXFMetadataWaveAudioEssenceDescriptor descriptor;
memset (&descriptor, 0, sizeof (descriptor));
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"Handling metadata wave sound essence descriptor of size %u" "Handling metadata wave sound essence descriptor of size %u"
" at offset %" G_GUINT64_FORMAT " with type 0x%04d", " at offset %" G_GUINT64_FORMAT " with type 0x%04d",
GST_BUFFER_SIZE (buffer), demux->offset, type); GST_BUFFER_SIZE (buffer), demux->offset, type);
if (!mxf_metadata_wave_audio_essence_descriptor_parse (key, &descriptor, if (!mxf_metadata_descriptor_parse (key,
&demux->primer, type, GST_BUFFER_DATA (buffer), (MXFMetadataGenericDescriptor *) & descriptor, &demux->primer,
GST_BUFFER_SIZE (buffer))) { type, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer),
(MXFMetadataDescriptorHandleTag)
mxf_metadata_wave_audio_essence_descriptor_handle_tag,
(MXFMetadataDescriptorReset)
mxf_metadata_wave_audio_essence_descriptor_reset)) {
GST_ERROR_OBJECT (demux, GST_ERROR_OBJECT (demux,
"Parsing metadata wave sound essence descriptor failed"); "Parsing metadata wave sound essence descriptor failed");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
@ -913,7 +959,7 @@ gst_mxf_demux_handle_metadata_wave_audio_essence_descriptor (GstMXFDemux *
if (!demux->wave_audio_essence_descriptor) if (!demux->wave_audio_essence_descriptor)
demux->wave_audio_essence_descriptor = demux->wave_audio_essence_descriptor =
g_array_new (FALSE, FALSE, g_array_new (FALSE, TRUE,
sizeof (MXFMetadataWaveAudioEssenceDescriptor)); sizeof (MXFMetadataWaveAudioEssenceDescriptor));
g_array_append_val (demux->wave_audio_essence_descriptor, descriptor); g_array_append_val (demux->wave_audio_essence_descriptor, descriptor);
@ -1748,12 +1794,6 @@ gst_mxf_demux_handle_metadata (GstMXFDemux * demux, const MXFUL * key,
return GST_FLOW_OK; return GST_FLOW_OK;
} }
/* Make writable as the parsing of descriptors sets already read local tags to 0x0000 */
if (!gst_buffer_is_writable (buffer))
buffer = gst_buffer_copy (buffer);
else
buffer = gst_buffer_ref (buffer);
switch (type) { switch (type) {
case MXF_METADATA_PREFACE: case MXF_METADATA_PREFACE:
ret = gst_mxf_demux_handle_metadata_preface (demux, key, buffer); ret = gst_mxf_demux_handle_metadata_preface (demux, key, buffer);
@ -1838,8 +1878,6 @@ gst_mxf_demux_handle_metadata (GstMXFDemux * demux, const MXFUL * key,
break; break;
} }
gst_buffer_unref (buffer);
return ret; return ret;
} }

View file

@ -89,116 +89,94 @@ static const guint8 _profile_and_level_ul[] = {
}; };
gboolean gboolean
mxf_metadata_mpeg_video_descriptor_parse (const MXFUL * key, mxf_metadata_mpeg_video_descriptor_handle_tag (MXFMetadataGenericDescriptor * d,
MXFMetadataMPEGVideoDescriptor * descriptor, const MXFPrimerPack * primer, guint16 tag, const guint8 * tag_data,
const MXFPrimerPack * primer, guint16 type, const guint8 * data, guint size) guint16 tag_size)
{ {
guint16 tag, tag_size; MXFMetadataMPEGVideoDescriptor *descriptor =
const guint8 *tag_data; (MXFMetadataMPEGVideoDescriptor *) d;
gboolean ret = FALSE;
MXFUL *tag_ul = NULL;
g_return_val_if_fail (data != NULL, FALSE); if (!(tag_ul =
(MXFUL *) g_hash_table_lookup (primer->mappings,
GUINT_TO_POINTER (((guint) tag)))))
return FALSE;
memset (descriptor, 0, sizeof (MXFMetadataMPEGVideoDescriptor)); if (memcmp (tag_ul, &_single_sequence_ul, 16) == 0) {
if (tag_size != 1)
if (!mxf_metadata_cdci_picture_essence_descriptor_parse (key, goto error;
(MXFMetadataCDCIPictureEssenceDescriptor *) descriptor, primer, type, descriptor->single_sequence = GST_READ_UINT8 (tag_data);
data, size)) GST_DEBUG (" single sequence = %s",
goto error; (descriptor->single_sequence) ? "yes" : "no");
ret = TRUE;
while (mxf_local_tag_parse (data, size, &tag, &tag_size, &tag_data)) { } else if (memcmp (tag_ul, &_constant_b_frames_ul, 16) == 0) {
MXFUL *tag_ul = NULL; if (tag_size != 1)
goto error;
if (tag_size == 0 || tag == 0x0000) descriptor->const_b_frames = GST_READ_UINT8 (tag_data);
goto next; GST_DEBUG (" constant b frames = %s",
(descriptor->single_sequence) ? "yes" : "no");
if (!(tag_ul = ret = TRUE;
(MXFUL *) g_hash_table_lookup (primer->mappings, } else if (memcmp (tag_ul, &_coded_content_type_ul, 16) == 0) {
GUINT_TO_POINTER (((guint) tag))))) if (tag_size != 1)
goto next; goto error;
descriptor->coded_content_type = GST_READ_UINT8 (tag_data);
if (memcmp (tag_ul, &_single_sequence_ul, 16) == 0) { GST_DEBUG (" coded content type = %u", descriptor->coded_content_type);
GST_WRITE_UINT16_BE (data, 0x0000); ret = TRUE;
if (tag_size != 1) } else if (memcmp (tag_ul, &_low_delay_ul, 16) == 0) {
goto error; if (tag_size != 1)
descriptor->single_sequence = GST_READ_UINT8 (tag_data); goto error;
} else if (memcmp (tag_ul, &_constant_b_frames_ul, 16) == 0) { descriptor->low_delay = GST_READ_UINT8 (tag_data);
GST_WRITE_UINT16_BE (data, 0x0000); GST_DEBUG (" low delay = %s", (descriptor->low_delay) ? "yes" : "no");
if (tag_size != 1) ret = TRUE;
goto error; } else if (memcmp (tag_ul, &_closed_gop_ul, 16) == 0) {
descriptor->const_b_frames = GST_READ_UINT8 (tag_data); if (tag_size != 1)
} else if (memcmp (tag_ul, &_coded_content_type_ul, 16) == 0) { goto error;
GST_WRITE_UINT16_BE (data, 0x0000); descriptor->closed_gop = GST_READ_UINT8 (tag_data);
if (tag_size != 1) GST_DEBUG (" closed gop = %s", (descriptor->closed_gop) ? "yes" : "no");
goto error; ret = TRUE;
descriptor->coded_content_type = GST_READ_UINT8 (tag_data); } else if (memcmp (tag_ul, &_identical_gop_ul, 16) == 0) {
} else if (memcmp (tag_ul, &_low_delay_ul, 16) == 0) { if (tag_size != 1)
GST_WRITE_UINT16_BE (data, 0x0000); goto error;
if (tag_size != 1) descriptor->identical_gop = GST_READ_UINT8 (tag_data);
goto error; GST_DEBUG (" identical gop = %s",
descriptor->low_delay = GST_READ_UINT8 (tag_data); (descriptor->identical_gop) ? "yes" : "no");
} else if (memcmp (tag_ul, &_closed_gop_ul, 16) == 0) { ret = TRUE;
GST_WRITE_UINT16_BE (data, 0x0000); } else if (memcmp (tag_ul, &_max_gop_ul, 16) == 0) {
if (tag_size != 1) if (tag_size != 2)
goto error; goto error;
descriptor->closed_gop = GST_READ_UINT8 (tag_data); descriptor->max_gop = GST_READ_UINT16_BE (tag_data);
} else if (memcmp (tag_ul, &_identical_gop_ul, 16) == 0) { GST_DEBUG (" max gop = %u", descriptor->max_gop);
GST_WRITE_UINT16_BE (data, 0x0000); ret = TRUE;
if (tag_size != 1) } else if (memcmp (tag_ul, &_b_picture_count_ul, 16) == 0) {
goto error; if (tag_size != 2)
descriptor->identical_gop = GST_READ_UINT8 (tag_data); goto error;
} else if (memcmp (tag_ul, &_max_gop_ul, 16) == 0) { descriptor->b_picture_count = GST_READ_UINT16_BE (tag_data);
GST_WRITE_UINT16_BE (data, 0x0000); GST_DEBUG (" b picture count = %u", descriptor->b_picture_count);
if (tag_size != 2) ret = TRUE;
goto error; } else if (memcmp (tag_ul, &_bitrate_ul, 16) == 0) {
descriptor->max_gop = GST_READ_UINT16_BE (tag_data); if (tag_size != 4)
} else if (memcmp (tag_ul, &_b_picture_count_ul, 16) == 0) { goto error;
GST_WRITE_UINT16_BE (data, 0x0000); descriptor->bitrate = GST_READ_UINT32_BE (tag_data);
if (tag_size != 2) GST_DEBUG (" bitrate = %u", descriptor->bitrate);
goto error; ret = TRUE;
descriptor->b_picture_count = GST_READ_UINT16_BE (tag_data); } else if (memcmp (tag_ul, &_profile_and_level_ul, 16) == 0) {
} else if (memcmp (tag_ul, &_bitrate_ul, 16) == 0) { if (tag_size != 1)
GST_WRITE_UINT16_BE (data, 0x0000); goto error;
if (tag_size != 4) descriptor->profile_and_level = GST_READ_UINT8 (tag_data);
goto error; GST_DEBUG (" profile & level = %u", descriptor->profile_and_level);
descriptor->bitrate = GST_READ_UINT32_BE (tag_data); ret = TRUE;
} else if (memcmp (tag_ul, &_profile_and_level_ul, 16) == 0) { } else {
GST_WRITE_UINT16_BE (data, 0x0000); ret =
if (tag_size != 1) mxf_metadata_cdci_picture_essence_descriptor_handle_tag (d, primer, tag,
goto error; tag_data, tag_size);
descriptor->profile_and_level = GST_READ_UINT8 (tag_data);
} else {
if (type != MXF_METADATA_MPEG_VIDEO_DESCRIPTOR)
goto next;
GST_WRITE_UINT16_BE (data, 0x0000);
if (!gst_metadata_add_custom_tag (primer, tag, tag_data, tag_size,
&((MXFMetadataGenericDescriptor *) descriptor)->other_tags))
goto error;
}
next:
data += 4 + tag_size;
size -= 4 + tag_size;
} }
GST_DEBUG ("Parsed mpeg video descriptors:"); return ret;
GST_DEBUG (" single sequence = %s",
(descriptor->single_sequence) ? "yes" : "no");
GST_DEBUG (" constant b frames = %s",
(descriptor->single_sequence) ? "yes" : "no");
GST_DEBUG (" coded content type = %u", descriptor->coded_content_type);
GST_DEBUG (" low delay = %s", (descriptor->low_delay) ? "yes" : "no");
GST_DEBUG (" closed gop = %s", (descriptor->closed_gop) ? "yes" : "no");
GST_DEBUG (" identical gop = %s",
(descriptor->identical_gop) ? "yes" : "no");
GST_DEBUG (" max gop = %u", descriptor->max_gop);
GST_DEBUG (" b picture count = %u", descriptor->b_picture_count);
GST_DEBUG (" bitrate = %u", descriptor->bitrate);
GST_DEBUG (" profile & level = %u", descriptor->profile_and_level);
return TRUE;
error: error:
GST_ERROR ("Invalid mpeg video descriptor"); GST_ERROR ("Invalid mpeg video descriptor tag 0x%04x of size %u", tag,
mxf_metadata_mpeg_video_descriptor_reset (descriptor); tag_size);
return FALSE; return FALSE;
} }

View file

@ -49,7 +49,7 @@ typedef struct {
guint8 profile_and_level; guint8 profile_and_level;
} MXFMetadataMPEGVideoDescriptor; } MXFMetadataMPEGVideoDescriptor;
gboolean mxf_metadata_mpeg_video_descriptor_parse (const MXFUL *key, MXFMetadataMPEGVideoDescriptor *descriptor, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_mpeg_video_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor, const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
void mxf_metadata_mpeg_video_descriptor_reset (MXFMetadataMPEGVideoDescriptor *descriptor); void mxf_metadata_mpeg_video_descriptor_reset (MXFMetadataMPEGVideoDescriptor *descriptor);
gboolean mxf_is_mpeg_video_essence_track (const MXFMetadataTrack *track); gboolean mxf_is_mpeg_video_essence_track (const MXFMetadataTrack *track);

File diff suppressed because it is too large Load diff

View file

@ -24,6 +24,10 @@
typedef GstFlowReturn (*MXFEssenceElementHandler) (const MXFUL *key, GstBuffer *buffer, GstCaps *caps, MXFMetadataGenericPackage *package, MXFMetadataTrack *track, MXFMetadataStructuralComponent *component, gpointer mapping_data, GstBuffer **outbuf); typedef GstFlowReturn (*MXFEssenceElementHandler) (const MXFUL *key, GstBuffer *buffer, GstCaps *caps, MXFMetadataGenericPackage *package, MXFMetadataTrack *track, MXFMetadataStructuralComponent *component, gpointer mapping_data, GstBuffer **outbuf);
typedef gboolean (*MXFMetadataDescriptorHandleTag) (MXFMetadataGenericDescriptor *descriptor,
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
typedef void (*MXFMetadataDescriptorReset) (MXFMetadataGenericDescriptor *descriptor);
gchar * mxf_ul_to_string (const MXFUL *ul, gchar str[48]); gchar * mxf_ul_to_string (const MXFUL *ul, gchar str[48]);
gboolean mxf_ul_is_equal (const MXFUL *a, const MXFUL *b); gboolean mxf_ul_is_equal (const MXFUL *a, const MXFUL *b);
gboolean mxf_ul_is_zero (const MXFUL *ul); gboolean mxf_ul_is_zero (const MXFUL *ul);
@ -104,22 +108,31 @@ void mxf_metadata_sequence_reset (MXFMetadataSequence *sequence);
gboolean mxf_metadata_structural_component_parse (const MXFUL *key, MXFMetadataStructuralComponent *component, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_structural_component_parse (const MXFUL *key, MXFMetadataStructuralComponent *component, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size);
void mxf_metadata_structural_component_reset (MXFMetadataStructuralComponent *component); void mxf_metadata_structural_component_reset (MXFMetadataStructuralComponent *component);
gboolean mxf_metadata_generic_descriptor_parse (const MXFUL *key, MXFMetadataGenericDescriptor *descriptor, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean
mxf_metadata_descriptor_parse (const MXFUL * key, MXFMetadataGenericDescriptor * descriptor, const MXFPrimerPack * primer, guint16 type, const guint8 * data, guint size, MXFMetadataDescriptorHandleTag handle_tag, MXFMetadataDescriptorReset reset);
gboolean mxf_metadata_generic_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
void mxf_metadata_generic_descriptor_reset (MXFMetadataGenericDescriptor *descriptor); void mxf_metadata_generic_descriptor_reset (MXFMetadataGenericDescriptor *descriptor);
gboolean mxf_metadata_file_descriptor_parse (const MXFUL *key, MXFMetadataFileDescriptor *descriptor, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_file_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
void mxf_metadata_file_descriptor_reset (MXFMetadataFileDescriptor *descriptor); void mxf_metadata_file_descriptor_reset (MXFMetadataFileDescriptor *descriptor);
gboolean mxf_metadata_generic_sound_essence_descriptor_parse (const MXFUL *key, MXFMetadataGenericSoundEssenceDescriptor *descriptor, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_generic_sound_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
void mxf_metadata_generic_sound_essence_descriptor_reset (MXFMetadataGenericSoundEssenceDescriptor *descriptor); void mxf_metadata_generic_sound_essence_descriptor_reset (MXFMetadataGenericSoundEssenceDescriptor *descriptor);
gboolean mxf_metadata_generic_picture_essence_descriptor_parse (const MXFUL *key, MXFMetadataGenericPictureEssenceDescriptor *descriptor, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_generic_picture_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
void mxf_metadata_generic_picture_essence_descriptor_reset (MXFMetadataGenericPictureEssenceDescriptor *descriptor); void mxf_metadata_generic_picture_essence_descriptor_reset (MXFMetadataGenericPictureEssenceDescriptor *descriptor);
gboolean mxf_metadata_cdci_picture_essence_descriptor_parse (const MXFUL *key, MXFMetadataCDCIPictureEssenceDescriptor *descriptor, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_cdci_picture_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
void mxf_metadata_cdci_picture_essence_descriptor_reset (MXFMetadataCDCIPictureEssenceDescriptor *descriptor); void mxf_metadata_cdci_picture_essence_descriptor_reset (MXFMetadataCDCIPictureEssenceDescriptor *descriptor);
gboolean mxf_metadata_multiple_descriptor_parse (const MXFUL *key, MXFMetadataMultipleDescriptor *descriptor, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_multiple_descriptor_handle_tag (MXFMetadataGenericDescriptor *descriptor,
const MXFPrimerPack *primer, guint16 tag, const guint8 *tag_data, guint16 tag_size);
void mxf_metadata_multiple_descriptor_reset (MXFMetadataMultipleDescriptor *descriptor); void mxf_metadata_multiple_descriptor_reset (MXFMetadataMultipleDescriptor *descriptor);
gboolean mxf_metadata_locator_parse (const MXFUL *key, MXFMetadataLocator *locator, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size); gboolean mxf_metadata_locator_parse (const MXFUL *key, MXFMetadataLocator *locator, const MXFPrimerPack *primer, guint16 type, const guint8 *data, guint size);