summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau.c
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2014-12-13 18:42:21 +0200
committerAnton Khirnov <anton@khirnov.net>2014-12-14 18:30:03 +0100
commit559fa0d41b5cf8f7e1ba89d1ac70e74712eb2816 (patch)
tree43914f7e57e25e6e785690bec737fbafd8062f8b /libavcodec/vdpau.c
parent8502c1e9ff9c1dbb6e467630c048d098f4064021 (diff)
vdpau: add mapping for H.264 Constrained Baseline profile and fallback
Old VDPAU drivers do not support this newly defined profile, so falling back to Main profile is necessary for backward binary compatibility. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/vdpau.c')
-rw-r--r--libavcodec/vdpau.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 1e891ed4ac..ccb3352028 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -125,6 +125,15 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
status = decoder_query_caps(vdctx->device, profile, &supported, &max_level,
&max_mb, &max_width, &max_height);
+#ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE
+ if (status != VDP_STATUS_OK && profile == VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE) {
+ /* Run-time backward compatibility for libvdpau 0.8 and earlier */
+ profile = VDP_DECODER_PROFILE_H264_MAIN;
+ status = decoder_query_caps(vdctx->device, profile, &supported,
+ &max_level, &max_mb,
+ &max_width, &max_height);
+ }
+#endif
if (status != VDP_STATUS_OK)
return vdpau_error(status);