[Pkg-gstreamer-commits] [gstreamer-vaapi] 51/176: decoder: h264: add support for constrained baseline profile.

Vincent Cheng vcheng at moszumanska.debian.org
Tue Jun 3 08:09:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

vcheng pushed a commit to branch upstream
in repository gstreamer-vaapi.

commit 009e4522bf798d187d4f1b931873ddcfb710e6db
Author: Wind Yuan <feng.yuan at intel.com>
Date:   Fri Dec 6 15:08:26 2013 +0800

    decoder: h264: add support for constrained baseline profile.
    
    Recognize streams marked as conforming to the "Constrained Baseline
    Profile". If VA driver supports that as is, fine. Otherwise, fallback
    to baseline, main or high profile.
    
    Constrained Baseline Profile conveys coding tools that are common
    to baseline profile and main profile.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719947
    
    [Added fallbacks to main and high profiles]
    Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
 gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 9 ++++++++-
 gst-libs/gst/vaapi/gstvaapiprofile.c      | 6 ++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
index 559cd38..4fa8e50 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
@@ -757,15 +757,22 @@ get_profile(GstVaapiDecoderH264 *decoder, GstH264SPS *sps)
 {
     GstVaapiDecoderH264Private * const priv = &decoder->priv;
     GstVaapiDisplay * const display = GST_VAAPI_DECODER_DISPLAY(decoder);
-    GstVaapiProfile profile, profiles[2];
+    GstVaapiProfile profile, profiles[4];
     guint i, n_profiles = 0;
 
     profile = gst_vaapi_utils_h264_get_profile(sps->profile_idc);
     if (!profile)
         return GST_VAAPI_PROFILE_UNKNOWN;
 
+    if (sps->constraint_set1_flag && profile == GST_VAAPI_PROFILE_H264_BASELINE)
+        profile = GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE;
+
     profiles[n_profiles++] = profile;
     switch (profile) {
+    case GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE:
+        profiles[n_profiles++] = GST_VAAPI_PROFILE_H264_BASELINE;
+        profiles[n_profiles++] = GST_VAAPI_PROFILE_H264_MAIN;
+        // fall-through
     case GST_VAAPI_PROFILE_H264_MAIN:
         profiles[n_profiles++] = GST_VAAPI_PROFILE_H264_HIGH;
         break;
diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.c b/gst-libs/gst/vaapi/gstvaapiprofile.c
index 91c9fbd..b29c199 100644
--- a/gst-libs/gst/vaapi/gstvaapiprofile.c
+++ b/gst-libs/gst/vaapi/gstvaapiprofile.c
@@ -176,7 +176,7 @@ static GstVaapiProfile
 gst_vaapi_profile_from_codec_data_h264(GstBuffer *buffer)
 {
     /* MPEG-4 Part 15: Advanced Video Coding (AVC) file format */
-    guchar buf[2];
+    guchar buf[3];
 
     if (gst_buffer_extract(buffer, 0, buf, sizeof(buf)) != sizeof(buf))
         return 0;
@@ -185,7 +185,9 @@ gst_vaapi_profile_from_codec_data_h264(GstBuffer *buffer)
         return 0;
 
     switch (buf[1]) {   /* AVCProfileIndication */
-    case 66:    return GST_VAAPI_PROFILE_H264_BASELINE;
+    case 66:    return ((buf[2] & 0x40) ?
+                        GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE :
+                        GST_VAAPI_PROFILE_H264_BASELINE);
     case 77:    return GST_VAAPI_PROFILE_H264_MAIN;
     case 100:   return GST_VAAPI_PROFILE_H264_HIGH;
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gstreamer/gstreamer-vaapi.git



More information about the Pkg-gstreamer-commits mailing list