Commit Graph

1385 Commits

Author SHA1 Message Date
Marc Rousavy
297abae6bb
docs: Upgrade to Docusaurus 3 (#1783)
* docs: Upgrade to latest Docusaurus/Typedoc

* chore: Re-run typedoc

* docs: Upgrade to Docusaurus 3

* Add `docs/api/` to gitignore

* Remove `docs` from git

* Remove V3 banner

* fix: Export `PixelFormat`
2023-09-11 11:45:17 +02:00
Marc Rousavy
a4ace351fa
fix: Consider everything between 24mm and 43mm a wide-angle lense (#1782)
* fix: Consider everything between 24mm and 43mm a wide-angle lense

* chore: Use Kotlin when API instead

* Use floats

* Catch error
2023-09-11 11:33:02 +02:00
Marc Rousavy
f69e3dff36 docs: Add emojis to README 2023-09-07 11:54:45 +02:00
Vojtech Novak
eddb01fda1
fix: Fix potential bug in Photo Orientation (#1765) 2023-09-06 11:30:58 +02:00
rkmackinnon
6dd1d4147e
fix: Fix passing options to frame processors on iOS (#1750) 2023-09-06 11:27:35 +02:00
Marc Rousavy
ca7c8ab22d
chore: Use new Android Lint CI (#1761)
* chore: Use new Android Lint CI

* Update validate-android.yml
2023-09-06 11:01:36 +02:00
Marc Rousavy
b4b0e49eb5
fix: Also properly convert any[] -> List<Object> in FP Android (#1760)
* fix: Also properly convert `any[]` -> `List<Object>` in FP Android

* Format C++

* fix: Add missing return
2023-09-06 10:56:33 +02:00
Marc Rousavy
b300209e36
docs: Restructure FP docs (#1762) 2023-09-04 14:45:21 +02:00
Marc Rousavy
f3fd3f15e3
chore: Clean up Android codebase a bit (#1748)
<!--
                    ❤️ Thank you for your contribution! ❤️
              Make sure you have read the Contributing Guidelines:

https://github.com/mrousavy/react-native-vision-camera/blob/main/CONTRIBUTING.md
-->

## What

<!--
  Enter a short description on what this pull-request does.
  Examples:
    This PR adds support for the HEVC format.
    This PR fixes a "unsupported device" error on iPhone 8 and below.
    This PR fixes a typo in a CameraError.
    This PR adds support for Quadruple Cameras.
-->

## Changes

<!--
  Create a short list of logic-changes.
  Examples:
    * This PR changes the default value of X to Y.
    * This PR changes the configure() function to cache results.
-->

## Tested on

<!--
Create a short list of devices and operating-systems you have tested
this change on. (And verified that everything works as expected).
  Examples:
    * iPhone 11 Pro, iOS 14.3
    * Huawai P20, Android 10
-->

## Related issues

<!--
  Link related issues here.
  Examples:
    * Fixes #29
    * Closes #30
    * Resolves #5
-->
2023-09-02 01:04:36 +02:00
Marc Rousavy
272504f39d Add Discord link 2023-09-02 00:54:09 +02:00
Marc Rousavy
f2c41e333c
Update config.yml 2023-09-01 23:52:10 +02:00
Marc Rousavy
84272d2a2a
Update BUILD_ERROR.yml 2023-09-01 23:49:23 +02:00
Marc Rousavy
ba6ec0dc0d Use <picture> again 2023-09-01 21:42:11 +02:00
Marc Rousavy
d7bea8cf3b
Update README.md 2023-09-01 21:29:36 +02:00
Marc Rousavy
9ec3ee68f5 Update README.md 2023-09-01 21:27:13 +02:00
Marc Rousavy
620b49ee0a chore: release 3.0.0 2023-09-01 20:35:24 +02:00
Marc Rousavy
10cc59ab43 docs: Add note about V2 2023-09-01 20:32:04 +02:00
Marc Rousavy
02a0371c65
feat: V3 (#1466)
See https://github.com/mrousavy/react-native-vision-camera/issues/1376

## Breaking Changes

* Frame Processors are now **synchronous**. Previously they ran on a
separate Thread. If you want to run something on a separate Thread now,
use `runAsync` inside a Frame Processor
* Frame Processor Plugins are no longer in the global object with the
`__` prefix, but rather stored directly in the `FrameProcessorPlugins`
object exported by react-native-vision-camera. (e.g. replace
`__scanQRCodes(frame)` with `FrameProcessorPlugins.scanQRCodes(frame)`)
* `frameProcessorFps` no longer exists. Use `runAtTargetFps` inside a
Frame Processor to throttle some calls.
* `onFrameProcessorPerformanceSuggestionAvailable` no longer exists. Use
the FPS display (`enableFpsGraph={true}`) to see how your Frame
Processor performs over time. This is more in-line with how React Native
works (Dev Tools / Perf Monitor)
* VisionCamera V3 will not work on RN 0.70 or below. You need to use RN
0.71. This is because the build script got way simpler and smaller,
making it faster to build and way less error prone. Backwards
compatibility is just too complex here.
* Reanimated is no longer used as a Worklet Runtime. Instead,
VisionCamera now uses
[react-native-worklets-core](https://github.com/margelo/react-native-worklets-core).

## Progress

You can test the latest V3 release by creating a new RN project with RN
0.71 and installing VisionCamera + RNWorklets:

```sh
yarn add react-native-vision-camera@3.0.0-rc.5
yarn add react-native-worklets-core
yarn add @shopify/react-native-skia
```

Things to test:

* TensorFlow Lite plugin to load any `.tflite` model!!  (see [this PR
for more
info](https://github.com/mrousavy/react-native-vision-camera/pull/1633),
will be a separate library soon)
* Drawing onto a Frame using Skia!! 🎉 
* Using `frame.toArrayBuffer()` to get the Frame's byte content in JS
* New Android build script. This should drastically speed up the build
time! 💨
* New Worklet library. This replaces Reanimated Worklets. Should be
faster and more stable :)
* New synchronous Frame Processors. Should be faster :)
* `runAtTargetFps` and `runAsync` in Frame Processors
* Using HostObjects or HostFunctions (like models from PyTorch) inside a
Frame Processor. This will probably require a few native bindings on
PyTorch's end to make the integration work (cc @raedle)

Overall V3 is close to completion. I have a few things to do the coming
days so not sure how much work I can put into this. **If anyone wants to
support the development of v3, I'd appreciate donations / sponsors:
https://github.com/sponsors/mrousavy** ❤️ :)


## Related issues 

features

- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/1376
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/281
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/211
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/130
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/117
- fixes https://github.com/mrousavy/react-native-vision-camera/issues/76
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/75
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/562
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/565
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/570
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/287
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/311
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/315
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/323
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/340
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/354
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/420
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/434
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/452
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/496
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/497
- resolves
https://github.com/mrousavy/react-native-vision-camera/issues/499
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/516
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/527
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/542
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/548
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/561
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/740
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/770


...and then pretty much every Android issue lol

- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1675
(**maybe**, please test @PrernaBudhraja)
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1671

.. maybe also (not tested):

- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1698
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1687
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1685
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1681
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1650
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1646
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1635
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1631
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1621
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1615
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1612
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1605
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1599
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1585
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1581
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1569
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1568
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1565
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1561
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1558
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1554
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1551
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1547
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1543
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1538
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1536
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1534
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1528
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1520
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1498
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1489
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1477
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1474
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1463
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1462
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1449
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1443
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1437
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1431
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1429
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1427
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1423
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1416
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1407
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1403
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1402
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1398
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1396
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1395
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1379
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1377
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1374
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1373
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1365
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1356
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1353
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1352
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1351
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1343
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1340
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1334
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1330
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1322
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1296
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1283
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1260
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1253
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1251
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1245
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1238
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1227
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1226
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1225
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1222
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1211
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1208
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1193
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1191
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1184
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1164
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1143
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1128
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1122
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1120
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1110
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1097
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1081
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1080
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1064
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1053
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1047
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1044
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1032
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1026
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1023
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1015
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/1012
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/997
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/960
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/959
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/954
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/946
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/945
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/922
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/908
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/907
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/868
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/855
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/834
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/793
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/779
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/746
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/740
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/727
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/671
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/613
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/595
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/588
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/570
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/569
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/542
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/516
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/515
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/434
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/354
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/323
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/315
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/281
- fixes
https://github.com/mrousavy/react-native-vision-camera/issues/211
- fixes https://github.com/mrousavy/react-native-vision-camera/issues/76
2023-09-01 20:22:51 +02:00
Marc Rousavy
74b5898af7 fix: Use pod install instead of bundle exec pod ... 2023-09-01 20:21:40 +02:00
Marc Rousavy
ae439e3752 Update .gitignore 2023-09-01 20:19:02 +02:00
Marc Rousavy
385014bf56 Create .bundle/config 2023-09-01 20:17:36 +02:00
Marc Rousavy
7ca226aa76 Add optional checkboxes 2023-09-01 20:10:44 +02:00
Marc Rousavy
e44d0e7aed chore: Fix iOS build CI 2023-09-01 20:09:33 +02:00
Marc Rousavy
fa111ad344 docs: Add docs for Pause/Resume recording 2023-09-01 20:03:29 +02:00
Marc Rousavy
bfa18eef61 Merge branch 'main' into v3 2023-09-01 19:54:00 +02:00
Marc Rousavy
18d5400f50 Add Image to example 2023-09-01 19:52:08 +02:00
Marc Rousavy
a3b48f4951 Add start script 2023-09-01 19:49:44 +02:00
Vojtech Novak
fc0e2bf34b
fix: Fix savePhotoToFile() sometimes writing empty files (#1746) 2023-09-01 19:41:42 +02:00
Marc Rousavy
cebb7b3e89 Update .prettierrc.js 2023-09-01 19:40:04 +02:00
Marc Rousavy
325fc4d2bb chore: Change line width to 140 in C++ 2023-09-01 19:39:25 +02:00
Marc Rousavy
033ddb8cff Move prettier and babel to separate files 2023-09-01 19:39:14 +02:00
Marc Rousavy
0ee9cb3352 chore: release 3.0.0-rc.10 2023-09-01 18:53:11 +02:00
Marc Rousavy
c3f6589b48 Update issue templates 2023-09-01 18:46:41 +02:00
Marc Rousavy
290a20f8e3 docs: Update CONTRIBUTING 2023-09-01 18:32:23 +02:00
Marc Rousavy
7772fc3588 Update .gitignore 2023-09-01 18:29:15 +02:00
Marc Rousavy
19eabe2a62 Update .gitignore 2023-09-01 18:26:27 +02:00
Marc Rousavy
036856aed5
chore: Move everything into package/ (#1745)
* Move everything into package

* Remove .DS_Store

* Move scripts and eslintrc to package

* Create CODE_OF_CONDUCT.md

* fix some links

* Update all links (I think)

* Update generated docs

* Update notice-yarn-changes.yml

* Update validate-android.yml

* Update validate-cpp.yml

* Delete notice-yarn-changes.yml

* Update validate-cpp.yml

* Update validate-cpp.yml

* Update validate-js.yml

* Update validate-cpp.yml

* Update validate-cpp.yml

* wrong c++ style

* Revert "wrong c++ style"

This reverts commit 55a3575589c6f13f8b05134d83384f55e0601ab2.
2023-09-01 18:15:28 +02:00
Marc Rousavy
2a5c33323b
docs: New README (#1744)
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Revert "Update README.md"

This reverts commit 8ce4949388323dc8d81366972b350476b77a8b99.

* Update README.md

* Update README.md

* Update README.md

* Revert "Update README.md"

This reverts commit 11c4655890d78728cff3ab31b8578f86ba6cbf0f.

* Delete settings.json

* Delete CODE_OF_CONDUCT.md

* Move `.clang-format` to `cpp/`

* Update README.md

* update docs

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update sidebars.js
2023-09-01 17:31:10 +02:00
Marc Rousavy
65aa9b49b7 docs: Add fancy new Banner 2023-09-01 16:45:17 +02:00
Marc Rousavy
b2ea240bbb Update clang-format.sh 2023-09-01 16:21:00 +02:00
Marc Rousavy
0e9f1ca640
perf: Improve pixelFormat and add CameraDevice.sensorOrientation (#1729)
* feat: Orientation

* fix orientation value in manifest

* Update AndroidManifest.xml

* Style

* fix: Set MAX_IMAGES to 3

* Pass `isMirrored` to `VideoPipeline`

* Update docs about Skia FPs

* Options

* Add iPad target

* Remove UIDevice onOrientationChanged listener

* Update CameraView+AVCaptureSession.swift

* Update CameraView+AVCaptureSession.swift

* Update CameraView+AVCaptureSession.swift

* Get available pixelFormats on iOS

* format

* Update CameraSession.kt

* Expose `CameraDevice.sensorOrientation`

* Lock orientation again
2023-09-01 15:07:16 +02:00
Marc Rousavy
01a79d63ef
chore: Restructure codebase a bit (#1742)
* Move core Camera stuff into `/core/`

* `NativePreviewView` -> `PreviewView`
2023-09-01 13:08:33 +02:00
Marc Rousavy
03b57a7d27
feat: Use clang-format to keep the C++ codebase clean (#1741)
* Use clang-format

* Create .clang-format

* Update .clang-format

* Update .clang-format

* Update .clang-format

* Only search in cpp dirs

* Update clang-format.sh

* Update .clang-format

* Update .clang-format

* Update .clang-format

* Format C++ code!

* Use version 16

* Update clang-format.sh

* Remove Shaders.ts

* fix: Lint Swift
2023-09-01 12:58:32 +02:00
Marc Rousavy
0a28454579
chore: Remove Skia 🎨 (#1740)
* Revert "feat: Skia for Android (#1731)"

This reverts commit a7c137da07.

* Remove some skia

* Remove all the Skia stuff.

* Update useFrameProcessor.ts

* Update lockfiles

* fix: Use native Preview again

* Use `OpenGLTexture&` again

* Remove `PreviewOutput` (we use `SurfaceView` in parallel)

* fix: Log photo widths

* fix: Fix cpplint
2023-09-01 12:20:17 +02:00
Marc Rousavy
22829083cd chore: release 3.0.0-rc.9 2023-09-01 12:02:01 +02:00
Marc Rousavy
a7c137da07
feat: Skia for Android (#1731)
* feat: Call Skia Renderer

* Use default NativePreviewView for Skia

* Render to separate FBO

* It appears once

* Refactor a lot lol

* Pass width/height

* Read width/heights

* Update SkiaRenderer.cpp

* Read stencil/samples

* Use switch for target

* Clear full red

* Update VideoPipeline.cpp

* fix: Use `BorrowTextureFrom` instead of `AdoptTextureFrom`

* Get it to work

* Draw Camera Frame again (only works for first frame)

* glDisable(GL_BLEND)

* Use Frame Buffer again

* Simplify Skia offscreen surface creation

* fix: Get it to kinda work?

* fix: Remove `sampler2D` shader

Only the EXTERNAL_OES one kinda works

* Revert "fix: Remove `sampler2D` shader"

This reverts commit bf241a82f440f5a442f23a2b10329b813e7cdb3e.

* Revert "fix: Get it to kinda work?"

This reverts commit ea6a8784ad8dc7d05e8076591874f021b51dd84a.

* fix: Use Skia for rendering

* Simplify drawing code a lot

* Clean up drawing loop a bit more

* Some docs

* Update SkiaRenderer.cpp

* Surface

* try to use Matrix

* Use BottomLeft as a surface origin again

* Get actual surface dimensions

* Use 1x1 pbuffer instead

* Update SkiaRenderer.cpp

* Update SkiaRenderer.cpp

* feat: Implement Skia Frame Processor (#1735)

* feat: Implement JS Skia Frame Processor

* Update SkiaRenderer.cpp

* push

* Create Frame from C++

* compile

* Compile

* Update VideoPipeline.cpp

* Fix JNI local ref

* Use `HardwareBuffer` for implementation

* feat: Custom `Frame` implementation that uses CPU `ByteBuffer` (#1736)

* feat: Implement JS Skia Frame Processor

* Update SkiaRenderer.cpp

* push

* Create Frame from C++

* compile

* Compile

* Update VideoPipeline.cpp

* Fix JNI local ref

* Use `HardwareBuffer` for implementation

* try: Try to just create a CPU based ByteBuffer

* fix: Fix Java Type

* fix remaining errors

* try fixing FrameFactory

* Use `free`

* fix: Fix scene mode crash on some emulators

* fix: Fix scene mode crash on some emulators

* Fix getting pixels

* fix: Fix buffer not being freed

* Add some docs to `Frame`

* Test Skia again

* Use `getCurrentPresentationTime()`

* Remove `FrameFactory.cpp`

* Update VideoPipeline.h

* Update VideoPipeline.cpp
2023-09-01 10:43:19 +02:00
Marc Rousavy
6bbb44d541 fix: Fix scene mode crash on some emulators 2023-08-31 21:32:59 +02:00
Rocket13011
3b0475752d
fix: Make Skia and Worklets optional in package.json (#1728)
Co-authored-by: Rocket13011 <1051575+rocket13011@users.noreply.github.com>
2023-08-29 17:53:00 +02:00
Marc Rousavy
ea3686cb9a
feat: Create C++/OpenGL-based Video Pipeline for more efficient Recording and Frame Processing (#1721)
* Create `VideoPipeline` c++

* Remove folly C++ dependency

* Create `VideoPipeline` HybridClass

* Set up OpenGL

* Add outputs

* Update VideoPipeline.kt

* Bum `minSdkVersion` to `26`

* Create `VideoPipelineOutput`

* Create output funcs

* Set output pipelines

* Add FP/Recording on Output change

* Update VideoPipeline.cpp

* Create `PassThroughShader`

* Try to draw? I have honestly no idea

* fix: Fix `setFrameProcessor` nameclash

* fix: Fix `high-res-sizes` being null

* Add preview output

* Create `OpenGLContext.cpp`

* Make screen red

* This _should_ work (MESSY)

* FINALLY RENDER TEXTURE

* Rotate

* Mirror

* Clean up a bit

* Add `getWidth()`/`getHeight()`

* Cleanup

* fix: Use uniforms instead of attributes

* Draw with passed rotation/mirror mode

* feat: Use SurfaceTexture's transformMatrix in OpenGL pipeline (#1727)

* feat: Use Transform Matrix from SurfaceTexture

* Renam

* feat: Fix OpenGL Shader

* Update VideoPipeline.kt

* Measure elapsed time

* fix: Fix low resolution

* Render to offscreen

* Render to every context

* Release `SurfaceTexture` on close

* Use one OpenGL context to render to multiple EGLSurfaces

* Clean up a bit

* fix: Fix recording pipeline not triggering

* fix: Synchronize close to prevent nulls

* Update OpenGLRenderer.cpp

* fix: Hardcode Android recorder size
2023-08-29 17:52:03 +02:00
Marc Rousavy
dfb86e174b
feat: Replace *NativeMap and *NativeArray with Map<K,V> and List<T> for faster JSI -> JNI calls (#1720)
Replaces `ReadableNativeMap`/`WritableNativeMap` with `Map<String, Object>` and `ReadableNativeArray`/`WritableNativeArray` with `List<Object>`, making the JSI -> JNI conversion a bit faster and more logical.
Also, we could now convert Array Buffers or HostObjects if we wanted to.
2023-08-25 12:22:44 +02:00