feat: Allow returning of ImageProxy in a Frame Processor (#1149)

* feat: Allow returning of ImageProxy in a Frame Processor

* chore: Clean up

* fix: Missing space

* Update useFrameProcessor.ts

* Revert "Update useFrameProcessor.ts"

This reverts commit 9c645489cdfdf2079972669756a2cd20cc81e25e.
This commit is contained in:
Marc Rousavy 2022-07-18 11:40:56 +03:00 committed by GitHub
parent 2a73c09be5
commit 8bafd96c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -11,6 +11,7 @@
#include <string>
#include <utility>
#include <memory>
#include <react/jni/NativeMap.h>
#include <react/jni/ReadableNativeMap.h>
@ -179,6 +180,14 @@ jsi::Value JSIJNIConversion::convertJNIObjectToJSIValue(jsi::Runtime &runtime, c
auto hashMap = toHashMapFunc(object.get());
return convertJNIObjectToJSIValue(runtime, hashMap);
} else if (object->isInstanceOf(JImageProxy::javaClassStatic())) {
// ImageProxy
auto frame = static_ref_cast<JImageProxy>(object);
// box into HostObject
auto hostObject = std::make_shared<FrameHostObject>(frame);
return jsi::Object::createFromHostObject(runtime, hostObject);
}
auto type = object->getClass()->toString();

View File

@ -44,7 +44,7 @@ export function PermissionsPage({ navigation }: Props): React.ReactElement {
<View style={styles.permissionsContainer}>
{cameraPermissionStatus !== 'authorized' && (
<Text style={styles.permissionText}>
Vision Camera needs <Text style={styles.bold}>Camera permission</Text>.
Vision Camera needs <Text style={styles.bold}>Camera permission</Text>.{' '}
<Text style={styles.hyperlink} onPress={requestCameraPermission}>
Grant
</Text>
@ -52,7 +52,7 @@ export function PermissionsPage({ navigation }: Props): React.ReactElement {
)}
{microphonePermissionStatus !== 'authorized' && (
<Text style={styles.permissionText}>
Vision Camera needs <Text style={styles.bold}>Microphone permission</Text>.
Vision Camera needs <Text style={styles.bold}>Microphone permission</Text>.{' '}
<Text style={styles.hyperlink} onPress={requestMicrophonePermission}>
Grant
</Text>