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 @@
#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
......@@ -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"
......
......@@ -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
......
......@@ -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,
......
......@@ -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_ */
......@@ -10,6 +10,11 @@
#include <va/va_backend.h>
#ifdef ANDROID
#define XID unsigned int
#define Bool int
#endif
enum
{
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