// // VisionCameraScheduler.mm // VisionCamera // // Created by Marc Rousavy on 23.07.21. // Copyright © 2021 mrousavy. All rights reserved. // #import #import "VisionCameraScheduler.h" #import // Forward declarations for the Swift classes __attribute__((objc_runtime_name("_TtC12VisionCamera12CameraQueues"))) @interface CameraQueues : NSObject @property (nonatomic, class, readonly, strong) dispatch_queue_t _Nonnull frameProcessorQueue; @end namespace vision { using namespace facebook; VisionCameraScheduler::VisionCameraScheduler(std::shared_ptr jsInvoker) { this->jsCallInvoker_ = jsInvoker; } // does not schedule on UI thread but rather on Frame Processor Thread void VisionCameraScheduler::scheduleOnUI(std::function job) { dispatch_async(CameraQueues.frameProcessorQueue, ^{ job(); }); } VisionCameraScheduler::~VisionCameraScheduler(){ } } // namespace vision