From 8c1509249c5552270d8accc2c9512f499a8f5e2d Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Mon, 26 Oct 2015 17:44:10 -0700 Subject: [RenderScript] Implement APIs for better multi-frame process support. Bug: 23535524 Two APIs added for multiframe processing: - createAllocations(...): To create an array of Allocations sharing the same Type and Usage. For USAGE_IO_INPUT Allocations, they also share the same BufferQueue. - getTimeStamp(): API to retrieve the time stamp associated with the most recent buffer. Change-Id: I6b7b35d7dca5e87ee2f3db2ee17cb9cf824bcfe1 --- rs/java/android/renderscript/RenderScript.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'rs/java/android/renderscript/RenderScript.java') diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index 4788223b4357..51fc7dd06232 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -484,7 +484,6 @@ public class RenderScript { rsnAllocationCopyToBitmap(mContext, alloc, bmp); } - native void rsnAllocationSyncAll(long con, long alloc, int src); synchronized void nAllocationSyncAll(long alloc, int src) { validate(); @@ -497,6 +496,16 @@ public class RenderScript { return rsnAllocationGetByteBuffer(mContext, alloc, stride, xBytesSize, dimY, dimZ); } + native void rsnAllocationSetupBufferQueue(long con, long alloc, int numAlloc); + synchronized void nAllocationSetupBufferQueue(long alloc, int numAlloc) { + validate(); + rsnAllocationSetupBufferQueue(mContext, alloc, numAlloc); + } + native void rsnAllocationShareBufferQueue(long con, long alloc1, long alloc2); + synchronized void nAllocationShareBufferQueue(long alloc1, long alloc2) { + validate(); + rsnAllocationShareBufferQueue(mContext, alloc1, alloc2); + } native Surface rsnAllocationGetSurface(long con, long alloc); synchronized Surface nAllocationGetSurface(long alloc) { validate(); @@ -512,13 +521,12 @@ public class RenderScript { validate(); rsnAllocationIoSend(mContext, alloc); } - native void rsnAllocationIoReceive(long con, long alloc); - synchronized void nAllocationIoReceive(long alloc) { + native long rsnAllocationIoReceive(long con, long alloc); + synchronized long nAllocationIoReceive(long alloc) { validate(); - rsnAllocationIoReceive(mContext, alloc); + return rsnAllocationIoReceive(mContext, alloc); } - native void rsnAllocationGenerateMipmaps(long con, long alloc); synchronized void nAllocationGenerateMipmaps(long alloc) { validate(); -- cgit v1.2.3