Skip to content

Commit

Permalink
fix: Fix WorkletContext initialization (#2896)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed May 21, 2024
1 parent 700a769 commit 8b65361
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ JVisionCameraProxy::JVisionCameraProxy(const jni::alias_ref<JVisionCameraProxy::
// Run on Frame Processor Worklet Runtime
scheduler->cthis()->dispatchAsync([f = std::move(f)]() { f(); });
};
_workletContext = std::make_shared<RNWorklet::JsiWorkletContext>("VisionCamera", runtime, runOnJS, runOnWorklet);
_workletContext = std::make_shared<RNWorklet::JsiWorkletContext>("VisionCamera");
_workletContext->initialize("VisionCamera", runtime, runOnJS, runOnWorklet);
__android_log_write(ANDROID_LOG_INFO, TAG, "Worklet Context created!");
#else
__android_log_write(ANDROID_LOG_INFO, TAG, "Frame Processors are disabled!");
Expand Down
3 changes: 2 additions & 1 deletion package/ios/FrameProcessors/VisionCameraProxy.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
dispatch_async(delegate.getDispatchQueue, [f = std::move(f)]() { f(); });
};

_workletContext = std::make_shared<RNWorklet::JsiWorkletContext>("VisionCamera", &runtime, runOnJS, runOnWorklet);
_workletContext = std::make_shared<RNWorklet::JsiWorkletContext>("VisionCamera");
_workletContext->initialize("VisionCamera", &runtime, runOnJS, runOnWorklet);
NSLog(@"VisionCameraProxy: Worklet Context Created!");
}

Expand Down

0 comments on commit 8b65361

Please sign in to comment.