mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
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.
This commit is contained in:
parent
8201937c54
commit
fff48b08f6
2 changed files with 19 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
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>
|
2008-12-04 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
* gst/mxf/Makefile.am:
|
* gst/mxf/Makefile.am:
|
||||||
|
|
|
@ -2610,8 +2610,8 @@ void mxf_metadata_generic_picture_essence_descriptor_reset
|
||||||
void mxf_metadata_generic_picture_essence_descriptor_set_caps
|
void mxf_metadata_generic_picture_essence_descriptor_set_caps
|
||||||
(MXFMetadataGenericPictureEssenceDescriptor * descriptor, GstCaps * caps)
|
(MXFMetadataGenericPictureEssenceDescriptor * descriptor, GstCaps * caps)
|
||||||
{
|
{
|
||||||
/*guint par_n, par_d;
|
guint par_n, par_d;
|
||||||
guint width, height; */
|
guint width, height;
|
||||||
MXFMetadataFileDescriptor *f = (MXFMetadataFileDescriptor *) descriptor;
|
MXFMetadataFileDescriptor *f = (MXFMetadataFileDescriptor *) descriptor;
|
||||||
|
|
||||||
g_return_if_fail (descriptor != NULL);
|
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,
|
gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, f->sample_rate.n,
|
||||||
f->sample_rate.d, NULL);
|
f->sample_rate.d, NULL);
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* FIXME: This sets wrong values for most (all?) files */
|
|
||||||
#if 0
|
|
||||||
width = descriptor->stored_width;
|
width = descriptor->stored_width;
|
||||||
height = descriptor->stored_height;
|
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)
|
if (width == 0 || height == 0)
|
||||||
return;
|
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)
|
if (descriptor->aspect_ratio.n == 0 || descriptor->aspect_ratio.d == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
par_n = height * descriptor->aspect_ratio.d;
|
par_n = height * descriptor->aspect_ratio.n;
|
||||||
par_d = width * descriptor->aspect_ratio.n;
|
par_d = width * descriptor->aspect_ratio.d;
|
||||||
|
|
||||||
gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
||||||
par_n, par_d, NULL);
|
par_n, par_d, NULL);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|
Loading…
Reference in a new issue