Browse Source

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>
tags/n2.6
Rémi Denis-Courmont Anton Khirnov 11 years ago
parent
commit
559fa0d41b
2 changed files with 13 additions and 0 deletions
  1. +9
    -0
      libavcodec/vdpau.c
  2. +4
    -0
      libavcodec/vdpau_h264.c

+ 9
- 0
libavcodec/vdpau.c View File

@@ -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);



+ 4
- 0
libavcodec/vdpau_h264.c View File

@@ -213,6 +213,10 @@ static int vdpau_h264_init(AVCodecContext *avctx)
profile = VDP_DECODER_PROFILE_H264_BASELINE;
break;
case FF_PROFILE_H264_CONSTRAINED_BASELINE:
#ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE
profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE;
break;
#endif
case FF_PROFILE_H264_MAIN:
profile = VDP_DECODER_PROFILE_H264_MAIN;
break;


Loading…
Cancel
Save