Closed frodriguez-hu closed 2 months ago
I suppose you’re using my recommended way, am I right? If this the case you need to use default vision camera docs way then
Or you can call some frame internal method. I don’t remember right now what exactly but it’s something like increseRef. But you will need to cast frame as internalFrame type
I resolved this by disabling the originalFrame prop, and returning the result on the detectFaces instead of executing the callback. By doing that I was able to use rhe result data on the frame for other operations, this worked fine on android I haven't tested it on ios. In my opinion I thini returning the result instead of the callback would be a better spproach for the plugin, what is the advantage that you have by using the callback?
@felire can you provide an example code of your sollution? So other people with same issue can test it too.
About "returning result instead..." I'd appreciate it if you could open a PR with your ideas 😁
I just did this @nonam4 :
export function detectFaces(
frame: Frame,
callback: CallbackType,
options?: FaceDetectionOptions
) {
'worklet'
if ( !plugin ) {
throw new Error( 'Failed to load Frame Processor Plugin "detectFaces"!' )
}
// @ts-ignore
const result: DetectionResult = plugin.call( frame, options )
callback( result )
return result;
}
Returning the result and using it instead of using the callback
The plugin looks awesome btw.
Describe the bug Hey, I am trying to use this plugin, and after I receive the data and wehn I want to access the original frame, I am able to do it, but the issue is that I am not able to execute any other frame processor plugin cause the Frame was marked as Closed. Any idea on how to solve this?
I am getting this error when I am trying to resize it:
To Reproduce Steps to reproduce the behavior:
This is the frame processor:
And the callback:
Expected behavior A clear and concise description of what you expected to happen.
Logs and Screenshots If applicable, add logs and/or screenshots to help explain your problem.
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.