[FFmpeg-cvslog] vdpau: add mapping for H.264 Constrained Baseline profile and fallback

Rémi Denis-Courmont git at videolan.org
Sun Dec 14 22:32:58 CET 2014


ffmpeg | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Dec 13 18:42:21 2014 +0200| [559fa0d41b5cf8f7e1ba89d1ac70e74712eb2816] | committer: Anton Khirnov

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 at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=559fa0d41b5cf8f7e1ba89d1ac70e74712eb2816
---

 libavcodec/vdpau.c      |    9 +++++++++
 libavcodec/vdpau_h264.c |    4 ++++
 2 files changed, 13 insertions(+)

diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 1e891ed..ccb3352 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);
 
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
index d18a970..5ed1fff 100644
--- a/libavcodec/vdpau_h264.c
+++ b/libavcodec/vdpau_h264.c
@@ -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;



More information about the ffmpeg-cvslog mailing list