feat: Expose unified VisionCameraProxy object, make FrameProcessorPlugins object-oriented (#1660)
* feat: Replace `FrameProcessorRuntimeManager` with `VisionCameraProxy` (iOS) * Make `FrameProcessorPlugin` a constructable HostObject * fix: Fix `name` override * Simplify `useFrameProcessor * fix: Fix lint errors * Remove FrameProcessorPlugin::name * JSIUtils -> JSINSObjectConversion
This commit is contained in:
@@ -73,10 +73,8 @@ class PropNameIDCache {
|
||||
|
||||
PropNameIDCache propNameIDCache;
|
||||
|
||||
InvalidateCacheOnDestroy::InvalidateCacheOnDestroy(jsi::Runtime &runtime) {
|
||||
key = reinterpret_cast<uintptr_t>(&runtime);
|
||||
}
|
||||
InvalidateCacheOnDestroy::~InvalidateCacheOnDestroy() {
|
||||
void invalidateArrayBufferCache(jsi::Runtime& runtime) {
|
||||
auto key = reinterpret_cast<uintptr_t>(&runtime);
|
||||
propNameIDCache.invalidate(key);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,24 +74,7 @@ struct typedArrayTypeMap<TypedArrayKind::Float64Array> {
|
||||
typedef double type;
|
||||
};
|
||||
|
||||
// Instance of this class will invalidate PropNameIDCache when destructor is called.
|
||||
// Attach this object to global in specific jsi::Runtime to make sure lifecycle of
|
||||
// the cache object is connected to the lifecycle of the js runtime
|
||||
class InvalidateCacheOnDestroy : public jsi::HostObject {
|
||||
public:
|
||||
explicit InvalidateCacheOnDestroy(jsi::Runtime &runtime);
|
||||
virtual ~InvalidateCacheOnDestroy();
|
||||
virtual jsi::Value get(jsi::Runtime &, const jsi::PropNameID &name) {
|
||||
return jsi::Value::null();
|
||||
}
|
||||
virtual void set(jsi::Runtime &, const jsi::PropNameID &name, const jsi::Value &value) {}
|
||||
virtual std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) {
|
||||
return {};
|
||||
}
|
||||
|
||||
private:
|
||||
uintptr_t key;
|
||||
};
|
||||
void invalidateArrayBufferCache(jsi::Runtime& runtime);
|
||||
|
||||
class TypedArrayBase : public jsi::Object {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user