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:
parent
2a73c09be5
commit
8bafd96c24
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include <react/jni/NativeMap.h>
|
#include <react/jni/NativeMap.h>
|
||||||
#include <react/jni/ReadableNativeMap.h>
|
#include <react/jni/ReadableNativeMap.h>
|
||||||
@ -179,6 +180,14 @@ jsi::Value JSIJNIConversion::convertJNIObjectToJSIValue(jsi::Runtime &runtime, c
|
|||||||
auto hashMap = toHashMapFunc(object.get());
|
auto hashMap = toHashMapFunc(object.get());
|
||||||
return convertJNIObjectToJSIValue(runtime, hashMap);
|
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();
|
auto type = object->getClass()->toString();
|
||||||
|
@ -44,7 +44,7 @@ export function PermissionsPage({ navigation }: Props): React.ReactElement {
|
|||||||
<View style={styles.permissionsContainer}>
|
<View style={styles.permissionsContainer}>
|
||||||
{cameraPermissionStatus !== 'authorized' && (
|
{cameraPermissionStatus !== 'authorized' && (
|
||||||
<Text style={styles.permissionText}>
|
<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}>
|
<Text style={styles.hyperlink} onPress={requestCameraPermission}>
|
||||||
Grant
|
Grant
|
||||||
</Text>
|
</Text>
|
||||||
@ -52,7 +52,7 @@ export function PermissionsPage({ navigation }: Props): React.ReactElement {
|
|||||||
)}
|
)}
|
||||||
{microphonePermissionStatus !== 'authorized' && (
|
{microphonePermissionStatus !== 'authorized' && (
|
||||||
<Text style={styles.permissionText}>
|
<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}>
|
<Text style={styles.hyperlink} onPress={requestMicrophonePermission}>
|
||||||
Grant
|
Grant
|
||||||
</Text>
|
</Text>
|
||||||
|
Loading…
Reference in New Issue
Block a user