Merge commit '559fa0d41b5cf8f7e1ba89d1ac70e74712eb2816'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Dec 2014 21:22:19 +0000 (22:22 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Dec 2014 21:23:53 +0000 (22:23 +0100)
* commit '559fa0d41b5cf8f7e1ba89d1ac70e74712eb2816':
  vdpau: add mapping for H.264 Constrained Baseline profile and fallback

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vdpau.c
libavcodec/vdpau_h264.c

index 33be4be..ea239bb 100644 (file)
@@ -138,6 +138,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);
 
index d9a3a52..0b2c046 100644 (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;