[Pkg-gstreamer-commits] [gstreamer-vaapi] 173/176: build: fix for older versions of VA-API (< 0.34.0).

Vincent Cheng vcheng at moszumanska.debian.org
Tue Jun 3 08:09:38 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 614aa4ac95f6ddc5103ca4f6e2098b23cd9f8334
Author: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
Date:   Thu Jan 23 22:44:09 2014 +0100

    build: fix for older versions of VA-API (< 0.34.0).
    
    Fix build with older versions of VA-API (< 0.34.0), or versions without
    good enough headers for encoding support for instance.
---
 gst-libs/gst/vaapi/gstvaapicontext.c |  4 +++-
 gst-libs/gst/vaapi/gstvaapiutils.c   | 12 ++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/gst-libs/gst/vaapi/gstvaapicontext.c b/gst-libs/gst/vaapi/gstvaapicontext.c
index 236f891..b306a6f 100644
--- a/gst-libs/gst/vaapi/gstvaapicontext.c
+++ b/gst-libs/gst/vaapi/gstvaapicontext.c
@@ -152,7 +152,6 @@ context_create (GstVaapiContext * context)
 {
   const GstVaapiContextInfo *const cip = &context->info;
   GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (context);
-  guint va_rate_control;
   VAConfigAttrib attribs[3], *attrib = attribs;
   VAContextID context_id;
   VASurfaceID surface_id;
@@ -196,9 +195,11 @@ context_create (GstVaapiContext * context)
   attrib++;
 
   switch (cip->usage) {
+#if USE_ENCODERS
     case GST_VAAPI_CONTEXT_USAGE_ENCODE:
     {
       const GstVaapiConfigInfoEncoder *const config = &cip->config.encoder;
+      guint va_rate_control;
 
       /* Rate control */
       attrib->type = VAConfigAttribRateControl;
@@ -230,6 +231,7 @@ context_create (GstVaapiContext * context)
       }
       break;
     }
+#endif
     default:
       break;
   }
diff --git a/gst-libs/gst/vaapi/gstvaapiutils.c b/gst-libs/gst/vaapi/gstvaapiutils.c
index 10bc606..87923cc 100644
--- a/gst-libs/gst/vaapi/gstvaapiutils.c
+++ b/gst-libs/gst/vaapi/gstvaapiutils.c
@@ -214,16 +214,20 @@ string_of_VARateControl (guint rate_control)
   switch (rate_control) {
     case VA_RC_NONE:
       return "None";
+#ifdef VA_RC_CQP
     case VA_RC_CQP:
       return "CQP";
+#endif
     case VA_RC_CBR:
       return "CBR";
     case VA_RC_VCM:
       return "VCM";
     case VA_RC_VBR:
       return "VBR";
+#ifdef VA_RC_VBR_CONSTRAINED
     case VA_RC_VBR_CONSTRAINED:
       return "VBR-Constrained";
+#endif
     default:
       break;
   }
@@ -492,16 +496,20 @@ from_GstVaapiRateControl (guint value)
   switch (value) {
     case GST_VAAPI_RATECONTROL_NONE:
       return VA_RC_NONE;
+#ifdef VA_RC_CQP
     case GST_VAAPI_RATECONTROL_CQP:
       return VA_RC_CQP;
+#endif
     case GST_VAAPI_RATECONTROL_CBR:
       return VA_RC_CBR;
     case GST_VAAPI_RATECONTROL_VCM:
       return VA_RC_VCM;
     case GST_VAAPI_RATECONTROL_VBR:
       return VA_RC_VBR;
+#ifdef VA_RC_VBR_CONSTRAINED
     case GST_VAAPI_RATECONTROL_VBR_CONSTRAINED:
       return VA_RC_VBR_CONSTRAINED;
+#endif
   }
   GST_ERROR ("unsupported GstVaapiRateControl value %u", value);
   return VA_RC_NONE;
@@ -513,16 +521,20 @@ to_GstVaapiRateControl (guint value)
   switch (value) {
     case VA_RC_NONE:
       return GST_VAAPI_RATECONTROL_NONE;
+#ifdef VA_RC_CQP
     case VA_RC_CQP:
       return GST_VAAPI_RATECONTROL_CQP;
+#endif
     case VA_RC_CBR:
       return GST_VAAPI_RATECONTROL_CBR;
     case VA_RC_VCM:
       return GST_VAAPI_RATECONTROL_VCM;
     case VA_RC_VBR:
       return GST_VAAPI_RATECONTROL_VBR;
+#ifdef VA_RC_VBR_CONSTRAINED
     case VA_RC_VBR_CONSTRAINED:
       return GST_VAAPI_RATECONTROL_VBR_CONSTRAINED;
+#endif
   }
   GST_ERROR ("unsupported VA-API Rate Control value %u", value);
   return GST_VAAPI_RATECONTROL_NONE;

-- 
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