Remove and redifine some Xlib Macros, use void* instead of Surface* for VAStatus... 72/572/1
authorRen Zhaohan <zhaohan.ren@intel.com>
Fri, 7 May 2010 03:42:16 +0000 (11:42 +0800)
committerRen Zhaohan <zhaohan.ren@intel.com>
Fri, 7 May 2010 03:42:16 +0000 (11:42 +0800)
va/android/va_android.cpp
va/va.c
va/va.h
va/va_android.h
va/va_backend.h
va/x11/va_dricommon.h

index 11d1935..caa6fcb 100644 (file)
@@ -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 (file)
--- a/va/va.c
+++ b/va/va.c
 #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 (file)
--- 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
index 644d76d..de223fc 100644 (file)
@@ -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, 
index 00684da..423de2d 100644 (file)
 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_ */
index 0d324ad..ae364e7 100644 (file)
 
 #include <va/va_backend.h>
 
+#ifdef ANDROID
+#define XID unsigned int
+#define Bool int
+#endif
+
 enum
 {
     VA_NONE = 0,