2021-07-30 02:27:45 -06:00
|
|
|
//
|
|
|
|
// VisionCameraScheduler.h
|
|
|
|
// VisionCamera
|
|
|
|
//
|
|
|
|
// Created by Marc Rousavy on 23.07.21.
|
|
|
|
// Copyright © 2021 mrousavy. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-01-02 09:35:26 -07:00
|
|
|
#include <functional>
|
2021-07-30 02:27:45 -06:00
|
|
|
#import <React-callinvoker/ReactCommon/CallInvoker.h>
|
|
|
|
|
2022-01-02 09:35:26 -07:00
|
|
|
#if __has_include(<RNReanimated/RuntimeManager.h>)
|
|
|
|
#import <RNReanimated/Scheduler.h>
|
|
|
|
#else
|
|
|
|
// dummy placeholder
|
|
|
|
namespace reanimated {
|
|
|
|
class Scheduler {
|
|
|
|
public:
|
|
|
|
virtual void scheduleOnUI(std::function<void()> job);
|
|
|
|
protected:
|
|
|
|
std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker_;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|
2021-07-30 02:27:45 -06:00
|
|
|
|
2022-01-02 09:35:26 -07:00
|
|
|
namespace vision {
|
2021-07-30 02:27:45 -06:00
|
|
|
|
|
|
|
class VisionCameraScheduler : public reanimated::Scheduler {
|
|
|
|
public:
|
2022-01-02 09:35:26 -07:00
|
|
|
VisionCameraScheduler(std::shared_ptr<facebook::react::CallInvoker> jsInvoker);
|
2021-07-30 02:27:45 -06:00
|
|
|
virtual ~VisionCameraScheduler();
|
2022-01-02 09:35:26 -07:00
|
|
|
|
2021-07-30 02:27:45 -06:00
|
|
|
void scheduleOnUI(std::function<void()> job) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace vision
|