Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
avcodec: allow multiple hwaccels for the same codec/pixfmt
Currently, AVHWAccels are looked up using a (codec_id, pixfmt) tuple. This means it's impossible to have 2 decoders for the same codec and using the same opaque hardware pixel format. This breaks merging Libav's CUVID hwaccel. FFmpeg has its own CUVID support, but it's a full stream decoder, using NVIDIA's codec parser. The Libav one is a true hwaccel, which is based on the builtin software decoders. Fix this by introducing another field to disambiguate AVHWAccels, and use it for our CUVID decoders. FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS makes this mechanism backwards compatible and optional.
- Loading branch information
Showing
with
22 additions
and 4 deletions.
- +7 −0 libavcodec/avcodec.h
- +2 −0 libavcodec/cuviddec.c
- +8 −4 libavcodec/decode.c
- +5 −0 libavcodec/internal.h