Commit Graph

193 Commits

Author SHA1 Message Date
mrousavy
28a43f716f chore: Drop support for RN < 71 to simplify buildscript 2023-02-08 17:48:22 +01:00
zzz08900
6a094bf1b0
fix: Fix Android build error on RN < 0.71 (#1447) 2023-02-01 16:37:18 +01:00
Christoph Gritschenberger
b82d0e362d
fix: Add support for react-native 0.71 (#1438)
Co-authored-by: Christoph Gritschenberger <christoph.gritschenberger@cca.io>
2023-01-30 19:38:52 +01:00
Thibault Malbranche
c046440e0e
fix: Allowed setting custom downloads directory (#1306)
Clone of https://github.com/mrousavy/react-native-mmkv/pull/459/
2022-10-28 12:18:06 +02:00
Marc Rousavy
a7932bdc98
fix: Support new Reanimated Headers directory (2.11.10+) (#1301) 2022-10-24 14:09:56 +02:00
viniciusyoshioka
b7bb8e45da
fix: Build error "2 files found with path '.../libfolly_runtime.so'" (#1144) 2022-08-10 11:21:59 +02:00
Thibault Malbranche
205e542cb6
fix: Support RN 0.69 and use Hermes from source! 🎉 (#1186)
* wip

* wip

* Update CMakeLists.txt

* Update CMakeLists.txt

* Update android/build.gradle

Co-authored-by: Tomek Zawadzki <tomekzawadzki98@gmail.com>

Co-authored-by: Tomek Zawadzki <tomekzawadzki98@gmail.com>
2022-08-09 18:20:42 +02:00
Eduardo Borges
80df81815a
fix: Fix takePhoto not working inside an Modal (#1021)
* fix: fix takePhoto not working inside an Modal

* chore: remover unnecessary code

* chore: remove unnecessary variable
2022-07-20 14:02:20 +02:00
Marc Rousavy
230b3a6f62 Rename .save -> +save 2022-07-19 13:30:59 +02:00
Marc Rousavy
8bafd96c24
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.
2022-07-18 10:40:56 +02:00
davidlcorbitt
096b1cca4e
fix: (Android) Give real video resolutions, unbind/rebind preview in onHostResume, add missing Android capture errors (#1079)
* Calculate a format's video dimensions based on supported resolutions and photo dimensions

* Add Android fallback strategy for recording quality

* Ensure that session props are not ignored when app is resumed

* Simplify setting Android video dimensions in format

* Modify Android imageAnalysisBuilder to use photoSize

* Update onHostResume function to reference android preview issue

* Add missing Android capture errors
2022-06-14 10:54:33 +02:00
Menardi
3850491b9f
fix: Fix takeSnapshot not working on Android (#961)
Accessing previewView.bitmap was throwing an error because it wasn't being done on the main thread.
Any access to previewView needs to be done on the main (UI) thread. This commit fixes the issue by
ensuring this access is now run on the main thread.

Fixes #547
2022-04-04 11:03:08 +02:00
Menardi
fe01295226
fix: Fix Android focus not using correct focus point (#958)
This commit fixes #758. I was having the same issue and looked into it a bit. I found
[this StackOverflow answer](https://stackoverflow.com/a/60585382) which described a
solution to the same problem. Rather than manually calculate the focus point, we can
get the PreviewView to do it for us. This fixes the issue because the PreviewView
factors in any scaling or resizing of the view on the screen, which we weren't doing
before. The only potential issue is that this needs to run on the UI thread
(which is what the `withContext` is doing), but I've tested it with frame processors
enabled and disabled, and have found no issues in either case.
2022-03-31 18:01:21 +02:00
Christopher Janietz
bea4aa8bb6
fix: Fix issue with resolving camera view in Modal (#928)
* Fix issue with resolving camera view from frame processor for react-native Modal

* Add missing import of UIManagerHelper
2022-03-28 13:22:27 +02:00
Marc Rousavy
8957d5fcb2
fix: Fix Reanimated build (AnimatedSensor.h) (#923) 2022-03-22 10:49:57 +01:00
Marc Rousavy
4b9bcb37e0
feat: Add pauseRecording and resumeRecording 🔥 (#911)
* feat: Add `pauseRecording` and `resumeRecording` (iOS)

* feat: Add `pauseRecording` and `resumeRecording` (Android)

* feat: Add `pauseRecording` and `resumeRecording` (JS)

* fix: Simplify Swift code for Recording
2022-03-22 10:44:58 +01:00
Marc Rousavy
a7d620cf22
chore(deps): Upgrade CameraX to beta02 (#850) 2022-02-28 11:51:50 +01:00
Joshua Smith
00fc39891a
fix: Fix duplicate libhermes.so package (#741)
Co-authored-by: Joshua Smith <joshua.smith4@aggiemail.usu.edu>
2022-01-14 09:54:33 +01:00
NilsKrause
202508b500
fix: Use ViewGroupManager instead of SimpleViewManager (#735) 2022-01-13 10:33:07 +01:00
Muhammad Aditya Hilmy
0ce01b9543
fix: Fix image rotated when flipped in Android (#719) 2022-01-11 11:52:50 +01:00
Marc Rousavy
0904767cf2
fix: Log Stacktrace on Frame Processor Error (#731)
* fix: Log JS Stack on Error

* Android

* Format Stacktrace better

* Update FrameProcessorUtils.mm

* Allow unapproved C++11 headers

* Use `.c_str()`
2022-01-10 16:37:47 +01:00
Marc Rousavy
48da1819fc
feat: Custom Orientation (#715)
* feat: Custom Orientation

* Update CameraView.swift

* Update CameraView.swift

* Try outputRotation approach

* whoops

* fix: Refactor `VideoCapture` instance

* Update orientation in didSetProps

* Update Orientation in iOS

* expose to objc

* Fix Orientation values

* format
2022-01-04 16:57:40 +01:00
Marc Rousavy
adb2115d3b Update build.gradle 2022-01-04 08:49:46 +01:00
Marc Rousavy
675dec5ab3
fix: Resolve node_modules/ better (#706)
* fix: Use `rootDir` instead of `projectDir`

* Revert "fix: Use `rootDir` instead of `projectDir`"

This reverts commit 058e0a110bcf9b688e12a1cccbac2f23a29fa55c.

* fix: Find node_modules path where react-native/ lives

* fix: Figure out VisionCameraExample project

* Revert "fix: Figure out VisionCameraExample project"

This reverts commit 7ca455098244dd62280d40586062803d1ccc2c5f.
2022-01-03 13:18:38 +01:00
Marc Rousavy
1c09ded57e chore: Log target JSI Runtime 2022-01-03 13:06:21 +01:00
Marc Rousavy
d2dbcdd09d
feat: Monorepo support (#704)
* fix: Find node_modules dynamically

* Update build.gradle

* Update build.gradle

* fix: Remove `findNodeModulePath` function
2022-01-03 12:23:19 +01:00
Marc Rousavy
fc4ed60f7c
fix: Fix REA detection to build Frame Processors (#703)
* fix: Fix REA detection

* fix: Detect REA v2 only

* cleanup logic

* Log whether Frame Processors are enabled or disabled

* Log warn instead of info

* use plugin.js to check

* log more precisely

* try ctor

* Revert "try ctor"

This reverts commit bb6110a119428451389d75896234a9935c48d75b.

* fix: Fix log order

* fix: Fix dumb boolean conversion. ffs.

* Update build.gradle

* fix: Remove `VisionCamera_disableFrameProcessors=false` flag
2022-01-03 11:54:32 +01:00
Marc Rousavy
1d27f6a06b fix: Fix crash after Activity is destroyed
Fixes #664
2022-01-03 09:30:40 +01:00
Marc Rousavy
be5ec69b02
feat: Make Reanimated optional (disable Frame Processors if REA v2 is not installed) (#412)
* Fix building iOS without Reanimated

* Conditionally compile Frame Processors (gradle)

* Conditionally use externalNativeBuild

* Remove Reanimated import

* fix: Conditionally load REA/VisionCamera libraries

* fix: Add disable FP to docs

* fix: Fix dummy placeholder for Scheduler.mm

* fix: Fix dummy `Scheduler` declaration

* fix: Only init `CameraView` C++ side if frame processors are enabled

* fix: Install JSI Bindings on Frame Processor Manager ctor

* fix: Wrong conditional

* whoops
2022-01-02 17:35:26 +01:00
Marc Rousavy
77e065d961
fix: Fix Android build on React Native 0.65 and older (#694)
* fix: Fix Android build on React Native 0.65 and older

* fix: Add excludes

* fix: Ignore META-INF from package

* fix: Wrong var name
2022-01-02 16:25:43 +01:00
Janic Duplessis
dcbbae5fc7
fix: Re-install Frame Processor JSI Bindings after Reload (#691) 2022-01-02 16:02:17 +01:00
Janic Duplessis
4584d33921
fix: Fix JNI crash in FrameHostObject dtor (#689) 2022-01-02 15:57:15 +01:00
Marc Rousavy
68707322fe
feat: Use new CameraX Recorder API (Upgrade CameraX to alpha12/32) (#543)
* chore(deps): Upgrade CameraX to alpha10/30

* chore(deps): Add first stable CameraX Video library

* feat: Use new CameraX Video API

* chore(deps): Upgrade CameraX from 10 -> 12

* fix: Replace deprecated APIs

* Update CameraViewModule.kt

* fix: Fix file creation
2021-12-30 11:39:17 +01:00
Janic Duplessis
04576db975
fix: Fix extract tasks being added to clean tasks (#644) 2021-12-13 09:32:10 +01:00
Marc Rousavy
1249cde337 fix: Fix gradle build with wrong task-name and order 2021-12-10 09:53:12 +01:00
Thomas Coldwell
c3039c94c6
feat: Add pixelFormat field (#559)
* Add `mediaSubType` field to device formats

* Create FourCharCode `toString` extension

* Move pixelFormat -> `AVCaptureDevice.Format+toDictionary`

* `mediaSubType` -> `pixelFormat` + non-optional

* ts pixelFormat `string` -> specific formats

* Add default pixelFormat value of `420v` on Android

Co-authored-by: tcoldwell72 <31568400+tcoldwell72@users.noreply.github.com>
2021-12-10 09:44:30 +01:00
Marc Rousavy
6025367c72
fix: Fix duplicate JHashMap definition by moving to custom namespace (#610)
Technically `JHashMap` is duplicated now, but in separate namespaces. If I were to remove my `JHashMap` (and `JArrayList`) definitions, the user is forced to use fbjni v3.
2021-11-23 15:48:07 +01:00
Marc Rousavy
c007a08040 fix: Fix ProGuard stripping away FrameProcessorPlugin 2021-10-14 12:47:28 +02:00
Marc Rousavy
c47639d86a fix: Fix possible null-pointer error in convertJNIObjectToJSIValue 2021-10-14 12:46:42 +02:00
Marc Rousavy
4a73cb96c1
fix: Fix view-not-found race condition in C++ code (#511)
* Add custom `onViewReady` event to get layout

`componentDidMount` is async, so the native view _might_ not exist yet causing a race condition in the `setFrameProcessor` code.

This PR fixes this by calling `setFrameProcessor` only after the native view has actually mounted, and to ensure that I created a custom event that fires at that point.

* Update CameraView.swift
2021-10-11 18:27:23 +02:00
Marc Rousavy
8d24e344c9
chore: Upgrade CameraX to alpha09 (#472)
* chore: Upgrade CameraX to alpha09

* Remove custom ProGuard file

It's no longer needed, CameraX now ships one.

* Set `targetSdkVersion` to `31`

* set `compileSdkVersion` to 31

* Add `android:exported=false`
2021-10-07 12:20:21 +02:00
Marc Rousavy
fc43b1bb7c
fix: Avoid duplicate C++ symbols by using libjsi.so shared library (#494)
* fix: Avoid duplicate C++ symbols by using `libjsi.so` shared library

* exclude `libfbjni` and `libjsi` from packaging options
2021-10-07 11:16:19 +02:00
Marc Rousavy
f029e731b2
fix: Exclude libfbjni.so 2021-10-07 10:28:50 +02:00
Marc Rousavy
916278d3ea
feat: Add React Native 0.66 support (#490)
* feat: Add React Native 0.66 support

* Generate lockfiles

* Update Podfile.lock

* chore: Migrate from react-native-navigation to react-navigation (#491)

* Migrate RNN -> RN

* Migrate all screens

* Fix get permission status

* fix app name

* Update AppDelegate.m

* Fix Info.plist

* Set `UIViewControllerBasedStatusBarAppearance` to `YES`

* Only enable `audio` if user granted microphone permission

* Update App.tsx

* Fix RNGH for Android

* Use `navigate` instead of `push`

* Fix animation

* Upgrade @types/react-native

* "Splash" -> "PermissionsPage"
2021-10-05 12:22:14 +02:00
Marc Rousavy
42e791b4bd
perf: Remove FrameProcessorPlugin HybridClass (#467)
* Rename `JImageProxyHostObject` -> `FrameHostObject`

* `FrameProcessorPlugin` -> `JFrameProcessorPlugin` 1/2

* `FrameProcessorPlugin` -> `JFrameProcessorPlugin` 2/2

* Make `const`

* Make `getName()` instance based

* Update JFrameProcessorPlugin.h

* Update JImageProxy.h

* `T`

* T

* Remove default ctor

* Use `TSelf` again

* Return `local_ref<CameraView*>` instead of `CameraView*`

* Make `findCameraViewById` return a raw pointer again...

* Extract `setFrameProcessor` and `unsetFrameProcessor`

* Use `global_ref`

* Use `static_cast` for `FrameHostObject`

* Update FrameProcessorRuntimeManager.cpp

* Fix reference lint error

* linelength

* Fix `unsetFrameProcessor` call
2021-09-29 12:30:50 +02:00
Marc Rousavy
8f65427391
fix: Fix ExtensionsManager abstract method crash by adding ProGuard rule (#466) 2021-09-29 10:38:49 +02:00
Marc Rousavy
60ea779ffe
fix: De-allocate frame HybridClass with JNI class loader if using Hermes (#455)
* De-allocate `frame` HybridClass with JNI class loader if using Hermes

See 1b3a0c2612

* Don't wrap in `#if FOR_HERMES`, other `jsi::Runtime`s might also run GC on another Thread.

* Use `jni::local_ref` for `FrameHostObject`

* Update JImageProxyHostObject.cpp

* Only run with JNI `ClassLoader` if ctor Thread ID != dtor Thread ID

* Upgrade reanimated to 2.3.0-beta.1 to fix JNI crash

* Remove `this_thread::get_id()`

* Update Podfile.lock
2021-09-24 16:57:12 +02:00
Andrés Guerrero
98f58367d3
fix: Correctly set video size/aspect ratio for Image Analysis (Frame Processor) (#453) 2021-09-24 12:01:45 +02:00
Marc Rousavy
99fff446e5
fix: Fix calling multiple Plugins in a single Frame Processor (#435)
* fix: Fix JNI <-> JSI conversion for Integers

* Create another plugin and call them both serially

* Use inline formatter for `__android_log_write`

* Update FrameProcessorRuntimeManager.cpp

* Log plugin class type

* Use `pluginGlobal->cthis()`

* Log class name

* fix dumb error

* C++: Dynamically get JNI `javaPart_` class & method

* clean up PR
2021-09-24 10:19:30 +02:00
Marc Rousavy
be3312e47d
chore: Upgrade kotlinx-coroutines 1.5.0 -> 1.5.2 (#450)
* chore: Upgrade kotlinx-coroutines 1.5.0 -> 1.5.2

* Upgrade `kotlinVersion` to 1.5.30
2021-09-23 14:22:11 +02:00
Marc Rousavy
83524c0541
fix: Fix Android Stabilization Modes (#449) 2021-09-23 14:02:46 +02:00
Marc Rousavy
c3cf75eb5f fix: Fix JNI <-> JSI conversion for Integers 2021-09-15 10:14:52 +02:00
Marc Rousavy
3d51cca02c chore: Also run validate-cpp for Android C++ files 2021-09-07 14:17:35 +02:00
Marc Rousavy
ad5e131f6a
feat: frameProcessorFps="auto" and automatic performance suggestions (throttle or increase FPS) (#393)
* Add `onFrameProcessorPerformanceSuggestionAvailable` and make `frameProcessorFps` support `auto`

* Implement performance suggestion and auto-adjusting

* Fix FPS setting, evaluate correctly

* Floor suggested FPS

* Remove `console.log` for frame drop warnings.

* Swift format

* Use `30` magic number

* only call if FPS is different

* Update CameraView.swift

* Implement Android 1/2

* Cleanup

* Update `frameProcessorFps` if available

* Optimize `FrameProcessorPerformanceDataCollector` initialization

* Cache call

* Set frameProcessorFps directly (Kotlin setter)

* Don't suggest if same value

* Call suggestion every second

* reset time on set

* Always store 15 last samples

* reset counter too

* Update FrameProcessorPerformanceDataCollector.swift

* Update CameraView+RecordVideo.swift

* Update CameraView.kt

* iOS: Redesign evaluation

* Update CameraView+RecordVideo.swift

* Android: Redesign evaluation

* Update CameraView.kt

* Update REA to latest alpha and install RNScreens

* Fix frameProcessorFps updating
2021-09-06 16:27:16 +02:00
Natalia
3b7560ac4d
fix: Fix Android tasks execution (#407) 2021-09-06 10:32:06 +02:00
Marc Rousavy
98128471cc
fix: Fix Proguard annotation for mHybridData (#406)
* fix: Fix Proguard annotation for `mHybridData`

* rebuild lockfiles
2021-09-05 11:24:33 +02:00
Marc Rousavy
ff5a8b8900
fix: Improve Android resource efficiency/cleanup (use class members for CoroutineScope and FrameProcessorThread) (#335)
* fix: Use custom CoroutineScope

* fix: Use custom `CoroutineScope`

* Make `frameProcessorThread` and `coroutineScope` instance variables

* Update VisionCameraScheduler.java

* Remove `HybridData::resetNative()` calls

they're called by a Java GC destructor anyways.

* Update CameraViewManager.kt

* Update CameraView.kt
2021-08-25 11:33:57 +02:00
Marc Rousavy
c7fb89170e
fix: Apply correct initial rotation on Android (#368)
* fix: Apply correct initial rotation

* Make `rotation` a property getter

* Update CameraView.kt
2021-08-25 11:16:07 +02:00
Marc Rousavy
c657bf8718 Revert "fix: Fix Frame Processor null-dereference error (use ref-counted JNI local_ref) (#351)"
This reverts commit d06bcf648c.
2021-08-20 16:05:09 +02:00
Marc Rousavy
90f2a1ef7d
fix: Fix close being called on a collected reference (enforce alias_ref) (#379)
* fix: Fix `close` being called on a collected reference (enforce `alias_ref`)

* Remove `~FrameHostObject` on iOS too
2021-08-20 16:05:02 +02:00
Marc Rousavy
0d3f2cbd9d
fix: Fix crash when accessing planesCount or bytesPerRow (#380)
* fix: Fix `bytesPerRow` and `planeCount` crashing

* use direct call

* Call `getPlanesCount` and `getBytesPerRow` through java

* revert camerapage changes

* remove removed header import

* Update CameraPage.tsx
2021-08-20 16:02:34 +02:00
Marc Rousavy
d06bcf648c
fix: Fix Frame Processor null-dereference error (use ref-counted JNI local_ref) (#351) 2021-08-20 15:57:31 +02:00
Marc Rousavy
cae08a1402
feat: Add react-native 0.65 support (#378)
* fix `;`

* upgrade react-native to 0.65.1

* upgrade example to react-native 0.65.1

* Update Podfile.lock

* Update Podfile.lock

* add `jcenter()` temporarily

* upgrade gradle tools (kotlin, build-tools, swipe-to-refresh)

* Upgrade `react-native-navigation` to `7.18.1-snapshot.1611`

* chore(deps): Upgrade a few more deps
2021-08-20 11:53:40 +02:00
Marc Rousavy
8e02b49c16
chore(deps): Upgrade CameraX to alpha08 (#377) 2021-08-20 11:07:20 +02:00
Marc Rousavy
494925c96e
fix: Always return authorized for requestPermission on SDK 22 and below (#344) 2021-08-09 11:43:56 +02:00
dependabot[bot]
80f87bfc77
chore(deps): bump exifinterface from 1.3.2 to 1.3.3 in /android (#327)
Bumps exifinterface from 1.3.2 to 1.3.3.

---
updated-dependencies:
- dependency-name: androidx.exifinterface:exifinterface
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-06 10:44:57 +02:00
Marc Rousavy
37db643f71
fix: Fix format Preview and Video Capture resolution setting (#325)
* fix: Actually use a format's `videoSize` for Preview/Video Capture

* `setDefaultResolution` -> `setTargetResolution`
2021-08-05 15:54:01 +02:00
Marc Rousavy
1c32726ef6
fix: Throw JS errors if JSI <-> JNI conversion failed (#324) 2021-08-05 10:10:49 +02:00
Marc Rousavy
b493576373
fix: Fix java.lang.NoSuchMethodError error for .toArrayList() (#322)
* fix: Fix `java.lang.NoSuchMethodError` error for `.toArrayList()`

* Fix `HashMap<K, V>` conversion to `jsi::Object`

* Update FRAME_PROCESSORS_CREATE_OVERVIEW.mdx
2021-08-04 16:07:08 +02:00
Marc Rousavy
aaecb90937
fix: Fix dead link in parallel-video-processing-not-supported error 2021-08-02 11:21:23 +02:00
Marc Rousavy
0f7ee51333
feat: Add console logging support for Frame Processors (#297)
* Try to log to console via runOnJS

* Call `console.log`

* Create custom `VisionCameraScheduler`

* Fix scheduler call

* Call with this

* Fix console setting

* Move J---- to `java-bindings`

* c++ style

* Android: 1/2 Create custom Scheduler

* Android: 2/2 Use custom Scheduler

* Don't use `runOnJS`, use `__callAsync` directly
2021-07-30 10:27:45 +02:00
Marc Rousavy
123d0d9e9c
chore(deps): Upgrade react-native-reanimated to alpha.2 (#309)
* Upgrade react-native-reanimated to alpha.2

* fix Android header search path

* Make `const`
2021-07-30 09:50:09 +02:00
Marc Rousavy
445af943c3
feat: BREAKING CHANGE: Express zoom factor always in actual factor value (1, 2, 128, ...) instead of 0.0-1.0 scale (#306)
* Make `zoom` go on "factor" scale

* Clean up `zoom` code

* fix float conversion

* fix zoom interpretation

* Update docs for new zoom scale

* fix float conversion
2021-07-29 11:44:22 +02:00
Marc Rousavy
ef455df865
feat: Support rotation (#301)
* feat: Android: Listen to rotation changes

* Only change rotation on configuration change

* feat: iOS: Support Rotation

* Swift lint
2021-07-26 11:32:58 +02:00
Marc Rousavy
159ff44de3
chore(deps): Upgrade CameraX to 7 (#300) 2021-07-26 10:23:18 +02:00
Marc Rousavy
5eaed05f47
fix: Fix "REACT_NATIVE_UTILS_LIB not found" build error (#295)
* Remove `REACT_NATIVE_UTILS_LIB`

* Clean up CMakeLists.txt
2021-07-23 14:28:38 +02:00
Marc Rousavy
4b4ea0ff33
fix: Fix UI Thread race condition in setFrameProcessor(...) (#265)
* fix: Fix UI Thread race condition in `setFrameProcessor(...)`

* Revert "fix: Fix UI Thread race condition in `setFrameProcessor(...)`"

This reverts commit 9c524e123cff6843d7d11db602a5027d1bb06b4b.

* Use `setImmediate` to call `setFrameProcessor(...)`

* Fix frame processor order of applying

* Add `enableFrameProcessor` prop that defines if a FP is added

* rename constant

* Implement `enableFrameProcessor` prop for Android and make `frameProcessorFps` faster

* link to troubleshooting guide

* Update TROUBLESHOOTING.mdx

* Add logs for use-cases

* fix log

* set initial frame processor in `onLayout` instead of `componentDidMount`
2021-07-12 15:16:03 +02:00
Marc Rousavy
66f22d7b21 fix: Only extract either JSC or Hermes REA .aar 2021-07-08 11:12:26 +02:00
Marc Rousavy
b2f3c08a07
fix: Distribute Android code as source (#234)
* Build Android as source

* more reliably find `enableHermes`
2021-07-08 10:52:14 +02:00
dependabot[bot]
63053f8650
chore(deps): bump gradle-download-task from 4.1.1 to 4.1.2 in /android (#262)
Bumps [gradle-download-task](https://github.com/michel-kraemer/gradle-download-task) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/michel-kraemer/gradle-download-task/releases)
- [Commits](https://github.com/michel-kraemer/gradle-download-task/compare/4.1.1...4.1.2)

---
updated-dependencies:
- dependency-name: de.undercouch:gradle-download-task
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-08 10:50:38 +02:00
Marc Rousavy
2f889f5855
fix: Fix hot-reload crash caused by Frame Processor Runtime being initialized twice (#258)
* Fix Frame Processor Runtime being initialized twice causing a hot-reload to crash

* Remove unnecessary `HasRegisteredPlugins` singleton

* make non-optional

* `REACT_CLASS` -> `TAG`

* fix nullable
2021-07-07 15:00:32 +02:00
Marc Rousavy
3007cd9430 fix: Add @Keep annotation to prevent minifier from deleting java funcs 2021-07-07 13:18:38 +02:00
Marc Rousavy
7a5e879b92 fix: Fix lint error for missing JNI func (3) 2021-07-07 13:17:41 +02:00
Marc Rousavy
91e81d7594 fix: Fix lint error for missing JNI func (2) 2021-07-07 13:16:19 +02:00
Marc Rousavy
1730ce8980 fix: Fix lint error for missing JNI func 2021-07-07 13:15:32 +02:00
Marc Rousavy
339b470ca5 fix: Fix wrong HDR error being thrown on LowLight mode 2021-07-07 13:14:36 +02:00
Marc Rousavy
1e64215d37
chore(deps): upgrade camerax (#257)
* Upgrade CameraX to alpha6

* Upgrade CameraX extensions to alpha26

* `init` -> `getInstance`

* Use new Extensions API

* Update CameraView.kt

* use new ExtensionsManager API in `getAvailableCameraDevices()`

* fix cpplint errors
2021-07-07 12:57:28 +02:00
Marc Rousavy
2fa0f8fd46
chore: Clean up root directory (#236)
* Clean up root

* remove unused REA patches

* Remove `cpp/` and create headers per platform

* fix `#import`

* fix `VISION_CAMERA_DISABLE_FRAME_PROCESSORS`
2021-07-06 16:42:58 +02:00
Marc Rousavy
fa5f5c0cab
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`
2021-07-06 10:08:44 +02:00
Marc Rousavy
bfb1b67c2f Update FrameProcessorRuntimeManager.cpp 2021-06-29 10:38:35 +02:00
Marc Rousavy
5ab1a72e01 chore: Fix C++ indents 2021-06-29 10:38:13 +02:00
Marc Rousavy
45fad5ab19 fix: Add more logs 2021-06-29 10:36:39 +02:00
Marc Rousavy
359fd00c73 fix: print stacktrace on error 2021-06-29 10:34:48 +02:00
Marc Rousavy
f1a5ee7ee1 fix: Log errors in update and configureSession 2021-06-29 10:18:39 +02:00
Marc Rousavy
f07f4a8770 fix: Correctly propagate Errors in configureSession() 2021-06-29 10:16:38 +02:00
Marc Rousavy
f80e606c6d fix: Report all errors to JS in configureSession 2021-06-29 10:14:33 +02:00
Marc Rousavy
da84a0fd42 perf: Avoid error message copying 2021-06-28 20:45:08 +02:00
Marc Rousavy
4bacee796a feat: Print Frame Processor errors to Metro console 2021-06-28 20:44:50 +02:00
Marc Rousavy
26d19d5152 perf: Remove a few unnecessary log statements 2021-06-28 18:30:42 +02:00
Marc Rousavy
e13bef7d17 fix: Host Object error 2021-06-28 10:19:19 +02:00