diff options
author | wm4 <nfxjfg@googlemail.com> | 2017-10-03 16:04:45 +0300 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2017-11-11 00:48:34 +0300 |
commit | ae5046e492cd87233111e994ca4ae3d74a233b51 (patch) | |
tree | 7858bdb33d3fe30a13821553d51874376c263726 /libavcodec/internal.h | |
parent | 5593049466bcd1d3f1ddbfe580be4f36123d7c3d (diff) |
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.
Diffstat (limited to 'libavcodec/internal.h')
-rw-r--r-- | libavcodec/internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 7748f09f54..948d5461c1 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -69,6 +69,11 @@ */ #define FF_CODEC_CAP_SLICE_THREAD_HAS_MF (1 << 5) +/** + * Allow only AVHWAccels which have a matching decoder_class field. + */ +#define FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS (1 << 6) + #ifdef TRACE # define ff_tlog(ctx, ...) av_log(ctx, AV_LOG_TRACE, __VA_ARGS__) #else |