summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2015-06-18 12:20:37 +0300
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>2015-06-18 12:20:37 +0300
commitcf9a0225c8c1999d4214b4b814ee2a629c6cde0b (patch)
treeab1732f95a23776476fefd505ab1f350a1d8571d
parent28e50ad40788735bcfaa0d5f33abcd942d678b09 (diff)
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.
-rw-r--r--gst-libs/gst/vaapi/gstvaapibufferproxy.c5
-rw-r--r--gst-libs/gst/vaapi/gstvaapicompat.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy.c b/gst-libs/gst/vaapi/gstvaapibufferproxy.c
index 92655668..aba9d301 100644
--- a/gst-libs/gst/vaapi/gstvaapibufferproxy.c
+++ b/gst-libs/gst/vaapi/gstvaapibufferproxy.c
@@ -21,7 +21,6 @@
*/
#include "sysdeps.h"
-#include <va/va_drmcommon.h>
#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 0e4b24a6..781e30d6 100644
--- a/gst-libs/gst/vaapi/gstvaapicompat.h
+++ b/gst-libs/gst/vaapi/gstvaapicompat.h
@@ -42,6 +42,10 @@
# include <va/va_compat.h>
#endif
+#if VA_CHECK_VERSION(0,36,0)
+#include <va/va_drmcommon.h>
+#endif
+
#ifdef HAVE_VA_VA_DEC_HEVC_H
# include <va/va_dec_hevc.h>
#endif