Commit Graph

27 Commits

Author SHA1 Message Date
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
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
159ff44de3
chore(deps): Upgrade CameraX to 7 (#300) 2021-07-26 10:23:18 +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
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
87e6bb710e
feat: Frame Processors for Android (#196)
* Create android gradle build setup

* Fix `prefab` config

* Add `pickFirst **/*.so` to example build.gradle

* fix REA path

* cache gradle builds

* Update validate-android.yml

* Create Native Proxy

* Copy REA header

* implement ctor

* Rename CameraViewModule -> FrameProcessorRuntimeManager

* init FrameProcessorRuntimeManager

* fix name

* Update FrameProcessorRuntimeManager.h

* format

* Create AndroidErrorHandler.h

* Initialize runtime and install JSI funcs

* Update FrameProcessorRuntimeManager.cpp

* Update CameraViewModule.kt

* Make CameraView hybrid C++ class to find view & set frame processor

* Update FrameProcessorRuntimeManager.cpp

* pass function by rvalue

* pass by const &&

* extract hermes and JSC REA

* pass `FOR_HERMES`

* correctly prepare JSC and Hermes

* Update CMakeLists.txt

* add missing hermes include

* clean up imports

* Create JImageProxy.h

* pass ImageProxy to JNI as `jobject`

* try use `JImageProxy` C++ wrapper type

* Use `local_ref<JImageProxy>`

* Create `JImageProxyHostObject` for JSI interop

* debug call to frame processor

* Unset frame processor

* Fix CameraView native part not being registered

* close image

* use `jobject` instead of `JImageProxy` for now :(

* fix hermes build error

* Set enable FP callback

* fix JNI call

* Update CameraView.cpp

* Get Format

* Create plugin abstract

* Make `FrameProcessorPlugin` a hybrid object

* Register plugin CXX

* Call `registerPlugin`

* Catch

* remove JSI

* Create sample QR code plugin

* register plugins

* Fix missing JNI binding

* Add `mHybridData`

* prefix name with two underscores (`__`)

* Update CameraPage.tsx

* wrap `ImageProxy` in host object

* Use `jobject` for HO box

* Update JImageProxy.h

* reinterpret jobject

* Try using `JImageProxy` instead of `jobject`

* Update JImageProxy.h

* get bytes per row and plane count

* Update CameraView.cpp

* Return base

* add some docs and JNI JSI conversion

* indent

* Convert JSI value to JNI jobject

* using namespace facebook

* Try using class

* Use plain old Object[]

* Try convert JNI -> JSI

* fix decl

* fix bool init

* Correctly link folly

* Update CMakeLists.txt

* Convert Map to Object

* Use folly for Map and Array

* Return `alias_ref<jobject>` instead of raw `jobject`

* fix JNI <-> JSI conversion

* Update JSIJNIConversion.cpp

* Log parameters

* fix params index offset

* add more test cases

* Update FRAME_PROCESSORS_CREATE_OVERVIEW.mdx

* fix types

* Rename to example plugin

* remove support for hashmap

* Try use HashMap iterable fbjni binding

* try using JReadableArray/JReadableMap

* Fix list return values

* Update JSIJNIConversion.cpp

* Update JSIJNIConversion.cpp

* (iOS) Rename ObjC QR Code Plugin to Example Plugin

* Rename Swift plugin QR -> Example

* Update ExamplePluginSwift.swift

* Fix Map/Dictionary logging format

* Update ExampleFrameProcessorPlugin.m

* Reconfigure session if frame processor changed

* Handle use-cases via `maxUseCasesCount`

* Don't crash app on `configureSession` error

* Document "use-cases"

* Update DEVICES.mdx

* fix merge

* Make `const &`

* iOS: Automatically enable `video` if a `frameProcessor` is set

* Update CameraView.cpp

* fix docs

* Automatically fallback to snapshot capture if `supportsParallelVideoProcessing` is false.

* Fix lookup

* Update CameraView.kt

* Implement `frameProcessorFps`

* Finalize Frame Processor Plugin Hybrid

* Update CameraViewModule.kt

* Support `flash` on `takeSnapshot()`

* Update docs

* Add docs

* Update CameraPage.tsx

* Attribute NonNull

* remove unused imports

* Add Android docs for Frame Processors

* Make JNI HashMap <-> JSI Object conversion faster

directly access `toHashMap` instead of going through java

* add todo

* Always run `prepareJSC` and `prepareHermes`

* switch jsc and hermes

* Specify ndkVersion `21.4.7075529`

* Update gradle.properties

* Update gradle.properties

* Create .aar

* Correctly prepare android package

* Update package.json

* Update package.json

* remove `prefab` build feature

* split

* Add docs for registering the FP plugin

* Add step for dep

* Update CaptureButton.tsx

* Move to `reanimated-headers/`

* Exclude reanimated-headers from cpplint

* disable `build/include_order` rule

* cpplint fixes

* perf: Make `JSIJNIConversion` a `namespace` instead of `class`

* Ignore runtime/references for `convert` funcs

* Build Android .aar in CI

* Run android build script only on `prepack`

* Update package.json

* Update package.json

* Update build-android-npm-package.sh

* Move to `yarn build`

* Also install node_modules in example step

* Update validate-android.yml

* sort imports

* fix torch

* Run ImageAnalysis on `FrameProcessorThread`

* Update Errors.kt

* Add clean android script

* Upgrade reanimated to 2.3.0-alpha.1

* Revert "Upgrade reanimated to 2.3.0-alpha.1"

This reverts commit c1d3bed5e03728d0b5e335a359524ff4f56f5035.

* ⚠️ TEMP FIX: hotfix reanimated build.gradle

* Update CameraView+TakeSnapshot.kt

* ⚠️ TEMP FIX: Disable ktlint action for now

* Update clean.sh

* Set max heap size to 4g

* rebuild lockfiles

* Update Podfile.lock

* rename

* Build lib .aar before example/
2021-06-27 12:37:54 +02:00
Marc Rousavy
232801439b
chore(deps): Upgrade CameraX to alpha05 (#180) 2021-06-07 13:15:49 +02:00
Marc Rousavy
a0e063414a
chore(deps): Bump Android native dependencies (#150)
* Bump gradle build-tools to 4.2.1

* Bump kotlinx coroutines to 1.5.0

* Bump Kotlin to 1.5.0

* Replace `jcenter` with `mavenCentral`

* Upgrade Kotlin to 1.5.10

* Upgrade gradle plugin to 4.2.1

* Revert "Upgrade gradle plugin to 4.2.1"

This reverts commit 0946110ff442ddd24f2f3f31e7587851d7626c9e.

* Revert "Upgrade Kotlin to 1.5.10"

This reverts commit 2b11c5c911397d1db1ea7a24fb8c8634a25b5c76.

* Revert "Replace `jcenter` with `mavenCentral`"

This reverts commit 3e40b516619067c0d9da1abf3cfeb9acb6102c71.
2021-05-27 11:29:52 +02:00
dependabot[bot]
c3ff25de41
Bump gradle from 4.1.3 to 4.2.0 in /android (#132)
* Bump gradle from 4.1.3 to 4.2.0 in /android

Bumps gradle from 4.1.3 to 4.2.0.

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

* update gradle wrapper

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marc Rousavy <marcrousavy@hotmail.com>
2021-05-05 10:41:42 +02:00
Marc Rousavy
f2a89570c5
Upgrade CameraX to 1.1.0-alpha04 (#128)
* Upgrade CameraX to 1.1.0-alpha4

* Upgrade Kotlin to 1.4.32

* Suppress `UnsafeOptInUsageError` CameraSelector override

* Suppress `UnsafeOptInUsageError` for takePhoto

* Suppress `MissingPermission` for recordVideo

* Remove unreported lint suppressions
2021-04-26 12:56:36 +02:00
Marc Rousavy
a9ef57097a Bump CameraX version (alpha03) 2021-03-25 10:19:56 +01:00
Marc Rousavy
35806ff660
Upgrade Example to RN 0.64 (#83)
* ReactLogger: Also log function

* Run SwiftFormat & SwiftLint in example project

* Upgrade to RN 0.64 1/2

* Update lockfiles

* Upgrade a few packages

* index.tsx -> index.js

* Upgrade docusaurus

* Fix line length violation

* Update CameraView.swift

* Update gradle plugin

* Fix example to prefer higher res cameras

* Remove unused log line

* Update App.tsx
2021-03-19 15:53:19 +01:00
Marc Rousavy
51d4ce51e0 Use JRE Kotlin instead of Kotlin/Native 2021-03-09 13:08:30 +01:00
Marc Rousavy
588f54ad4e Remove ktlint from build.gradle 2021-03-09 13:08:20 +01:00
Marc Rousavy
4639a79139 Android: Use kotlinx-coroutines-android instead of core (fixes #9) 2021-03-09 12:21:27 +01:00
dependabot[bot]
5a41b81ce8
Bump kotlinx-coroutines-core from 1.4.2 to 1.4.3-native-mt in /android (#19)
Bumps [kotlinx-coroutines-core](https://github.com/Kotlin/kotlinx.coroutines) from 1.4.2 to 1.4.3-native-mt.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-04 13:22:13 +01:00
dependabot[bot]
2e6986d838
Bump kotlinx-coroutines-guava from 1.4.2 to 1.4.3-native-mt in /android (#18)
Bumps [kotlinx-coroutines-guava](https://github.com/Kotlin/kotlinx.coroutines) from 1.4.2 to 1.4.3-native-mt.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-04 13:20:43 +01:00
Marc Rousavy
6438b9a8bc
Bump CameraX versions to alpha2/alpha22 (#7)
* Bump CameraX versions to alpha2/alpha22
* Use `setDefaultResolution` to set format's photoSize
2021-02-26 17:34:28 +01:00
Marc Rousavy
03b9246afe
Devops: KTLint to lint Kotlin code (#6)
* Adds KTLint as a GitHub action
* Adds KTLint to the gradle project for IDE integration
* Adds .editorconfig to configure KTLint (android/)
2021-02-26 10:56:20 +01:00
Marc Rousavy
695f98f551 Set minSdkVersion to 21 2021-02-19 20:54:55 +01:00
Marc Rousavy
25a7e3f267 Bump gradle build tools to 4.1.2 (gradle 6.5) 2021-02-19 20:46:23 +01:00
Marc Rousavy
1ad68463f3 Use gradle 3.2.1 instead of 4.1.2 2021-02-19 20:43:37 +01:00
Marc Rousavy
71dc48a8b4 Add gradle dependencies 2021-02-19 20:36:49 +01:00
Marc Rousavy
c04a4b72be Bootstrap 2021-02-19 16:07:53 +01:00