Merge "Fix typo"
This commit is contained in:
@@ -221,10 +221,10 @@ jboolean Java_android_filterfw_core_GLFrame_setNativeBitmap(JNIEnv* env,
|
|||||||
if (frame && bitmap) {
|
if (frame && bitmap) {
|
||||||
uint8_t* pixels;
|
uint8_t* pixels;
|
||||||
const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&pixels));
|
const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&pixels));
|
||||||
if (result == ANDROID_BITMAP_RESUT_SUCCESS) {
|
if (result == ANDROID_BITMAP_RESULT_SUCCESS) {
|
||||||
const bool success = frame->WriteData(pixels, size);
|
const bool success = frame->WriteData(pixels, size);
|
||||||
return ToJBool(success &&
|
return ToJBool(success &&
|
||||||
AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS);
|
AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESULT_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
@@ -237,9 +237,9 @@ jboolean Java_android_filterfw_core_GLFrame_getNativeBitmap(JNIEnv* env,
|
|||||||
if (frame && bitmap) {
|
if (frame && bitmap) {
|
||||||
uint8_t* pixels;
|
uint8_t* pixels;
|
||||||
const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&pixels));
|
const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&pixels));
|
||||||
if (result == ANDROID_BITMAP_RESUT_SUCCESS) {
|
if (result == ANDROID_BITMAP_RESULT_SUCCESS) {
|
||||||
frame->CopyDataTo(pixels, frame->Size());
|
frame->CopyDataTo(pixels, frame->Size());
|
||||||
return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS);
|
return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESULT_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ jboolean Java_android_filterfw_core_NativeFrame_setNativeBitmap(JNIEnv* env,
|
|||||||
|
|
||||||
Pixel* src_ptr;
|
Pixel* src_ptr;
|
||||||
const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&src_ptr));
|
const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&src_ptr));
|
||||||
if (result == ANDROID_BITMAP_RESUT_SUCCESS) {
|
if (result == ANDROID_BITMAP_RESULT_SUCCESS) {
|
||||||
// Create destination pointers
|
// Create destination pointers
|
||||||
uint8_t* dst_ptr = reinterpret_cast<uint8_t*>(frame->MutableData());
|
uint8_t* dst_ptr = reinterpret_cast<uint8_t*>(frame->MutableData());
|
||||||
const uint8_t* end_ptr = dst_ptr + frame->Size();
|
const uint8_t* end_ptr = dst_ptr + frame->Size();
|
||||||
@@ -207,7 +207,7 @@ jboolean Java_android_filterfw_core_NativeFrame_setNativeBitmap(JNIEnv* env,
|
|||||||
ALOGE("Unsupported bytes-per-pixel %d in setBitmap!", bytes_per_sample);
|
ALOGE("Unsupported bytes-per-pixel %d in setBitmap!", bytes_per_sample);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS);
|
return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESULT_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
@@ -222,7 +222,7 @@ jboolean Java_android_filterfw_core_NativeFrame_getNativeBitmap(JNIEnv* env,
|
|||||||
if (frame && bitmap) {
|
if (frame && bitmap) {
|
||||||
Pixel* dst_ptr;
|
Pixel* dst_ptr;
|
||||||
const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&dst_ptr));
|
const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&dst_ptr));
|
||||||
if (result == ANDROID_BITMAP_RESUT_SUCCESS) {
|
if (result == ANDROID_BITMAP_RESULT_SUCCESS) {
|
||||||
// Make sure frame size matches bitmap size
|
// Make sure frame size matches bitmap size
|
||||||
if ((size / 4) != (frame->Size() / bytes_per_sample)) {
|
if ((size / 4) != (frame->Size() / bytes_per_sample)) {
|
||||||
ALOGE("Size mismatch in native getBitmap()!");
|
ALOGE("Size mismatch in native getBitmap()!");
|
||||||
@@ -259,7 +259,7 @@ jboolean Java_android_filterfw_core_NativeFrame_getNativeBitmap(JNIEnv* env,
|
|||||||
ALOGE("Unsupported bytes-per-pixel %d in getBitmap!", bytes_per_sample);
|
ALOGE("Unsupported bytes-per-pixel %d in getBitmap!", bytes_per_sample);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS);
|
return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESULT_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ANDROID_BITMAP_RESUT_SUCCESS;
|
return ANDROID_BITMAP_RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr) {
|
int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr) {
|
||||||
@@ -75,7 +75,7 @@ int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr) {
|
|||||||
if (addrPtr) {
|
if (addrPtr) {
|
||||||
*addrPtr = addr;
|
*addrPtr = addr;
|
||||||
}
|
}
|
||||||
return ANDROID_BITMAP_RESUT_SUCCESS;
|
return ANDROID_BITMAP_RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap) {
|
int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap) {
|
||||||
@@ -95,6 +95,6 @@ int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap) {
|
|||||||
bm->notifyPixelsChanged();
|
bm->notifyPixelsChanged();
|
||||||
|
|
||||||
bm->unlockPixels();
|
bm->unlockPixels();
|
||||||
return ANDROID_BITMAP_RESUT_SUCCESS;
|
return ANDROID_BITMAP_RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user