From: Sreerenj Balachandran Date: Thu, 18 Jun 2015 09:20:37 +0000 (+0300) Subject: Fix build error for older VA-API versions X-Git-Tag: 1.19.3~503^2~1740 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf9a0225c8c1999d4214b4b814ee2a629c6cde0b;p=platform%2Fupstream%2Fgstreamer.git Fix build error for older VA-API versions Provide guards for VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM and VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME which are only availble from VA >= 0.36. --- diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy.c b/gst-libs/gst/vaapi/gstvaapibufferproxy.c index 9265566..aba9d30 100644 --- a/gst-libs/gst/vaapi/gstvaapibufferproxy.c +++ b/gst-libs/gst/vaapi/gstvaapibufferproxy.c @@ -21,7 +21,6 @@ */ #include "sysdeps.h" -#include #include "gstvaapicompat.h" #include "gstvaapibufferproxy.h" #include "gstvaapibufferproxy_priv.h" @@ -42,12 +41,14 @@ from_GstVaapiBufferMemoryType (guint type) guint va_type; switch (type) { +#if VA_CHECK_VERSION(0,36,0) case GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF: va_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; break; case GST_VAAPI_BUFFER_MEMORY_TYPE_GEM_BUF: va_type = VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM; break; +#endif default: va_type = 0; break; @@ -61,12 +62,14 @@ to_GstVaapiBufferMemoryType (guint va_type) guint type; switch (va_type) { +#if VA_CHECK_VERSION(0,36,0) case VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME: type = GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF; break; case VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM: type = GST_VAAPI_BUFFER_MEMORY_TYPE_GEM_BUF; break; +#endif default: type = 0; break; diff --git a/gst-libs/gst/vaapi/gstvaapicompat.h b/gst-libs/gst/vaapi/gstvaapicompat.h index 0e4b24a..781e30d 100644 --- a/gst-libs/gst/vaapi/gstvaapicompat.h +++ b/gst-libs/gst/vaapi/gstvaapicompat.h @@ -42,6 +42,10 @@ # include #endif +#if VA_CHECK_VERSION(0,36,0) +#include +#endif + #ifdef HAVE_VA_VA_DEC_HEVC_H # include #endif