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
This commit is contained in:
Enrico Jorns 2015-01-28 12:07:58 +01:00 committed by Nicolas Dufresne
parent 3eeef5fa09
commit 5829f326b0

View file

@ -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;
}