gstreamer/gst
Víctor Manuel Jáquez Leal 634fefab5d vaapidecode: build allowed srcpad caps from va context
Instead of generating allowed srcpad caps with generic information,
now it takes the size an formats limits from the decoder's context.

This is possible since srcpad caps are generated after the internal
decoder is created.

The patch replaces gst_vaapi_decoder_get_surface_formats() with
gst_vaapi_decoder_get_suface_attributes().

From these attributes, formats are only used for VASurface memory
caps feature. For system memory caps feature, the old
gst_vaapi_plugin_get_allowed_srcpad_caps() is still used, since
i965 jpeg decoder cannot deliver mappable format for gstreamer.
And for the other caps features (dmabuf and texture upload) the
same static list are used.

This patch also adds DMABuf caps feature only if the context
supports that memory type. Nonetheless, we keep the pre-defined
formats since they are the subset of common derive formats formats
supported either by amd/gallium and both intel drivers, since,
when exporting the fd through vaAcquireBufferHandle()/
vaReleaseBufferHandle(), the formats of the derivable image cannot
be retriebable from the driver. Later we'll use the attribute
formats for the DMABuf feature too, when the code be ported to
vaExportSurfaceHandle().

Finally, the allowed srcpad caps are removed if the internal decoder
is destroyed, since context attribues will change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/366>
2020-07-27 19:32:00 +02:00
..
vaapi vaapidecode: build allowed srcpad caps from va context 2020-07-27 19:32:00 +02:00
meson.build vaapi: add meson build 2017-02-09 11:27:44 +01:00