From 7b83a2201e6acd68842f6dfe4a59a7d6c2b090dc Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 25 Oct 2004 21:26:34 +0000 Subject: [PATCH] ext/ffmpeg/gstffmpegcolorspace.c: Backport changes from ffmpegcolorspace (gst-plugins) so we can then move the whole ... Original commit message from CVS: * ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link): Backport changes from ffmpegcolorspace (gst-plugins) so we can then move the whole of this plugin back and deprecate this (no, I'm not insane). --- ChangeLog | 7 +++++++ ext/ffmpeg/gstffmpegcolorspace.c | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index a9fddf2..8402aed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-10-25 Ronald S. Bultje + * ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link): + Backport changes from ffmpegcolorspace (gst-plugins) so we can + then move the whole of this plugin back and deprecate this (no, + I'm not insane). + +2004-10-25 Ronald S. Bultje + * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_with_codecid): * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_base_init), diff --git a/ext/ffmpeg/gstffmpegcolorspace.c b/ext/ffmpeg/gstffmpegcolorspace.c index 118ccdc..3c2f21d 100644 --- a/ext/ffmpeg/gstffmpegcolorspace.c +++ b/ext/ffmpeg/gstffmpegcolorspace.c @@ -176,15 +176,20 @@ gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps) GstPadLinkReturn ret; int height, width; double framerate; + const GValue *par = NULL; space = GST_FFMPEGCSP (gst_pad_get_parent (pad)); + GST_DEBUG_OBJECT (space, "pad_link on %s:%s with caps %" GST_PTR_FORMAT, + GST_DEBUG_PAD_NAME (pad), caps); + otherpad = (pad == space->srcpad) ? space->sinkpad : space->srcpad; structure = gst_caps_get_structure (caps, 0); gst_structure_get_int (structure, "width", &width); gst_structure_get_int (structure, "height", &height); gst_structure_get_double (structure, "framerate", &framerate); + par = gst_structure_get_value (structure, "pixel-aspect-ratio"); /* FIXME attempt and/or check for passthru */ @@ -218,6 +223,12 @@ gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps) "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, framerate, NULL); + if (par) { + gst_caps_set_simple (caps, + "pixel-aspect-ratio", GST_TYPE_FRACTION, + gst_value_get_fraction_numerator (par), + gst_value_get_fraction_denominator (par), NULL); + } ret = gst_pad_try_set_caps (otherpad, caps); if (GST_PAD_LINK_FAILED (ret)) { return ret; -- 2.7.4