summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@gmail.com>2010-03-31 14:37:22 +0800
committerAustin Yuan <shengquan.yuan@gmail.com>2010-03-31 14:37:22 +0800
commit6db0f051641feb01fe79c4ff51306f31ee6cfbe9 (patch)
tree60b670e915d1fee3c9533ec24e9dee845e4bebfa
parentb4016cefa26fbb31655aaa431ba28368fe9e8da0 (diff)
move vaPutSurface(dpy, Surface *draw, XXX) into android/va_android.c
Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
-rw-r--r--va/android/va_android.c38
-rw-r--r--va/va.c4
2 files changed, 40 insertions, 2 deletions
diff --git a/va/android/va_android.c b/va/android/va_android.c
index 9642228..9b1fe0d 100644
--- a/va/android/va_android.c
+++ b/va/android/va_android.c
@@ -26,6 +26,7 @@
#include "config.h"
#include "va.h"
#include "va_backend.h"
+#include "va_android.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -161,3 +162,40 @@ VADisplay vaGetDisplay (
return dpy;
}
+
+
+#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext)
+#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; }
+
+static int vaDisplayIsValid(VADisplay dpy)
+{
+ VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
+ return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext);
+}
+
+VAStatus vaPutSurface (
+ VADisplay dpy,
+ VASurfaceID surface,
+ Surface *draw, /* Android Surface/Window */
+ short srcx,
+ short srcy,
+ unsigned short srcw,
+ unsigned short srch,
+ short destx,
+ short desty,
+ unsigned short destw,
+ unsigned short desth,
+ VARectangle *cliprects, /* client supplied clip list */
+ unsigned int number_cliprects, /* number of clip rects in the clip list */
+ unsigned int flags /* de-interlacing flags */
+)
+{
+ VADriverContextP ctx;
+
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
+
+ return ctx->vtable.vaPutSurface( ctx, surface, draw, srcx, srcy, srcw, srch,
+ destx, desty, destw, desth,
+ cliprects, number_cliprects, flags );
+}
diff --git a/va/va.c b/va/va.c
index 14ea2da..0369044 100644
--- a/va/va.c
+++ b/va/va.c
@@ -56,8 +56,8 @@ extern int trace_flag;
static int vaDisplayIsValid(VADisplay dpy)
{
- VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
- return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext);
+ VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
+ return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext);
}
static void va_errorMessage(const char *msg, ...)