From: Mark Thompson Date: Mon, 19 Jun 2017 18:09:12 +0000 (+0100) Subject: Move some common macro definitions to the new internal header X-Git-Tag: android-x86-8.1-r1~145 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b0e7feda096d7ae8146ba2e0c22b7bd59b768950;p=android-x86%2Fhardware-intel-common-libva.git Move some common macro definitions to the new internal header Signed-off-by: Mark Thompson --- diff --git a/va/android/va_android.cpp b/va/android/va_android.cpp index 6f0324b..873609c 100644 --- a/va/android/va_android.cpp +++ b/va/android/va_android.cpp @@ -165,9 +165,6 @@ VADisplay vaGetDisplay ( return dpy; } -#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) -#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } - extern "C" { extern int fool_postp; /* do nothing for vaPutSurface if set */ diff --git a/va/egl/va_egl.c b/va/egl/va_egl.c index 36e5504..3462183 100644 --- a/va/egl/va_egl.c +++ b/va/egl/va_egl.c @@ -57,9 +57,8 @@ #include "va.h" #include "va_backend_egl.h" #include "va_egl.h" +#include "va_internal.h" -#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) -#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } VAStatus vaGetEGLClientBufferFromSurface ( VADisplay dpy, diff --git a/va/va.c b/va/va.c index 813a552..bc267d4 100644 --- a/va/va.c +++ b/va/va.c @@ -50,9 +50,6 @@ #define DRIVER_EXTENSION "_drv_video.so" -#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) -#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } - #define ASSERT assert #define CHECK_VTABLE(s, ctx, func) if (!va_checkVtable(ctx->vtable->va##func, #func)) s = VA_STATUS_ERROR_UNKNOWN; #define CHECK_MAXIMUM(s, ctx, var) if (!va_checkMaximum(ctx->max_##var, #var)) s = VA_STATUS_ERROR_UNKNOWN; diff --git a/va/va_internal.h b/va/va_internal.h index 4d60368..6639803 100644 --- a/va/va_internal.h +++ b/va/va_internal.h @@ -25,6 +25,9 @@ #ifndef VA_INTERNAL_H #define VA_INTERNAL_H +#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) +#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } + void va_errorMessage(const char *msg, ...); void va_infoMessage(const char *msg, ...); diff --git a/va/va_tpi.c b/va/va_tpi.c index 21d547d..46cf384 100644 --- a/va/va_tpi.c +++ b/va/va_tpi.c @@ -27,6 +27,7 @@ #include "va.h" #include "va_backend.h" #include "va_backend_tpi.h" +#include "va_internal.h" #include #include @@ -36,9 +37,6 @@ #include #include -#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) -#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } - /* * Create surfaces with special inputs/requirements diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c index a8db4c8..ab53b9b 100644 --- a/va/x11/va_x11.c +++ b/va/x11/va_x11.c @@ -195,8 +195,6 @@ VADisplay vaGetDisplay ( return dpy; } -#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) -#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } void va_TracePutSurface ( VADisplay dpy,