vaapidecode: expose raw src caps with same chroma
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 12 Aug 2020 15:50:50 +0000 (17:50 +0200)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 12 Aug 2020 15:50:50 +0000 (17:50 +0200)
commita50b466fc72d69146c7009b9ed1d931a66e1014b
tree542547379a7e1878a6bb96cc41352a4182803d8c
parent30290115affc43078b2844cfd165d464bbcc335e
vaapidecode: expose raw src caps with same chroma

The try-and-error approach for getting the possible image formats from
a surface has brought several problems in different drivers, from
crashes to drop in performance.

Instead of that we change the algorithm to determine the possible
image formats based in the surface chroma: only those available image
formats with same chroma are exposed as possible raw caps.

Do this is important to avoid performance degrading in raw sinks
which doesn't handle NV12 but it does YV12 or I420.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/381>
gst/vaapi/gstvaapidecode.c