summaryrefslogtreecommitdiff
path: root/va/va_tpi.c
diff options
context:
space:
mode:
authorRen Zhaohan <zhaohan.ren@intel.com>2010-05-11 14:33:37 +0800
committerRen Zhaohan <zhaohan.ren@intel.com>2010-05-11 14:33:37 +0800
commitbed763794d2cc887b9e14907089f5fc2b3a9e4a2 (patch)
treeda046440081e52b3f997461d8d9aae196fdfd572 /va/va_tpi.c
parent70074679333c236bca857a0242ae34442a4874f6 (diff)
Add vaPutSurfaceBuf to va_backend_tpi.h and va_tpi.c[h], update Android.mk for new shared lib libva_android_tpi.so
Diffstat (limited to 'va/va_tpi.c')
-rw-r--r--va/va_tpi.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/va/va_tpi.c b/va/va_tpi.c
index fccd089..f375656 100644
--- a/va/va_tpi.c
+++ b/va/va_tpi.c
@@ -39,6 +39,16 @@
#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext)
#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; }
+#ifdef ANDROID
+#define Drawable unsigned int
+#endif
+
+static int vaDisplayIsValid (VADisplay dpy)
+{
+ VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
+ return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext);
+}
+
/* Wrap a CI (camera imaging) frame as a VA surface to share captured video between camear
* and VA encode. With frame_id, VA driver need to call CI interfaces to get the information
* of the frame, and to determine if the frame can be wrapped as a VA surface
@@ -97,3 +107,35 @@ VAStatus vaCreateSurfaceFromV4L2Buf(
} else
return VA_STATUS_ERROR_UNIMPLEMENTED;
}
+
+VAStatus vaPutSurfaceBuf (
+ VADisplay dpy,
+ VASurfaceID surface,
+ Drawable draw, /* Android Surface/Window */
+ unsigned char* data,
+ int* data_len,
+ 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;
+ struct VADriverVTableTPI *tpi;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
+
+ tpi = ( struct VADriverVTableTPI *)ctx->vtable_tpi;
+ if (tpi && tpi->vaPutSurfaceBuf) {
+ return tpi->vaPutSurfaceBuf( ctx, surface, draw, data, data_len, srcx, srcy, srcw, srch,
+ destx, desty, destw, desth, cliprects, number_cliprects, flags );
+ } else
+ return VA_STATUS_ERROR_UNIMPLEMENTED;
+}