mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-16 03:50:05 +01:00
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.
This commit is contained in:
@@ -3532,6 +3532,13 @@ typedef struct AVHWAccel {
|
||||
* Internal hwaccel capabilities.
|
||||
*/
|
||||
int caps_internal;
|
||||
|
||||
/**
|
||||
* Some hwaccels are ambiguous if only the id and pix_fmt fields are used.
|
||||
* If non-NULL, the associated AVCodec must have
|
||||
* FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS set.
|
||||
*/
|
||||
const AVClass *decoder_class;
|
||||
} AVHWAccel;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user