Merge change 6846 into donut
* changes: Avoid memcpy's by using GetPrimitiveArrayCritical.
This commit is contained in:
@@ -143,9 +143,9 @@ void JNICameraContext::copyAndPost(JNIEnv* env, const sp<IMemory>& dataPtr, int
|
|||||||
LOGE("Couldn't allocate byte array for JPEG data");
|
LOGE("Couldn't allocate byte array for JPEG data");
|
||||||
env->ExceptionClear();
|
env->ExceptionClear();
|
||||||
} else {
|
} else {
|
||||||
jbyte *bytes = env->GetByteArrayElements(obj, NULL);
|
jbyte *bytes = static_cast<jbyte*>(env->GetPrimitiveArrayCritical(obj, NULL));
|
||||||
memcpy(bytes, data, size);
|
memcpy(bytes, data, size);
|
||||||
env->ReleaseByteArrayElements(obj, bytes, 0);
|
env->ReleasePrimitiveArrayCritical(obj, bytes, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user