summaryrefslogtreecommitdiffstats
path: root/gst/mxf/mxfparse.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-12-07 17:16:29 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-12-07 17:16:29 +0000
commitabcc8554971b964ee697a158043afe213798af71 (patch)
tree3590a99ce896693c09e5be278cfb62ef8af3dca7 /gst/mxf/mxfparse.c
parente3f042b99e9a039b9981a4b875f9c6aa59ef4a76 (diff)
downloadgst-plugins-bad-abcc8554971b964ee697a158043afe213798af71.tar.gz
gst-plugins-bad-abcc8554971b964ee697a158043afe213798af71.tar.bz2
gst-plugins-bad-abcc8554971b964ee697a158043afe213798af71.zip
gst/mxf/: Add initial support for uncompressed video essence (SMPTE S384M).
Original commit message from CVS: * gst/mxf/Makefile.am: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams): * gst/mxf/mxftypes.h: * gst/mxf/mxfup.c: (mxf_is_up_essence_track), (mxf_up_handle_essence_element), (mxf_up_rgba_create_caps), (mxf_up_create_caps): * gst/mxf/mxfup.h: Add initial support for uncompressed video essence (SMPTE S384M). * gst/mxf/mxfparse.c: (mxf_metadata_rgba_picture_essence_descriptor_handle_tag), (mxf_metadata_rgba_picture_essence_descriptor_reset): Fix parsing of the RGBA descriptor and add support for parsing the pixel layout.
Diffstat (limited to 'gst/mxf/mxfparse.c')
-rw-r--r--gst/mxf/mxfparse.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/gst/mxf/mxfparse.c b/gst/mxf/mxfparse.c
index 212c6942..e2ff891e 100644
--- a/gst/mxf/mxfparse.c
+++ b/gst/mxf/mxfparse.c
@@ -2774,36 +2774,70 @@ gboolean
goto error;
descriptor->component_max_ref = GST_READ_UINT32_BE (tag_data);
GST_DEBUG (" component max ref = %u", descriptor->component_max_ref);
+ ret = TRUE;
break;
case 0x3407:
if (tag_size != 4)
goto error;
descriptor->component_min_ref = GST_READ_UINT32_BE (tag_data);
GST_DEBUG (" component min ref = %u", descriptor->component_min_ref);
+ ret = TRUE;
break;
case 0x3408:
if (tag_size != 4)
goto error;
descriptor->alpha_max_ref = GST_READ_UINT32_BE (tag_data);
GST_DEBUG (" alpha max ref = %u", descriptor->alpha_max_ref);
+ ret = TRUE;
break;
case 0x3409:
if (tag_size != 4)
goto error;
descriptor->alpha_min_ref = GST_READ_UINT32_BE (tag_data);
GST_DEBUG (" alpha min ref = %u", descriptor->alpha_min_ref);
+ ret = TRUE;
break;
case 0x3405:
if (tag_size != 1)
goto error;
descriptor->scanning_direction = GST_READ_UINT8 (tag_data);
GST_DEBUG (" scanning direction = %u", descriptor->scanning_direction);
+ ret = TRUE;
break;
- case 0x3401:
+ case 0x3401:{
+ guint i, len;
+
+ if (tag_size % 2 != 0)
+ goto error;
+
+ i = 0;
+ while (tag_data[i] != 0 && tag_data[i + 1] != 0 && i + 2 <= tag_size)
+ i += 2;
+ len = i / 2;
+
+ descriptor->n_pixel_layout = len;
+ GST_DEBUG (" number of pixel layouts = %u", len);
+ if (len == 0)
+ return TRUE;
+
+ descriptor->pixel_layout = g_malloc0 (2 * len);
+
+ for (i = 0; i < len; i++) {
+ descriptor->pixel_layout[2 * i] = tag_data[2 * i];
+ descriptor->pixel_layout[2 * i + 1] = tag_data[2 * i + 1];
+ GST_DEBUG (" pixel layout %u = %c : %u", i,
+ (gchar) descriptor->pixel_layout[2 * i],
+ descriptor->pixel_layout[2 * i + 1]);
+ }
+
+ ret = TRUE;
+ break;
+ }
case 0x3403:
case 0x3404:
/* TODO: handle this */
GST_WARNING (" tag 0x%04x not implemented yet", tag);
+ ret = TRUE;
break;
default:
ret =
@@ -2829,6 +2863,8 @@ void mxf_metadata_rgba_picture_essence_descriptor_reset
mxf_metadata_generic_picture_essence_descriptor_reset (
(MXFMetadataGenericPictureEssenceDescriptor *) descriptor);
+ g_free (descriptor->pixel_layout);
+
MXF_METADATA_DESCRIPTOR_CLEAR (descriptor,
MXFMetadataRGBAPictureEssenceDescriptor,
MXFMetadataGenericPictureEssenceDescriptor);