diff options
author | wm4 <nfxjfg@googlemail.com> | 2017-12-12 11:03:43 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2017-12-14 16:58:45 +0100 |
commit | 47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1 (patch) | |
tree | 9829aceb2ddae7c6f0b0742544626c11e8302848 /libavcodec/qsvdec_h2645.c | |
parent | 508378556631dc18d32247b4a4e35703758e1ca9 (diff) | |
download | ffmpeg-47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1.tar.gz |
avcodec: add metadata to identify wrappers and hardware decoders
Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.
Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.
AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.
Based on a patch by Philip Langdale <philipl@overt.org>.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/qsvdec_h2645.c')
-rw-r--r-- | libavcodec/qsvdec_h2645.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/qsvdec_h2645.c b/libavcodec/qsvdec_h2645.c index e3184d8749..03ba303c95 100644 --- a/libavcodec/qsvdec_h2645.c +++ b/libavcodec/qsvdec_h2645.c @@ -220,13 +220,14 @@ AVCodec ff_hevc_qsv_decoder = { .decode = qsv_decode_frame, .flush = qsv_decode_flush, .close = qsv_decode_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_HYBRID, .priv_class = &hevc_class, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_P010, AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }, .bsfs = "hevc_mp4toannexb", + .wrapper_name = "qsv", }; #endif @@ -262,12 +263,13 @@ AVCodec ff_h264_qsv_decoder = { .decode = qsv_decode_frame, .flush = qsv_decode_flush, .close = qsv_decode_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_HYBRID, .priv_class = &class, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_P010, AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }, .bsfs = "h264_mp4toannexb", + .wrapper_name = "qsv", }; #endif |