fix: Rename getFrameProcessorPlugin
to initFrameProcessorPlugin
(#2038)
* fix: Rename `getFrameProcessorPlugin` to `initFrameProcessorPlugin` * fix: Make nullable, add comments * Format * Update FrameProcessorPlugin.java * Update FrameProcessorPlugin.h * fix: Fix dead links * Call super constructor * Update ExampleFrameProcessorPlugin.java * fix: Init calls
This commit is contained in:
@@ -41,6 +41,7 @@ public class ExampleFrameProcessorPlugin extends FrameProcessorPlugin {
|
||||
}
|
||||
|
||||
ExampleFrameProcessorPlugin(@Nullable Map<String, Object> options) {
|
||||
Log.d("ExamplePlugin", " - options: " + options.toString());
|
||||
super(options);
|
||||
Log.d("ExamplePlugin", "ExampleFrameProcessorPlugin initialized with options: " + options);
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin
|
||||
|
||||
class ExampleKotlinFrameProcessorPlugin(options: Map<String, Any>?): FrameProcessorPlugin(options) {
|
||||
init {
|
||||
Log.d("ExampleKotlinPlugin", " - options" + options?.toString())
|
||||
Log.d("ExampleKotlinPlugin", "ExampleKotlinFrameProcessorPlugin initialized with options: " + options?.toString())
|
||||
}
|
||||
|
||||
override fun callback(frame: Frame, params: Map<String, Any>?): Any? {
|
||||
|
@@ -18,10 +18,10 @@
|
||||
|
||||
@implementation ExampleFrameProcessorPlugin
|
||||
|
||||
- (instancetype)initWithOptions:(NSDictionary * _Nullable)options
|
||||
- (instancetype)initWithOptions:(NSDictionary* _Nullable)options
|
||||
{
|
||||
self = [super initWithOptions:options];
|
||||
NSLog(@"ExamplePlugin - options: %@", options);
|
||||
NSLog(@"ExampleFrameProcessorPlugin initialized with options: %@", options);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ public class ExampleSwiftFrameProcessorPlugin: FrameProcessorPlugin {
|
||||
public override init(options: [AnyHashable: Any]! = [:]) {
|
||||
super.init(options: options)
|
||||
|
||||
print("ExampleSwiftPlugin - options: \(String(describing: options))")
|
||||
print("ExampleSwiftFrameProcessorPlugin initialized with options: \(String(describing: options))")
|
||||
}
|
||||
|
||||
public override func callback(_ frame: Frame, withArguments arguments: [AnyHashable: Any]?) -> Any? {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { VisionCameraProxy, Frame } from 'react-native-vision-camera'
|
||||
|
||||
const plugin = VisionCameraProxy.getFrameProcessorPlugin('example_kotlin_swift_plugin', { foo: 'bar' })
|
||||
const plugin = VisionCameraProxy.initFrameProcessorPlugin('example_kotlin_swift_plugin', { foo: 'bar' })
|
||||
|
||||
export function exampleKotlinSwiftPlugin(frame: Frame): string[] {
|
||||
'worklet'
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { VisionCameraProxy, Frame } from 'react-native-vision-camera'
|
||||
|
||||
const plugin = VisionCameraProxy.getFrameProcessorPlugin('example_plugin')
|
||||
const plugin = VisionCameraProxy.initFrameProcessorPlugin('example_plugin')
|
||||
|
||||
interface Result {
|
||||
example_array: (string | number | boolean)[]
|
||||
|
Reference in New Issue
Block a user