Commit Graph

1011 Commits

Author SHA1 Message Date
Marc Rousavy
0d83a13196
feat: New CameraDevice + CameraFormat detection using CameraX (#1495)
* Create CameraDevice.kt

* Create VideoStabilizationMode+String.kt

* Use CameraX Extensions

* Remove `system/no-camera-manager` error
2023-03-13 09:23:19 -04:00
Marc Rousavy
f791c6b4cd
feat: Better Native Module Error Detection (#1515)
* feat: Add more Error insights when the Camera Module cannot be found

* Assert JSI is available

* Update error description

* fix

* Update CameraError.ts
2023-03-13 09:21:08 -04:00
Marc Rousavy
06cbb742fb docs: Add V3 Announcement Banner 2023-03-08 12:11:03 +01:00
Marc Rousavy
c2fb5bf156 docs: fix baseUrl 2023-03-08 09:26:24 +01:00
Marc Rousavy
6fa8b7f26e docs: Add robots.txt 2023-03-08 09:25:12 +01:00
Marc Rousavy
35c779b1ad docs: Add @vercel/analytics 2023-03-07 11:53:32 +01:00
Marc Rousavy
73c5d675f2 docs: fix algolia app ID 2023-03-06 12:19:30 +01:00
Marc Rousavy
815e47b249 Add og:image to theme config 2023-03-06 11:43:39 +01:00
Marc Rousavy
22c0c029c8 docs: Add og:image 2023-03-06 11:42:01 +01:00
Marc Rousavy
77dd181da9 docs: fix meta 2023-03-06 11:40:46 +01:00
Marc Rousavy
ba20e76d38 remove build docs 2023-03-06 11:36:00 +01:00
Marc Rousavy
ab757125b5
docs: Upgrade Docusaurus (#1513)
* Add sitemaps plugin

* Update docusaurus.config.js

* Update libs

* Add OpenGraph metadata

* use same url
2023-03-06 11:25:44 +01:00
Marc Rousavy
757ecb0640 docs: Deploy to https://react-native-vision-camera.com 2023-03-06 11:03:40 +01:00
Marc Rousavy
622d3830f1
feat: Make Frame Processor Plugins object-oriented on iOS as well (#1496)
* feat: Make Frame Processor Plugins object-oriented on iOS as well

* Add Plugin in AppDelegate
2023-02-27 11:18:03 +01:00
Marc Rousavy
566eda2395 docs: Run yarn install for root as well 2023-02-25 12:00:49 +01:00
Marc Rousavy
61f19df500 fix: Remove RN Skia dependency on Android for now 2023-02-23 17:43:24 +01:00
Marc Rousavy
f227a3e396 fix: Catch device == null error 2023-02-23 14:57:57 +01:00
Marc Rousavy
ad5d64b01f fix: ignore duplicate .so libraries in package 2023-02-22 12:28:51 +01:00
Marc Rousavy
cf19ff2e5a fix: Fix Android namespace 2023-02-21 15:54:04 +01:00
Marc Rousavy
0c3cd66016
fix: Improve C++ safety by attaching Cache Invalidator to jsi::Runtime's lifecycle (#1488)
* fix: fix C++ lint

* fix: attach `InvalidateCacheOnDestroy` to `jsi::Runtime`
2023-02-21 15:44:43 +01:00
Marc Rousavy
1ddea178ae chore: release 3.0.0-rc.2 2023-02-21 15:09:55 +01:00
Marc Rousavy
12f850c8e1
feat: Draw onto Frame as if it was a Skia Canvas (#1479)
* Create Shaders.ts

* Add `previewType` and `enableFpsGraph`

* Add RN Skia native dependency

* Add Skia Preview View on iOS

* Pass 1

* Update FrameHostObject.mm

* Wrap Canvas

* Lockfiles

* fix: Fix stuff

* chore: Upgrade RNWorklets

* Add `previewType` to set the Preview

* feat: Add Example

* Update project.pbxproj

* `enableFpsGraph`

* Cache the `std::shared_ptr<FrameHostObject>`

* Update CameraView+RecordVideo.swift

* Update SkiaMetalCanvasProvider.mm

* Android: Integrate Skia Dependency

* fix: Use new Prefix

* Add example for rendering shader

* chore: Upgrade CameraX

* Remove KTX

* Enable `viewBinding`

* Revert "Enable `viewBinding`"

This reverts commit f2a603f53b33ea4311a296422ffd1a910ce03f9e.

* Revert "chore: Upgrade CameraX"

This reverts commit 8dc832cf8754490d31a6192e6c1a1f11cdcd94fe.

* Remove unneeded `ProcessCameraProvider.getInstance()` call

* fix: Add REA hotfix patch

* fix: Fix FrameHostObject dead in runAsync

* fix: Make `runAsync` run truly async by dropping new Frames while executing

* chore: Upgrade RN Worklets to latest

* chore: Upgrade RN Skia

* Revert "Remove KTX"

This reverts commit 253f586633f7af2da992d2279fc206dc62597129.

* Make Skia optional in CMake

* Fix import

* Update CMakeLists.txt

* Update build.gradle

* Update CameraView.kt

* Update CameraView.kt

* Update CameraView.kt

* Update Shaders.ts

* Center Blur

* chore: Upgrade RN Worklets

* feat: Add `toByteArray()`, `orientation`, `isMirrored` and `timestamp` to `Frame` (#1487)

* feat: Implement `orientation` and `isMirrored` on Frame

* feat: Add `toArrayBuffer()` func

* perf: Do faster buffer copy

* feat: Implement `toArrayBuffer()` on Android

* feat: Add `orientation` and `isMirrored` to Android

* feat: Add `timestamp` to Frame

* Update Frame.ts

* Update JImageProxy.h

* Update FrameHostObject.cpp

* Update FrameHostObject.cpp

* Update CameraPage.tsx

* fix: Format Swift
2023-02-21 15:00:48 +01:00
Marc Rousavy
1f7a2e07f2 fix: Fix global.FrameProcessorPlugins TS error 2023-02-15 19:15:36 +01:00
Marc Rousavy
0635d4aba0 fix: Add missing <regex> header 2023-02-15 19:13:33 +01:00
Marc Rousavy
2909085ea6 chore: release 3.0.0-rc.1 2023-02-15 18:23:05 +01:00
Marc Rousavy
770357fd94 chore: Bump to 3.0.0-rc.0 2023-02-15 18:21:33 +01:00
Marc Rousavy
222ded4728 fix: Prevent possible crash in log error handler 2023-02-15 18:15:13 +01:00
Marc Rousavy
6825c1f587 fix: Print correct error in build.gradle 2023-02-15 17:39:46 +01:00
Marc Rousavy
f0ea18115e
fix: Fix CI for V3 (#1475)
* fix: Fix CI for "Build Android"

* update versions

* Update Gemfile.lock

* format swift

* fix: Fix swift lint

* Update .swiftlint.yml

* Use C++17 for lint

* fix: Fix C++ lints
2023-02-15 17:24:33 +01:00
Marc Rousavy
30b56153db
feat: Sync Frame Processors (plus runAsync and runAtTargetFps) (#1472)
Before, Frame Processors ran on a separate Thread.

After, Frame Processors run fully synchronous and always at the same FPS as the Camera.

Two new functions have been introduced:

* `runAtTargetFps(fps: number, func: () => void)`: Runs the given code as often as the given `fps`, effectively throttling it's calls.
* `runAsync(frame: Frame, func: () => void)`: Runs the given function on a separate Thread for Frame Processing. A strong reference to the Frame is held as long as the function takes to execute.

You can use `runAtTargetFps` to throttle calls to a specific API (e.g. if your Camera is running at 60 FPS, but you only want to run face detection at ~25 FPS, use `runAtTargetFps(25, ...)`.)

You can use `runAsync` to run a heavy algorithm asynchronous, so that the Camera is not blocked while your algorithm runs. This is useful if your main sync processor draws something, and your async processor is doing some image analysis on the side. 

You can also combine both functions.

Examples:

```js
const frameProcessor = useFrameProcessor((frame) => {
  'worklet'
  console.log("I'm running at 60 FPS!")
}, [])
```

```js
const frameProcessor = useFrameProcessor((frame) => {
  'worklet'
  console.log("I'm running at 60 FPS!")

  runAtTargetFps(10, () => {
    'worklet'
    console.log("I'm running at 10 FPS!")
  })
}, [])
```



```js
const frameProcessor = useFrameProcessor((frame) => {
  'worklet'
  console.log("I'm running at 60 FPS!")

  runAsync(frame, () => {
    'worklet'
    console.log("I'm running on another Thread, I can block for longer!")
  })
}, [])
```

```js
const frameProcessor = useFrameProcessor((frame) => {
  'worklet'
  console.log("I'm running at 60 FPS!")

  runAtTargetFps(10, () => {
    'worklet'
    runAsync(frame, () => {
      'worklet'
      console.log("I'm running on another Thread at 10 FPS, I can block for longer!")
    })
  })
}, [])
```
2023-02-15 16:47:09 +01:00
Marc Rousavy
a0590dccb5
feat: Replace Reanimated with RN Worklets (#1468)
* Setup RN Worklets

* Use RN Worklets on iOS

* Fix console

* Add `installFrameProcessorBindings()` function

* Add `FrameProcessorPlugins` proxy (BREAKING CHANGE)

* Clean up docs

* Update FRAME_PROCESSORS.mdx

* Use RN Worklets 0.2.5

* feat: Android build setup

* Rewrite Android Frame Processor Part

* Update CMakeLists.txt

* fix: Add react-native-worklets Gradle dependency

* Update Podfile.lock

* fix build

* gradle:7.4.1

* Init JSI Bindings in method on Android

* Fix Folly flags

* fix: Init `FrameProcessorRuntimeManager` later

* fix: Wrap in `<GestureHandlerRootView>`

* Refactor plugins

* fix: Remove enableFrameProcessors

* Install RN Worklets from current GH master

* Update babel.config.js

* Update CameraViewModule.kt

* Update ImageProxyUtils.java

* feat: Upgrade to Reanimated v3

* fix: Fix crash on Worklet init

* Update RN Worklets to latest master

* fix: Simplify FP Plugins Proxy
2023-02-13 15:22:45 +01:00
Marc Rousavy
11d1e7178d
chore: Upgrade to RN 71 (#1465)
* chore: Upgrade Example to RN 0.71

* chore: Upgrade all libs

* fix: Fix CameraRoll installation

* Update Gradle Tools

* fix: Fix buildscripts

* Clean out build.gradle

* fix: Fix Kotlin setup

* fix: Move kotlin-android dependency to lib

* Move `_setGlobalConsole`

* Update gradle-wrapper.properties

* Rebuild lockfiles

* chore: Update build:gradle

* Update StatusBarBlurBackground.tsx

* Use Java 11 in Workflows

* Update MediaPage.tsx

* Add `google` repository to build.gradle

* Double Java Heap size

* Increase heap size

* Alternative args

* Update build.gradle
2023-02-09 11:52:41 +01:00
mrousavy
28a43f716f chore: Drop support for RN < 71 to simplify buildscript 2023-02-08 17:48:22 +01:00
Marc Rousavy
9963f4dedc chore: release 2.15.4 2023-02-01 16:37:53 +01:00
zzz08900
6a094bf1b0
fix: Fix Android build error on RN < 0.71 (#1447) 2023-02-01 16:37:18 +01:00
Marc Rousavy
a1a2cdc246 chore: release 2.15.3 2023-01-30 19:39:46 +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
Marc Rousavy
ae2c28a2c2
Add VisionCamera V3 link to README 2022-12-06 15:45:52 +01:00
Marc Rousavy
231838772c Update Podfile.lock 2022-11-30 12:06:11 +01:00
Marc Rousavy
938cb2e42a Update CameraView+Orientation.swift 2022-11-25 15:40:07 +01:00
Marc Rousavy
bf71901968 fix: Fix orientation glitching on first frame 2022-11-25 15:39:40 +01:00
Marc Rousavy
a65b8720bd chore: release 2.15.2 2022-10-31 13:05:21 +01:00
Al Mochkin
045794c979
fix: Update CLANG_CXX_LANGUAGE_STANDARD to C++17 (#1309) 2022-10-31 13:04:07 +01:00
LazyAfternoons
3416e94b18
fix: Use +load for registering Frame Processors (#1308)
Fixes crash with Xcode 14
2022-10-28 13:12:44 +02:00
Rohan Barman
6b32cd9cd7
docs: Replace outdated react-native-reanimated doc links (#1304) 2022-10-28 12:18:36 +02: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
1d6f720f8b chore: release 2.15.1 2022-10-24 14:10:30 +02:00
Marc Rousavy
a7932bdc98
fix: Support new Reanimated Headers directory (2.11.10+) (#1301) 2022-10-24 14:09:56 +02:00
Marc Rousavy
849aa3ebaf chore: release 2.15.0 2022-10-20 12:50:08 +02:00
Thomas Coldwell
52a1d50d91
fix: Frame Processor FPS (#1288)
* fix: Build using XCode 14

* fix: Throttle FP by start time rather than end time
2022-10-20 12:49:22 +02:00