summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau.c
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2014-10-14 12:59:54 +0300
committerAnton Khirnov <anton@khirnov.net>2014-10-15 06:21:56 +0000
commitd565fef1b83b6c5f8afb32229260b79f67c68109 (patch)
tree41e5ec95bdd57b55a43c4f73b2c2f2b4145e4f24 /libavcodec/vdpau.c
parentc1724623ce0433c6a9ee72133b1fd4db75ec7193 (diff)
vdpau: add AV_HWACCEL_FLAG_IGNORE_LEVEL to skip the codec level check
Decoding acceleration may work even if the codec level is higher than the stated limit of the VDPAU driver. Or the problem may be considered acceptable by the user. This flag allows skipping the codec level capability checks and proceed with decoding. Applications should obviously not set this flag by default, but only if the user explicitly requested this behavior (and presumably knows how to turn it back off if it fails). Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/vdpau.c')
-rw-r--r--libavcodec/vdpau.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 9805a8d0b1..1d68e70b47 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -94,7 +94,9 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
vdctx->device = hwctx->device;
vdctx->get_proc_address = hwctx->get_proc_address;
- if (level < 0)
+ if (hwctx->flags & AV_HWACCEL_FLAG_IGNORE_LEVEL)
+ level = 0;
+ else if (level < 0)
return AVERROR(ENOTSUP);
status = vdctx->get_proc_address(vdctx->device,
@@ -313,7 +315,7 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
{
VDPAUHWContext *hwctx;
- if (flags != 0)
+ if (flags & ~AV_HWACCEL_FLAG_IGNORE_LEVEL)
return AVERROR(EINVAL);
if (av_reallocp(&avctx->hwaccel_context, sizeof(*hwctx)))
@@ -325,6 +327,7 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
hwctx->context.decoder = VDP_INVALID_HANDLE;
hwctx->device = device;
hwctx->get_proc_address = get_proc;
+ hwctx->flags = flags;
hwctx->reset = 1;
return 0;
}