mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
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:
parent
bde3b072da
commit
d9b09b623e
1 changed files with 4 additions and 11 deletions
|
@ -1123,19 +1123,12 @@ gst_vaapipostproc_fixate_srccaps (GstVaapiPostproc * postproc,
|
||||||
find_best_size (postproc, &vi, &width, &height);
|
find_best_size (postproc, &vi, &width, &height);
|
||||||
|
|
||||||
// Update format from user-specified parameters
|
// 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);
|
srcpad = GST_BASE_TRANSFORM_SRC_PAD (postproc);
|
||||||
feature = gst_vaapi_find_preferred_caps_feature (srcpad, srccaps,
|
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)
|
if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue