add dav1d DXVA decoder support
Compare changes
Since we can't have dav1d and FFmpeg DXVA support at the same time, and the AV1 software decoder in FFmpeg is much slower than dav1d we don't want to use that. So until FFmpeg can fallback to hardware decoders when using dav1d we need proper hardware support directly in dav1d.
I proposed an API to add some callback support in dav1d. It has a good chance of being merged. I only tested with DXVA which is a low level decoder. I would still like to test much higher level decoders to make sure it works, or maybe rely on the packetizer to handle sequence changes (should not happen within MP4 or Matroska/WebM) to do the switch to pure hardware decoders.
The proposed API is also necessary if FFmpeg even wants to use their DXVA code at the same time as dav1d as well.
Only 1 frame delay works with the current code. I'm not sure it will ever work with more than that. However it uses the usual amount of threads we use with dav1d so we don't have to check the hardware first and never allow fallback to software decoding.
v5:
max_delay_frame
might be forced to 1 (at least with DXVA). It's still possible to use only the software decoder with -no-hw-dec
or if the GPU can't decode AV1 (likely for most people)v6:
hw_module
v7: fix early hw_current_output
initialization
v8: !1705 (diffs, comment 319329)
v9:
video_format_t
from the HW module so it can set the proper width/height and possibly other thingsvlc_fourcc_t
anymore)AV1_get_frame_max_dimensions()
VideoLAN code repository instance