From 5829f326b07a5bc011e25a6bffc6665947efd249 Mon Sep 17 00:00:00 2001 From: Enrico Jorns Date: Wed, 28 Jan 2015 12:07:58 +0100 Subject: [PATCH] gstv4l2transform: format fixation for preferring passthrough * If outgoing format is unfixated, try to set it to input format. * Call gst_caps_fixate () at end of fixation routine https://bugzilla.gnome.org/show_bug.cgi?id=766719 --- sys/v4l2/gstv4l2transform.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/v4l2/gstv4l2transform.c b/sys/v4l2/gstv4l2transform.c index 2e29f10076..f9a1d920ec 100644 --- a/sys/v4l2/gstv4l2transform.c +++ b/sys/v4l2/gstv4l2transform.c @@ -428,6 +428,17 @@ gst_v4l2_transform_fixate_caps (GstBaseTransform * trans, ins = gst_caps_get_structure (caps, 0); outs = gst_caps_get_structure (othercaps, 0); + { + const gchar *in_format; + + in_format = gst_structure_get_string (ins, "format"); + if (in_format) { + /* Try to set output format for pass through */ + gst_structure_fixate_field_string (outs, "format", in_format); + } + + } + from_par = gst_structure_get_value (ins, "pixel-aspect-ratio"); to_par = gst_structure_get_value (outs, "pixel-aspect-ratio"); @@ -847,6 +858,9 @@ done: if (to_par == &tpar) g_value_unset (&tpar); + /* fixate remaining fields */ + othercaps = gst_caps_fixate (othercaps); + return othercaps; }