diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-11-25 14:49:34 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-11-25 14:49:34 +0000 |
commit | 15afef86524b53f2c2d5f8f5966418e4ef8368d0 (patch) | |
tree | 69679c5d865cd8f759bda17a27d8cb34e5f380fc /gst/mxf/mxfparse.c | |
parent | 4f365b391e9ab1582c2374889f4255da61f8d330 (diff) | |
download | gst-plugins-bad-15afef86524b53f2c2d5f8f5966418e4ef8368d0.tar.gz gst-plugins-bad-15afef86524b53f2c2d5f8f5966418e4ef8368d0.tar.bz2 gst-plugins-bad-15afef86524b53f2c2d5f8f5966418e4ef8368d0.zip |
gst/mxf/: Set video dimensions and pixel aspect ratio on the caps.
Original commit message from CVS:
* gst/mxf/mxfmpeg.c: (mxf_mpeg_video_create_caps):
* gst/mxf/mxfparse.c:
(mxf_metadata_generic_picture_essence_descriptor_set_caps):
* gst/mxf/mxfparse.h:
Set video dimensions and pixel aspect ratio on the caps.
Diffstat (limited to 'gst/mxf/mxfparse.c')
-rw-r--r-- | gst/mxf/mxfparse.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/gst/mxf/mxfparse.c b/gst/mxf/mxfparse.c index 0f5323e7..efe102b5 100644 --- a/gst/mxf/mxfparse.c +++ b/gst/mxf/mxfparse.c @@ -2278,11 +2278,38 @@ void mxf_metadata_generic_picture_essence_descriptor_reset memset (descriptor, 0, sizeof (MXFMetadataGenericPictureEssenceDescriptor)); } +void mxf_metadata_generic_picture_essence_descriptor_set_caps + (MXFMetadataGenericPictureEssenceDescriptor * descriptor, GstCaps * caps) +{ + guint par_n, par_d; + guint width, height; + + g_return_if_fail (descriptor != NULL); + g_return_if_fail (GST_IS_CAPS (caps)); + + width = descriptor->stored_width; + height = descriptor->stored_height; + + if (width == 0 || height == 0) + return; + + gst_caps_set_simple (caps, "width", G_TYPE_INT, width, "height", G_TYPE_INT, + height, NULL); + + if (descriptor->aspect_ratio.n == 0 || descriptor->aspect_ratio.d == 0) + return; + + par_n = height * descriptor->aspect_ratio.n; + par_d = width * descriptor->aspect_ratio.d; + + gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION, + par_n, par_d, NULL); +} + gboolean mxf_metadata_cdci_picture_essence_descriptor_handle_tag (MXFMetadataGenericDescriptor * d, const MXFPrimerPack * primer, - guint16 tag, const guint8 * tag_data, guint16 tag_size) -{ + guint16 tag, const guint8 * tag_data, guint16 tag_size) { MXFMetadataCDCIPictureEssenceDescriptor *descriptor = (MXFMetadataCDCIPictureEssenceDescriptor *) d; gboolean ret = FALSE; |