mpv/video/out/hwdec
Philip Langdale 19ea8b31bd hwtransfer: use the right hardware config to find conversion targets
The last piece in the puzzle for doing hardware conversions
automatically is ensuring we only consider valid target formats for the
conversion. Although it is unintuitive, some vaapi drivers can expose a
different set of formats for uploads vs for conversions, and that is
the case on the Intel hardware I have here.

Before this change, we would use the upload target list, and our
selection algorithm would pick a format that doesn't work for
conversions, causing everything to fail. Whoops.

Successfully obtaining the conversion target format list is a bit of a
convoluted process, with only parts of it encapsulated by ffmpeg.
Specifically, ffmpeg understands the concept of hardware configurations
that can affect the constraints of a device, but does not define what
configurations are - that is left up to the specific hwdevice type.

In the case of vaapi, we need to create a config for the video
processing endpoint, and use that when querying for constraints.

I decided to encapsulate creation of the config as part of the hwdec
init process, so that the constraint query can be down in the
hwtransfer code in an opaque way. I don't know if any other hardware
will need this capability, but if so, we'll be able to account for it.

Then, when we look at probing, instead of checking for what formats
are supported for transfers, we use the results of the constraint query
with the conversion config. And as that config doesn't depend on the
source format, we only need to do it once.
2023-08-26 10:07:55 -07:00
..
dmabuf_interop.h
dmabuf_interop_gl.c
dmabuf_interop_pl.c
dmabuf_interop_wl.c hwtransfer: use the right hardware config to find conversion targets 2023-08-26 10:07:55 -07:00
hwdec_aimagereader.c hwdec: do not add hwdec device if it failed to create 2023-06-26 19:07:29 +02:00
hwdec_cuda.c
hwdec_cuda.h
hwdec_cuda_gl.c
hwdec_cuda_vk.c hwdec_cuda: drop old PL_API_VER compatibility path 2023-08-18 16:39:57 +02:00
hwdec_drmprime.c
hwdec_drmprime_overlay.c hwdec: do not add hwdec device if it failed to create 2023-06-26 19:07:29 +02:00
hwdec_vaapi.c hwtransfer: use the right hardware config to find conversion targets 2023-08-26 10:07:55 -07:00
hwdec_vulkan.c hwdec_vulkan: respect probing flag when logging during init 2023-06-03 18:37:43 -07:00