gstreamer/subprojects/gst-plugins-bad/sys/va
Víctor Manuel Jáquez Leal 301e281777 vabasedec: refactor format and capsfeature selection
This is a simplification of the venerable
gst_va_base_dec_get_preferred_format_and_caps_features() function, which
predates since gstreamer-vaapi. It's used to select the format and the
capsfeature to use when setting the output state. It was complex and hard to
follow. This refactor simplifies a lot the algorithm.

The first thing to remove _downstream_has_video_meta() since, most of the time
it will be called before the caps negotiation, and allocation queries make sense
only after caps negotiation. It might work during renegotiation but, in that
case, caps feature change is uncommon. Better a simple and common approach.

Also, for performance, instead of dealing with caps features as strings, GQuarks
are used.

The refactor works like this:

1. If peer pad returns any caps, the returned caps feature is system memory and
   looks for a proper format in the allowed caps.

2. The allowed caps are traversed at most 3 times: one per each valid caps
   feature. First VAMemory, later DMABuf, and last system memory. The first to
   match in allowed caps is picked, and the first format matching with the
   chroma is picked too.

Notice that, right now, using playbin videoconvert never return any.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6154>
2024-02-22 20:59:13 +00:00
..
gstjpegdecoder.c
gstjpegdecoder.h
gstvaav1dec.c va: no need to provide a buffer size for VA pool 2023-12-14 12:50:32 +00:00
gstvaav1dec.h
gstvaav1enc.c va: Implement the vaav1enc plugin 2024-01-30 08:24:26 +00:00
gstvaav1enc.h va: Implement the vaav1enc plugin 2024-01-30 08:24:26 +00:00
gstvabase.c va: use GstVideoInfoDmaDrm when importing buffers 2023-11-09 17:36:06 +00:00
gstvabase.h va: use GstVideoInfoDmaDrm when importing buffers 2023-11-09 17:36:06 +00:00
gstvabasedec.c vabasedec: refactor format and capsfeature selection 2024-02-22 20:59:13 +00:00
gstvabasedec.h va: Apply the new DMA format:modifier pair negotiation in decoder 2023-08-07 22:49:26 +00:00
gstvabaseenc.c va: baseenc: Fix the wrong parameter order to call va_map_buffer() 2024-01-30 15:50:23 +00:00
gstvabaseenc.h va: baseenc: Extend the create_output_buffer() to accept prefix data 2024-01-30 08:24:25 +00:00
gstvabasetransform.c vabasetransform: clean up decide_allocation() vmethod 2023-12-14 12:50:32 +00:00
gstvabasetransform.h va: use GstVideoInfoDmaDrm when importing buffers 2023-11-09 17:36:06 +00:00
gstvacaps.c va: Add the entrypoint parameter to gst_va_profile_caps() 2023-12-12 20:41:54 +08:00
gstvacaps.h va: Improve the template caps for DMA, use new drm-format kind caps 2023-08-07 22:49:26 +00:00
gstvacompositor.c vacompositor: consider the DMA kind input for sink pad 2023-12-16 10:56:09 +00:00
gstvacompositor.h
gstvadecoder.c va: Fix in error logs functions mismatches 2023-08-24 17:54:32 +00:00
gstvadecoder.h vadecoder: remove display reference in decode picture 2023-03-24 14:05:15 +00:00
gstvadeinterlace.c
gstvadeinterlace.h
gstvadevice.h
gstvadevice_linux.c va: No need to sort the device after registered 2023-05-16 08:37:48 +00:00
gstvadevice_win32.cpp
gstvadisplay_priv.c va: Fix in error logs functions mismatches 2023-08-24 17:54:32 +00:00
gstvadisplay_priv.h
gstvaencoder.c va: no need to provide a buffer size for VA pool 2023-12-14 12:50:32 +00:00
gstvaencoder.h vaencoder: remove display reference in decode picture 2023-03-24 14:05:15 +00:00
gstvafilter.c va: Improve the template caps for DMA, use new drm-format kind caps 2023-08-07 22:49:26 +00:00
gstvafilter.h
gstvah264dec.c h264decoder: Port to GstCodecPicture struct 2023-09-08 11:51:23 +00:00
gstvah264dec.h
gstvah264enc.c va: baseenc: Extend the create_output_buffer() to accept prefix data 2024-01-30 08:24:25 +00:00
gstvah264enc.h
gstvah265dec.c va: h265dec: Add support for more -still and -intra profiles 2023-12-12 21:30:16 +08:00
gstvah265dec.h
gstvah265enc.c va: baseenc: Extend the create_output_buffer() to accept prefix data 2024-01-30 08:24:25 +00:00
gstvah265enc.h
gstvajpegdec.c vajpegdec: only support progressive mjpeg streams 2023-12-22 04:38:06 +00:00
gstvajpegdec.h
gstvampeg2dec.c mpeg2decoder: Port to GstCodecPicture struct 2023-09-08 11:51:23 +00:00
gstvampeg2dec.h
gstvapluginutils.c vapluginsutils: add helper gst_va_create_other_pool() 2023-12-14 12:50:32 +00:00
gstvapluginutils.h vapluginsutils: add helper gst_va_create_other_pool() 2023-12-14 12:50:32 +00:00
gstvaprofile.c va: Add decoder compatible caps string field into profiles' map 2023-12-12 21:30:08 +08:00
gstvaprofile.h va: Add the entrypoint parameter to gst_va_profile_caps() 2023-12-12 20:41:54 +08:00
gstvavp8dec.c vp8decoder: Port to GstCodecPicture struct 2023-09-08 11:51:23 +00:00
gstvavp8dec.h
gstvavp9dec.c vp9decoder: Port to GstCodecPicture struct 2023-09-08 11:51:23 +00:00
gstvavp9dec.h
gstvavpp.c va: Apply the new DMA format:modifier pair negotiation in vpp 2023-08-07 22:49:26 +00:00
gstvavpp.h
meson.build va: Implement the vaav1enc plugin 2024-01-30 08:24:26 +00:00
plugin.c va: Implement the vaav1enc plugin 2024-01-30 08:24:26 +00:00
vacompat.h