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

View file

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