summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciana Fujii Pontello <lucianafujii@collabora.co.uk>2011-11-16 20:55:08 -0500
committerLuciana Fujii Pontello <lucianafujii@collabora.co.uk>2011-11-16 20:55:08 -0500
commit49d5eb5ed735fa2b4d743db395813cec09a22858 (patch)
tree8b551ca9726bee9f5002237a446c791bc0e514eb
parent4070eb03c77dbec0bf7d6b6dff6e0ff253e9b820 (diff)
ducatividdec: propagate pixel-aspect-ratio in caps
Parse pixel-aspect-ratio in sink caps and set it on source caps.
-rw-r--r--src/gstducatividdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index d5c1c15..e5b125a 100644
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
@@ -527,6 +527,8 @@ gst_ducati_viddec_sink_setcaps (GstPad * pad, GstCaps * caps)
GstStructure *out_s;
gboolean interlaced = FALSE;
gint frn = 0, frd = 1;
+ gint par_width, par_height;
+ gboolean par_present;
s = gst_caps_get_structure (caps, 0);
if (!klass->parse_caps (self, s)) {
@@ -542,6 +544,8 @@ gst_ducati_viddec_sink_setcaps (GstPad * pad, GstCaps * caps)
gst_structure_get_fraction (s, "framerate", &frn, &frd);
gst_structure_get_boolean (s, "interlaced", &interlaced);
+ par_present = gst_structure_get_fraction (s, "pixel-aspect-ratio",
+ &par_width, &par_height);
outcaps = gst_pad_get_allowed_caps (self->srcpad);
if (outcaps) {
@@ -557,6 +561,9 @@ gst_ducati_viddec_sink_setcaps (GstPad * pad, GstCaps * caps)
"width", G_TYPE_INT, self->padded_width,
"height", G_TYPE_INT, self->padded_height,
"framerate", GST_TYPE_FRACTION, frn, frd, NULL);
+ if (par_present)
+ gst_structure_set (out_s, "pixel-aspect-ratio", GST_TYPE_FRACTION,
+ par_width, par_height, NULL);
if (interlaced)
gst_structure_set (out_s, "interlaced", G_TYPE_BOOLEAN, TRUE, NULL);