diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-12-04 08:50:48 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-12-04 08:50:48 +0000 |
commit | fff48b08f6ea7629279797013f9fce2196882523 (patch) | |
tree | 3e26f8073e82cc7732a505bf43e099ddebdf4bde | |
parent | 8201937c549034dc26dc289295a4ca0dfdceeb32 (diff) | |
download | gst-plugins-bad-fff48b08f6ea7629279797013f9fce2196882523.tar.gz gst-plugins-bad-fff48b08f6ea7629279797013f9fce2196882523.tar.bz2 gst-plugins-bad-fff48b08f6ea7629279797013f9fce2196882523.zip |
gst/mxf/mxfparse.c: Fix setting of the height/width and PAR of video streams.
Original commit message from CVS:
* gst/mxf/mxfparse.c:
(mxf_metadata_generic_picture_essence_descriptor_set_caps):
Fix setting of the height/width and PAR of video streams.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gst/mxf/mxfparse.c | 22 |
2 files changed, 19 insertions, 9 deletions
@@ -1,5 +1,11 @@ 2008-12-04 Sebastian Dröge <sebastian.droege@collabora.co.uk> + * gst/mxf/mxfparse.c: + (mxf_metadata_generic_picture_essence_descriptor_set_caps): + Fix setting of the height/width and PAR of video streams. + +2008-12-04 Sebastian Dröge <sebastian.droege@collabora.co.uk> + * gst/mxf/Makefile.am: * gst/mxf/mxfd10.c: (mxf_is_d10_essence_track), (mxf_d10_picture_handle_essence_element), diff --git a/gst/mxf/mxfparse.c b/gst/mxf/mxfparse.c index b1a87e04..53726b6b 100644 --- a/gst/mxf/mxfparse.c +++ b/gst/mxf/mxfparse.c @@ -2610,8 +2610,8 @@ void mxf_metadata_generic_picture_essence_descriptor_reset void mxf_metadata_generic_picture_essence_descriptor_set_caps (MXFMetadataGenericPictureEssenceDescriptor * descriptor, GstCaps * caps) { - /*guint par_n, par_d; - guint width, height; */ + guint par_n, par_d; + guint width, height; MXFMetadataFileDescriptor *f = (MXFMetadataFileDescriptor *) descriptor; g_return_if_fail (descriptor != NULL); @@ -2620,13 +2620,18 @@ void mxf_metadata_generic_picture_essence_descriptor_set_caps gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, f->sample_rate.n, f->sample_rate.d, NULL); - return; - -/* FIXME: This sets wrong values for most (all?) files */ -#if 0 width = descriptor->stored_width; height = descriptor->stored_height; + /* If the video is stored as separate fields the + * height is only the height of one field, i.e. + * half the height of the frame. + * + * See SMPTE 377M E2.2 and E1.2 + */ + if (descriptor->frame_layout == 1 || descriptor->frame_layout == 2) + height *= 2; + if (width == 0 || height == 0) return; @@ -2636,12 +2641,11 @@ void mxf_metadata_generic_picture_essence_descriptor_set_caps if (descriptor->aspect_ratio.n == 0 || descriptor->aspect_ratio.d == 0) return; - par_n = height * descriptor->aspect_ratio.d; - par_d = width * descriptor->aspect_ratio.n; + 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); -#endif } gboolean |