Commit 03a6cbe5 authored by Ren Zhaohan's avatar Ren Zhaohan

Remove and redifine some Xlib Macros, use void* instead of Surface* for VAStatus (*vaPutSurface)

parent 085f5e3b
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#endif #endif
#define CHECK_SYMBOL(func) { if (!func) printf("func %s not found\n", #func); return VA_STATUS_ERROR_UNKNOWN; } #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; static VADisplayContextP pDisplayContexts = NULL;
...@@ -282,7 +282,7 @@ VADisplay vaGetDisplay ( ...@@ -282,7 +282,7 @@ VADisplay vaGetDisplay (
#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) #define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext)
#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } #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; VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext); return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext);
...@@ -310,9 +310,8 @@ VAStatus vaPutSurface ( ...@@ -310,9 +310,8 @@ VAStatus vaPutSurface (
CHECK_DISPLAY(dpy); CHECK_DISPLAY(dpy);
ctx = CTX(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, destx, desty, destw, desth,
cliprects, number_cliprects, flags ); cliprects, number_cliprects, flags );
} }
#endif #endif
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
#include <dlfcn.h> #include <dlfcn.h>
#include <unistd.h> #include <unistd.h>
#ifdef ANDROID
#define Bool int
#define True 1
#define False 0
#endif
#define DRIVER_INIT_FUNC "__vaDriverInit_0_31" #define DRIVER_INIT_FUNC "__vaDriverInit_0_31"
......
...@@ -1804,17 +1804,6 @@ VAStatus vaSetDisplayAttributes ( ...@@ -1804,17 +1804,6 @@ VAStatus vaSetDisplayAttributes (
int num_attributes 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 #ifdef __cplusplus
} }
#endif #endif
......
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
#define _VA_ANDROID_H_ #define _VA_ANDROID_H_
#include <va/va.h> #include <va/va.h>
//FIXME: Surface conflict with va_backend.h
#ifdef Surface
#undef Surface
#endif
#ifdef ANDROID #ifdef ANDROID
#include <ui/Surface.h> #include <ui/Surface.h>
...@@ -23,7 +19,6 @@ VADisplay vaGetDisplay ( ...@@ -23,7 +19,6 @@ VADisplay vaGetDisplay (
); );
#ifdef ANDROID #ifdef ANDROID
/* /*
* Output rendering * Output rendering
* Following is the rendering interface for X windows, * Following is the rendering interface for X windows,
......
...@@ -38,10 +38,6 @@ ...@@ -38,10 +38,6 @@
typedef struct VADriverContext *VADriverContextP; typedef struct VADriverContext *VADriverContextP;
typedef struct VADisplayContext *VADisplayContextP; typedef struct VADisplayContext *VADisplayContextP;
#ifdef ANDROID
#define Surface void
#endif
struct VADriverVTable struct VADriverVTable
{ {
VAStatus (*vaTerminate) ( VADriverContextP ctx ); VAStatus (*vaTerminate) ( VADriverContextP ctx );
...@@ -185,7 +181,7 @@ struct VADriverVTable ...@@ -185,7 +181,7 @@ struct VADriverVTable
VAStatus (*vaPutSurface) ( VAStatus (*vaPutSurface) (
VADriverContextP ctx, VADriverContextP ctx,
VASurfaceID surface, VASurfaceID surface,
Surface* draw, /* Drawable of window system */ void* draw, /* Drawable of window system */
short srcx, short srcx,
short srcy, short srcy,
unsigned short srcw, unsigned short srcw,
...@@ -430,5 +426,4 @@ typedef VAStatus (*VADriverInit) ( ...@@ -430,5 +426,4 @@ typedef VAStatus (*VADriverInit) (
VADriverContextP driver_context VADriverContextP driver_context
); );
#endif /* _VA_BACKEND_H_ */ #endif /* _VA_BACKEND_H_ */
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
#include <va/va_backend.h> #include <va/va_backend.h>
#ifdef ANDROID
#define XID unsigned int
#define Bool int
#endif
enum enum
{ {
VA_NONE = 0, VA_NONE = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment