vaapipostproc: simplify code

Change a convoluted snippet to find the preferred color format in the peer
caps.

https://bugzilla.gnome.org/show_bug.cgi?id=758548
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-05-05 15:19:02 +02:00
parent bde3b072da
commit d9b09b623e

View file

@ -1123,19 +1123,12 @@ gst_vaapipostproc_fixate_srccaps (GstVaapiPostproc * postproc,
find_best_size (postproc, &vi, &width, &height);
// Update format from user-specified parameters
/* XXX: this is a workaround until auto-plugging is fixed when
* format=ENCODED + memory:VASurface caps feature are provided.
* use the downstream negotiated video format as the output format
* if the user didn't explicitly ask for colorspace conversion.
* Use a filter caps which contain all raw video formats, (excluding
* GST_VIDEO_FORMAT_ENCODED) */
out_format = GST_VIDEO_FORMAT_UNKNOWN;
if (postproc->format != DEFAULT_FORMAT)
out_format = postproc->format;
srcpad = GST_BASE_TRANSFORM_SRC_PAD (postproc);
feature = gst_vaapi_find_preferred_caps_feature (srcpad, srccaps,
(out_format == GST_VIDEO_FORMAT_UNKNOWN) ? &out_format : NULL);
&out_format);
if (postproc->format != DEFAULT_FORMAT)
out_format = postproc->format;
if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED)
return NULL;