feat: Implement Frame.close() (#229)

* Implement `Frame.close()`

* close frame in dtor

* Update JImageProxyHostObject.cpp

* fix close

* Check if closed

* remove a few logs

* r

* fix `isValid` and `isReady`

* Add JImage

* Release JNI frame ref on destroy

* fix pod setup

* Fix isValid call

* Fix `close` not returning a function

* throw error if closed twice

* iOS: Schedule `console.error` call on JS thread

* Android: Log Frame Processor Error to JS

* fix syntax

* Check if valid `toString()`

* Update Frame.ts

* Remove `isReady`

* Fix JImage accessors

* remove `JImage` C++ sources

* Throw error if accessing props on closed Frame

* Delete `JImage.h`
This commit is contained in:
Marc Rousavy
2021-07-06 10:08:44 +02:00
committed by GitHub
parent 7d3b352155
commit fa5f5c0cab
13 changed files with 193 additions and 96 deletions

View File

@@ -22,8 +22,11 @@ public:
public:
jsi::Value get(jsi::Runtime&, const jsi::PropNameID& name) override;
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& rt) override;
void destroyBuffer();
void close();
public:
Frame* frame;
private:
void assertIsFrameStrong(jsi::Runtime& runtime, const std::string& accessedPropName);
};