vaapipostproc: don't do any color conversion when GL_TEXTURE_UPLOAD
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Thu, 2 May 2019 14:00:57 +0000 (16:00 +0200)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Thu, 2 May 2019 14:47:28 +0000 (16:47 +0200)
commit838045b9e2d3b14e4dc95270ba8e86025f5cf3f9
treed925c8db4e179a38b42ecc12ca3c422675e186c2
parentaa37f31d54599ab23b2851bfe594edcc0964ea19
vaapipostproc: don't do any color conversion when GL_TEXTURE_UPLOAD

https://bugzilla.gnome.org/show_bug.cgi?id=748184 has resurrected
with commit 3e992d8a

Since gst_vaapi_find_preferred_caps_feature() returns a color format
from caps negotiation, different from the default one (NV12), the
postproc enables the color transformation. But when GL_TEXTURE_UPLOAD
feature is negotiated, no color transformation shall be done.

Nonetheless, with commit 3e992d8a the requested format changes
firstly, because there's no video sink yet, so ANY caps are
negotiated; but later, when there's a video sink and a caps
renegotiation, the GL_TEXTURE_UPLOAD is negotiated though the color
format conversion still ongoing. It is required to reset that
conversion.

This patch force default color format when GL_TEXTURE_UPLOAD is
selected as preferred, thus avoiding the color conversion.

Fixes: #157
gst/vaapi/gstvaapipostprocutil.c