What were you trying to do?

I created a custom frame processor following the guide in the official doc. I used vision-camera-plugin-builder to scaffold with this command.

npx vision-camera-plugin-builder ios --pluginName XyzFrameProcessor --methodName xyz --lang ObjC

Reproduceable Code

https://github.com/bglgwyng/FrameProcessorExample2

This example only contains the frame processor written in Object C. However, I also tried Swift and it didn't work either.

I didn't modify the scaffolded code at all.

What happened instead?

It crashed.

Relevant log output

flipper: FlipperClient::addPlugin Inspector
flipper: FlipperClient::addPlugin Preferences
flipper: FlipperClient::addPlugin React
flipper: FlipperClient::addPlugin Network
2022-10-02 20:59:50.406855+0900 FrameProcessorExample2[13557:950475] [connection] nw_socket_handle_socket_event [C1.1:1] Socket SO_ERROR [61: Connection refused]
2022-10-02 20:59:50.407688+0900 FrameProcessorExample2[13557:950475] [connection] nw_socket_handle_socket_event [C1.2:1] Socket SO_ERROR [61: Connection refused]
2022-10-02 20:59:50.407996+0900 FrameProcessorExample2[13557:950476] [connection] nw_connection_get_connected_socket [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-10-02 20:59:50.408055+0900 FrameProcessorExample2[13557:950476] TCP Conn 0x283b8c840 Failed : error 0:61 [61]
2022-10-02 20:59:50.425068+0900 FrameProcessorExample2[13557:950308] [native] Running application FrameProcessorExample2 ({
    initialProps =     {
    };
    rootTag = 1;
})
2022-10-02 20:59:50.476169+0900 FrameProcessorExample2[13557:950472] FrameProcessorBindings: Creating Runtime Manager...
2022-10-02 20:59:50.477381+0900 FrameProcessorExample2[13557:950472] FrameProcessorBindings: Runtime Manager created!
2022-10-02 20:59:50.477445+0900 FrameProcessorExample2[13557:950472] FrameProcessorBindings: Installing Frame Processor plugins...
2022-10-02 20:59:50.477484+0900 FrameProcessorExample2[13557:950472] FrameProcessorBindings: Installing Frame Processor plugin "__scanCodes"...
2022-10-02 20:59:50.477526+0900 FrameProcessorExample2[13557:950472] FrameProcessorBindings: Frame Processor plugins installed!
2022-10-02 20:59:50.477696+0900 FrameProcessorExample2[13557:950488] FrameProcessorBindings: Installing Frame Processor Bindings for Bridge...
2022-10-02 20:59:50.477724+0900 FrameProcessorExample2[13557:950488] FrameProcessorBindings: Installing global functions...
2022-10-02 20:59:50.477770+0900 FrameProcessorExample2[13557:950488] FrameProcessorBindings: Finished installing bindings.
2022-10-02 20:59:52.148576+0900 FrameProcessorExample2[13557:950472] [connection] nw_socket_handle_socket_event [C6:1] Socket SO_ERROR [61: Connection refused]
2022-10-02 20:59:52.148691+0900 FrameProcessorExample2[13557:950479] [connection] nw_connection_get_connected_socket [C6] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-10-02 20:59:52.148758+0900 FrameProcessorExample2[13557:950479] TCP Conn 0x283b89550 Failed : error 0:61 [61]
2022-10-02 20:59:52.227201+0900 FrameProcessorExample2[13557:950488] [javascript] Running "FrameProcessorExample2" with {"rootTag":1,"initialProps":{}}
2022-10-02 20:59:52.335326+0900 FrameProcessorExample2[13557:950308] [native] VisionCamera.didSetProps(_:): Updating 10 prop(s)...
2022-10-02 20:59:52.335387+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.configureCaptureSession(): Configuring Session...
2022-10-02 20:59:52.335395+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.configureCaptureSession(): Initializing Camera with device com.apple.avfoundation.avcapturedevice.built-in_video:1...
2022-10-02 20:59:52.335405+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.configureCaptureSession(): Adding Video input...
2022-10-02 20:59:52.338830+0900 FrameProcessorExample2[13557:950488] FrameProcessorBindings: Setting new frame processor...
2022-10-02 20:59:52.338859+0900 FrameProcessorExample2[13557:950488] FrameProcessorBindings: Adapting Shareable value from function (conversion to worklet)...
2022-10-02 20:59:52.338997+0900 FrameProcessorExample2[13557:950488] FrameProcessorBindings: Successfully created worklet!
2022-10-02 20:59:52.339038+0900 FrameProcessorExample2[13557:950473] FrameProcessorBindings: Converting worklet to Objective-C callback...
2022-10-02 20:59:52.339712+0900 FrameProcessorExample2[13557:950473] FrameProcessorBindings: Frame processor set!
2022-10-02 20:59:52.386768+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.configureCaptureSession(): Adding Video Data output...
2022-10-02 20:59:52.390109+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.invokeOnInitialized(): Camera initialized!
2022-10-02 20:59:52.390172+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.configureCaptureSession(): Session successfully configured!
2022-10-02 20:59:52.390676+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.configureFormat(): Configuring Format...
2022-10-02 20:59:52.390682+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.configureDevice(): Configuring Device...
2022-10-02 20:59:52.390708+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.configureDevice(): Device successfully configured!
2022-10-02 20:59:52.390789+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.didSetProps(_:): Starting Session...
2022-10-02 20:59:52.449789+0900 FrameProcessorExample2[13557:950476] [connection] nw_socket_handle_socket_event [C8.1:1] Socket SO_ERROR [61: Connection refused]
2022-10-02 20:59:52.450189+0900 FrameProcessorExample2[13557:950476] [connection] nw_socket_handle_socket_event [C8.2:1] Socket SO_ERROR [61: Connection refused]
2022-10-02 20:59:52.450340+0900 FrameProcessorExample2[13557:950472] [connection] nw_connection_get_connected_socket [C8] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-10-02 20:59:52.450368+0900 FrameProcessorExample2[13557:950472] TCP Conn 0x283ba40b0 Failed : error 0:61 [61]
2022-10-02 20:59:52.576185+0900 FrameProcessorExample2[13557:950479] [native] VisionCamera.didSetProps(_:): Started Session!
libc++abi: terminating with uncaught exception of type facebook::jsi::JSError: Exception in HostFunction: Javascript worklet error

Error: Javascript worklet error
    at _f (native)

Error: Exception in HostFunction: Javascript worklet error

Error: Javascript worklet error
    at _f (native)
    at _f (native)
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
terminating with uncaught exception of type facebook::jsi::JSError: Exception in HostFunction: Javascript worklet error

Error: Javascript worklet error
    at _f (native)

Error: Exception in HostFunction: Javascript worklet error

Error: Javascript worklet error
    at _f (native)
    at _f (native)
(lldb)

Device

iPhone 13, iOS 15.6.1

VisionCamera Version

2.14.1

Additional information

0

The frame processor itself doesn't have a problem. The custom frame processors in the example in this repo work fine. However, the guide in docs + the scaffolding CLI is not enough to create a new one. Extra work is needed.

0
© 2022 pullanswer.com - All rights reserved.