react-native-vision-camera/package/ios/Frame Processor/FrameProcessorPlugin.m
Mateusz Mędrek a291642c53
feat: Reintroduce Macros for Frame Processor Plugin registration (#2027)
in VisionCamera v1 & v2 there were two ObjC macros that were helping
in creation/registration of Frame Processors, but these were removed with
v3

This PR reintroduces such macros, which will not only make FP development
easier, but also it will also fix issues people had with registration of
Swift Frame Processors (+load vs +initialize issues)

Docs were also updated to reflect that the macros should be used to
correctly initialize and register ObjC/Swift Frame Processors
2023-10-19 10:35:14 +02:00

26 lines
646 B
Objective-C

//
// FrameProcessorPlugin.m
// VisionCamera
//
// Created by Marc Rousavy on 31.07.23.
// Copyright © 2023 mrousavy. All rights reserved.
//
#import "FrameProcessorPlugin.h"
// Base implementation (empty)
@implementation FrameProcessorPlugin
- (instancetype)initWithOptions:(NSDictionary* _Nullable)options {
self = [super init];
return self;
}
- (id _Nullable)callback:(Frame* _Nonnull)frame withArguments:(NSDictionary* _Nullable)arguments {
[NSException raise:NSInternalInconsistencyException
format:@"Frame Processor Plugin does not override the `callback(frame:withArguments:)` method!"];
return nil;
}
@end