fix: Fix Android C++ SharedArray logs
This commit is contained in:
parent
b1fa06514f
commit
bc6f954bf1
@ -1,7 +1,6 @@
|
||||
project(VisionCamera)
|
||||
cmake_minimum_required(VERSION 3.9.0)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
set(PACKAGE_NAME "VisionCamera")
|
||||
set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
|
@ -17,6 +17,7 @@ jni::local_ref<JSharedArray::javaobject> JSharedArray::create(jsi::Runtime& runt
|
||||
|
||||
JSharedArray::JSharedArray(jsi::Runtime& runtime, std::shared_ptr<jsi::ArrayBuffer> arrayBuffer) {
|
||||
size_t size = arrayBuffer->size(runtime);
|
||||
__android_log_print(ANDROID_LOG_INFO, TAG, "Wrapping JSI ArrayBuffer with size %zu...", size);
|
||||
jni::local_ref<JByteBuffer> byteBuffer = JByteBuffer::allocateDirect(size);
|
||||
|
||||
_arrayBuffer = arrayBuffer;
|
||||
@ -33,7 +34,7 @@ JSharedArray::JSharedArray(const jni::alias_ref<jhybridobject>& javaThis, const
|
||||
#else
|
||||
jsi::Runtime& runtime = *proxy->cthis()->getJSRuntime();
|
||||
#endif
|
||||
__android_log_print(ANDROID_LOG_INFO, TAG, "Allocating ArrayBuffer with size %i...", byteBuffer->getDirectSize());
|
||||
__android_log_print(ANDROID_LOG_INFO, TAG, "Wrapping Java ByteBuffer with size %i...", byteBuffer->getDirectSize());
|
||||
_byteBuffer = jni::make_global(byteBuffer);
|
||||
_size = _byteBuffer->getDirectSize();
|
||||
|
||||
@ -43,7 +44,9 @@ JSharedArray::JSharedArray(const jni::alias_ref<jhybridobject>& javaThis, const
|
||||
|
||||
JSharedArray::JSharedArray(const jni::alias_ref<JSharedArray::jhybridobject>& javaThis,
|
||||
const jni::alias_ref<JVisionCameraProxy::javaobject>& proxy, int size)
|
||||
: JSharedArray(javaThis, proxy, JByteBuffer::allocateDirect(size)) {}
|
||||
: JSharedArray(javaThis, proxy, JByteBuffer::allocateDirect(size)) {
|
||||
__android_log_print(ANDROID_LOG_INFO, TAG, "Allocating SharedArray with size %i...", size);
|
||||
}
|
||||
|
||||
void JSharedArray::registerNatives() {
|
||||
registerHybrid({
|
||||
|
Loading…
Reference in New Issue
Block a user