From c3c66b74b0520357ac73d81ebc14120560f66733 Mon Sep 17 00:00:00 2001 From: xulihang Date: Tue, 30 Jan 2024 18:13:09 +0800 Subject: [PATCH] update the ios files for vision-camera 3.8.2 --- ios/DetectionFrameProcessorPlugin.m | 8 ++++---- ios/DetectionFrameProcessorPlugin.swift | 3 +++ ios/VisionCameraDynamsoftDocumentNormalizer.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ios/DetectionFrameProcessorPlugin.m b/ios/DetectionFrameProcessorPlugin.m index 719216e..fc1f111 100644 --- a/ios/DetectionFrameProcessorPlugin.m +++ b/ios/DetectionFrameProcessorPlugin.m @@ -19,10 +19,10 @@ @implementation DetectionFrameProcessorPlugin (FrameProcessorPluginLoader) + (void)load { - [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"detect" - withInitializer:^FrameProcessorPlugin* (NSDictionary* options) { - return [[DetectionFrameProcessorPlugin alloc] init]; - }]; + [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"detect" + withInitializer:^FrameProcessorPlugin* (VisionCameraProxyHolder* proxy, NSDictionary* options) { + return [[DetectionFrameProcessorPlugin alloc] initWithProxy:proxy withOptions:options]; + }]; } @end diff --git a/ios/DetectionFrameProcessorPlugin.swift b/ios/DetectionFrameProcessorPlugin.swift index c4bb17c..f54584d 100644 --- a/ios/DetectionFrameProcessorPlugin.swift +++ b/ios/DetectionFrameProcessorPlugin.swift @@ -11,6 +11,9 @@ import DynamsoftDocumentNormalizer @objc(DetectionFrameProcessorPlugin) public class DetectionFrameProcessorPlugin: FrameProcessorPlugin { + public override init(proxy: VisionCameraProxyHolder, options: [AnyHashable : Any]! = [:]) { + super.init(proxy: proxy, options: options) + } public override func callback(_ frame: Frame, withArguments arguments: [AnyHashable: Any]?) -> Any? { guard let imageBuffer = CMSampleBufferGetImageBuffer(frame.buffer) else { print("Failed to get CVPixelBuffer!") diff --git a/ios/VisionCameraDynamsoftDocumentNormalizer.h b/ios/VisionCameraDynamsoftDocumentNormalizer.h index 5bf8f8e..69b3700 100644 --- a/ios/VisionCameraDynamsoftDocumentNormalizer.h +++ b/ios/VisionCameraDynamsoftDocumentNormalizer.h @@ -2,7 +2,7 @@ // VisionCameraDynamsoftDocumentNormalizer.h // VisionCameraDynamsoftDocumentNormalizer // -// Created by 徐力航 on 2023/11/22. +// Created by xulihang on 2023/11/22. // Copyright © 2023 Facebook. All rights reserved. //