Update FRAME_PROCESSORS_CREATE_OVERVIEW.mdx

This commit is contained in:
Marc Rousavy 2021-05-11 11:11:49 +02:00 committed by GitHub
parent f823ec5268
commit 3bf4197b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,7 +95,7 @@ static dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORIT
static inline id sendFrameToWebRTC(CMSampleBufferRef buffer, NSArray args) { static inline id sendFrameToWebRTC(CMSampleBufferRef buffer, NSArray args) {
CMSampleBufferRef bufferCopy; CMSampleBufferRef bufferCopy;
CMSampleBufferCreateCopy(kCFAllocatorDefault, &buffer, &bufferCopy); CMSampleBufferCreateCopy(kCFAllocatorDefault, buffer, &bufferCopy);
dispatch_async(queue, ^{ dispatch_async(queue, ^{
NSString* serverURL = (NSString*)args[0]; NSString* serverURL = (NSString*)args[0];
@ -121,6 +121,7 @@ function App() {
useEffect(() => { useEffect(() => {
SomeAI.addListener((results) => { SomeAI.addListener((results) => {
// gets called asynchronously, goes through the React Event Emitter system
console.log(`AI results: ${results}`) console.log(`AI results: ${results}`)
}) })
}, []) }, [])