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.
This commit is contained in:
Sreerenj Balachandran 2015-06-18 12:20:37 +03:00
parent 28e50ad407
commit cf9a0225c8
2 changed files with 8 additions and 1 deletions

View file

@ -21,7 +21,6 @@
*/ */
#include "sysdeps.h" #include "sysdeps.h"
#include <va/va_drmcommon.h>
#include "gstvaapicompat.h" #include "gstvaapicompat.h"
#include "gstvaapibufferproxy.h" #include "gstvaapibufferproxy.h"
#include "gstvaapibufferproxy_priv.h" #include "gstvaapibufferproxy_priv.h"
@ -42,12 +41,14 @@ from_GstVaapiBufferMemoryType (guint type)
guint va_type; guint va_type;
switch (type) { switch (type) {
#if VA_CHECK_VERSION(0,36,0)
case GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF: case GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF:
va_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; va_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME;
break; break;
case GST_VAAPI_BUFFER_MEMORY_TYPE_GEM_BUF: case GST_VAAPI_BUFFER_MEMORY_TYPE_GEM_BUF:
va_type = VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM; va_type = VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM;
break; break;
#endif
default: default:
va_type = 0; va_type = 0;
break; break;
@ -61,12 +62,14 @@ to_GstVaapiBufferMemoryType (guint va_type)
guint type; guint type;
switch (va_type) { switch (va_type) {
#if VA_CHECK_VERSION(0,36,0)
case VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME: case VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME:
type = GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF; type = GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF;
break; break;
case VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM: case VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM:
type = GST_VAAPI_BUFFER_MEMORY_TYPE_GEM_BUF; type = GST_VAAPI_BUFFER_MEMORY_TYPE_GEM_BUF;
break; break;
#endif
default: default:
type = 0; type = 0;
break; break;

View file

@ -42,6 +42,10 @@
# include <va/va_compat.h> # include <va/va_compat.h>
#endif #endif
#if VA_CHECK_VERSION(0,36,0)
#include <va/va_drmcommon.h>
#endif
#ifdef HAVE_VA_VA_DEC_HEVC_H #ifdef HAVE_VA_VA_DEC_HEVC_H
# include <va/va_dec_hevc.h> # include <va/va_dec_hevc.h>
#endif #endif