From d9b09b623ef04dbe5a171aa0bbfab12683fd93eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 5 May 2016 15:19:02 +0200 Subject: [PATCH] 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 --- gst/vaapi/gstvaapipostproc.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index bdb650df19..819b423fca 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -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;