-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V2] Correct Frame Processor loading between Objc/Swift #2025
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Okay, this works in the Example and resolves my issues on v2 with the frame processors now. vision-camera.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks for your PR!
Just left a few comments, otherwise we're good to go!
example/ios/Frame Processor Plugins/Example Plugin (Objective-C)/ExampleFrameProcessorPlugin.m
Outdated
Show resolved
Hide resolved
example/ios/Frame Processor Plugins/Example Plugin (Swift)/ExamplePluginSwift.swift
Outdated
Show resolved
Hide resolved
@@ -33,7 +33,7 @@ | |||
*/ | |||
#define VISION_EXPORT_FRAME_PROCESSOR(frame_processor) \ | |||
\ | |||
+(void)initialize \ | |||
+(void)load \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@@ -53,13 +53,11 @@ objc_name : NSObject<FrameProcessorPluginBase> | |||
@end \ | |||
@implementation objc_name (FrameProcessorPlugin) \ | |||
\ | |||
+(void)initialize \ | |||
__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, yea I forgot about that lol. I dont know why I reverted that
This reverts commit ba01d28.
Thanks for this changes, you saved me! Unfortunately I can't use version 3 yet because I have to readjust some internal things in my code due to the change from ImageProxy to Frame, in custom frame processor. I just added them locally, I will wait for them to merge in v2 to update my project. |
Let's go! |
Thanks. Will await the new tag and update our plugin/project. |
Just released an update on npm with this fix 💪 |
What
This PR fixes Frame Processors (Swift/Objc). I used the following for research:
Doing initialize appeared to be too early (or not consistent) as we might load code before reanimated is ready. When we move to "load" - that is no longer allowed on Swift due to the interop between objc. attribute constructor runs after load and seems the best place.
Changes
Tested on
Related issues