fix: Host Object error
This commit is contained in:
parent
4a1fc1ddd8
commit
e13bef7d17
@ -23,17 +23,7 @@ int JImageProxy::getHeight() {
|
||||
}
|
||||
|
||||
bool JImageProxy::getIsValid() {
|
||||
static const auto getImageMethod = getClass()->getMethod<JImageProxy::javaobject()>("getImage");
|
||||
auto image = getImageMethod(javaClassLocal());
|
||||
|
||||
static const auto getHardwareBufferMethod = findClassLocal("android/media/Image")->getMethod<jobject()>("getHardwareBuffer");
|
||||
try {
|
||||
getHardwareBufferMethod(image.get());
|
||||
return true;
|
||||
} catch (...) {
|
||||
// function throws if the image is not active anymore
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int JImageProxy::getPlaneCount() {
|
||||
|
@ -19,7 +19,6 @@ std::vector<jsi::PropNameID> FrameHostObject::getPropertyNames(jsi::Runtime& rt)
|
||||
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("height")));
|
||||
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("bytesPerRow")));
|
||||
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("planesCount")));
|
||||
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("buffer")));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user