summaryrefslogtreecommitdiff
path: root/va
diff options
context:
space:
mode:
authorRen Zhaohan <zhaohan.ren@intel.com>2010-05-07 11:42:16 +0800
committerRen Zhaohan <zhaohan.ren@intel.com>2010-05-07 11:42:16 +0800
commit03a6cbe5a8c41aa5311a1ddb67bb93a0ae3539b4 (patch)
tree444165dadc06c95be9e49deba4cd4d7c7db3755c /va
parent085f5e3b74c3db11d5d8a769d4cc57c2a022bc86 (diff)
downloadlibva-03a6cbe5a8c41aa5311a1ddb67bb93a0ae3539b4.tar.gz
Remove and redifine some Xlib Macros, use void* instead of Surface* for VAStatus (*vaPutSurface)
Diffstat (limited to 'va')
-rw-r--r--va/android/va_android.cpp7
-rw-r--r--va/va.c5
-rw-r--r--va/va.h11
-rw-r--r--va/va_android.h5
-rw-r--r--va/va_backend.h7
-rw-r--r--va/x11/va_dricommon.h5
6 files changed, 14 insertions, 26 deletions
diff --git a/va/android/va_android.cpp b/va/android/va_android.cpp
index 11d1935..caa6fcb 100644
--- a/va/android/va_android.cpp
+++ b/va/android/va_android.cpp
@@ -43,7 +43,7 @@
#endif
#define CHECK_SYMBOL(func) { if (!func) printf("func %s not found\n", #func); return VA_STATUS_ERROR_UNKNOWN; }
-#define DEVICE_NAME "/dev/dri/card0"
+#define DEVICE_NAME "/dev/card0"
static VADisplayContextP pDisplayContexts = NULL;
@@ -282,7 +282,7 @@ VADisplay vaGetDisplay (
#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext)
#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; }
-static int vaDisplayIsValid(VADisplay dpy)
+static int vaDisplayIsValid (VADisplay dpy)
{
VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext);
@@ -310,9 +310,8 @@ VAStatus vaPutSurface (
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable.vaPutSurface( ctx, surface, static_cast<void *>(&draw), srcx, srcy, srcw, srch,
+ return ctx->vtable.vaPutSurface( ctx, surface, static_cast<void*>(&draw), srcx, srcy, srcw, srch,
destx, desty, destw, desth,
cliprects, number_cliprects, flags );
}
-
#endif
diff --git a/va/va.c b/va/va.c
index c97b6cc..1917716 100644
--- a/va/va.c
+++ b/va/va.c
@@ -35,6 +35,11 @@
#include <dlfcn.h>
#include <unistd.h>
+#ifdef ANDROID
+#define Bool int
+#define True 1
+#define False 0
+#endif
#define DRIVER_INIT_FUNC "__vaDriverInit_0_31"
diff --git a/va/va.h b/va/va.h
index 66334b4..de962df 100644
--- a/va/va.h
+++ b/va/va.h
@@ -1804,17 +1804,6 @@ VAStatus vaSetDisplayAttributes (
int num_attributes
);
-#ifdef ANDROID
-#define Display unsigned int
-#define Drawable unsigned int
-#define XID unsigned int
-#define Bool int
-#define Status int
-#define True 1
-#define False 0
-#define Xfree(ptr) free((ptr))
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/va/va_android.h b/va/va_android.h
index 644d76d..de223fc 100644
--- a/va/va_android.h
+++ b/va/va_android.h
@@ -2,10 +2,6 @@
#define _VA_ANDROID_H_
#include <va/va.h>
-//FIXME: Surface conflict with va_backend.h
-#ifdef Surface
-#undef Surface
-#endif
#ifdef ANDROID
#include <ui/Surface.h>
@@ -23,7 +19,6 @@ VADisplay vaGetDisplay (
);
#ifdef ANDROID
-
/*
* Output rendering
* Following is the rendering interface for X windows,
diff --git a/va/va_backend.h b/va/va_backend.h
index 00684da..423de2d 100644
--- a/va/va_backend.h
+++ b/va/va_backend.h
@@ -38,10 +38,6 @@
typedef struct VADriverContext *VADriverContextP;
typedef struct VADisplayContext *VADisplayContextP;
-#ifdef ANDROID
-#define Surface void
-#endif
-
struct VADriverVTable
{
VAStatus (*vaTerminate) ( VADriverContextP ctx );
@@ -185,7 +181,7 @@ struct VADriverVTable
VAStatus (*vaPutSurface) (
VADriverContextP ctx,
VASurfaceID surface,
- Surface* draw, /* Drawable of window system */
+ void* draw, /* Drawable of window system */
short srcx,
short srcy,
unsigned short srcw,
@@ -430,5 +426,4 @@ typedef VAStatus (*VADriverInit) (
VADriverContextP driver_context
);
-
#endif /* _VA_BACKEND_H_ */
diff --git a/va/x11/va_dricommon.h b/va/x11/va_dricommon.h
index 0d324ad..ae364e7 100644
--- a/va/x11/va_dricommon.h
+++ b/va/x11/va_dricommon.h
@@ -10,6 +10,11 @@
#include <va/va_backend.h>
+#ifdef ANDROID
+#define XID unsigned int
+#define Bool int
+#endif
+
enum
{
VA_NONE = 0,