Core to client fifo on sockets.
Change-Id: I3b84a7d4c3c5fa0d764ad4db22dfd142d5cfa95b
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 26a6287..781c24f 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -240,15 +240,14 @@
int id = rsContextGetMessage(con,
buf, sizeof(buf),
&receiveLen, sizeof(receiveLen),
- &subID, sizeof(subID),
- true);
+ &subID, sizeof(subID));
if (!id && receiveLen) {
LOGV("message receive buffer too small. %i", receiveLen);
}
return _env->NewStringUTF(buf);
}
-static void
+static jint
nContextGetUserMessage(JNIEnv *_env, jobject _this, RsContext con, jintArray data)
{
jint len = _env->GetArrayLength(data);
@@ -259,23 +258,23 @@
int id = rsContextGetMessage(con,
ptr, len * 4,
&receiveLen, sizeof(receiveLen),
- &subID, sizeof(subID),
- true);
+ &subID, sizeof(subID));
if (!id && receiveLen) {
LOGV("message receive buffer too small. %i", receiveLen);
}
_env->ReleaseIntArrayElements(data, ptr, 0);
+ return id;
}
static jint
-nContextPeekMessage(JNIEnv *_env, jobject _this, RsContext con, jintArray auxData, jboolean wait)
+nContextPeekMessage(JNIEnv *_env, jobject _this, RsContext con, jintArray auxData)
{
LOG_API("nContextPeekMessage, con(%p)", con);
jint *auxDataPtr = _env->GetIntArrayElements(auxData, NULL);
size_t receiveLen;
uint32_t subID;
int id = rsContextPeekMessage(con, &receiveLen, sizeof(receiveLen),
- &subID, sizeof(subID), wait);
+ &subID, sizeof(subID));
auxDataPtr[0] = (jint)subID;
auxDataPtr[1] = (jint)receiveLen;
_env->ReleaseIntArrayElements(auxData, auxDataPtr, 0);
@@ -1160,9 +1159,9 @@
{"nDeviceCreate", "()I", (void*)nDeviceCreate },
{"nDeviceDestroy", "(I)V", (void*)nDeviceDestroy },
{"nDeviceSetConfig", "(III)V", (void*)nDeviceSetConfig },
-{"nContextGetUserMessage", "(I[I)V", (void*)nContextGetUserMessage },
+{"nContextGetUserMessage", "(I[I)I", (void*)nContextGetUserMessage },
{"nContextGetErrorMessage", "(I)Ljava/lang/String;", (void*)nContextGetErrorMessage },
-{"nContextPeekMessage", "(I[IZ)I", (void*)nContextPeekMessage },
+{"nContextPeekMessage", "(I[I)I", (void*)nContextPeekMessage },
{"nContextInitToClient", "(I)V", (void*)nContextInitToClient },
{"nContextDeinitToClient", "(I)V", (void*)nContextDeinitToClient },