Commit Graph

1062 Commits

Author SHA1 Message Date
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
Marc Rousavy
f87bc74de1 chore: release 3.0.0-rc.8 2023-08-25 11:28:43 +02:00
Marc Rousavy
828e1baed9 chore: Bump version to RC.7 2023-08-25 11:26:59 +02:00
Marc Rousavy
dfee3b16b7 fix: Export pixelFormat property on iOS 2023-08-24 17:14:24 +02:00
Marc Rousavy
e036b3162a fix: Lock PixelBuffer for read in toArrayBuffer() 2023-08-24 16:37:20 +02:00
Marc Rousavy
d27581243d fix: Error on disabled Frame Processors 2023-08-24 16:28:16 +02:00
Marc Rousavy
66c012f3b2 fix: Fix node_modules/ directory detection 2023-08-24 16:16:45 +02:00
Marc Rousavy
4833c3e2b8 chore: Bump version 2023-08-24 15:54:17 +02:00
Marc Rousavy
57592d4746 chore: release 3.0.0-rc.6 2023-08-24 15:48:38 +02:00
Marc Rousavy
23af74aaf1
feat: Support focus() on Android (#1713)
* feat: Support `focus()` on Android

* perf: Cache RequestBuilder

* Use 30 FPS as default

* feat: Implement focus(x, y)

* fix: Fix ByteBuffer resizing
2023-08-24 11:49:27 +02:00
Marc Rousavy
c88605e230 fix: Fix circular dependency in FrameProcessorPlugins.ts
shoutout @bglgwyng
2023-08-24 10:55:57 +02:00
Marc Rousavy
4b009a0053 fix: Improve performance of zoom, fps, hdr and format selection 2023-08-23 15:50:34 +02:00
Marc Rousavy
efe6556fc2 feat: Implement enableZoomGesture on Android 2023-08-23 15:39:24 +02:00
Marc Rousavy
86468e3e1f fix: Use direct ByteBuffer 2023-08-23 14:47:42 +02:00
Marc Rousavy
3a0d7b3c91 fix: Fix JByteBuffer 2023-08-23 14:45:10 +02:00
Marc Rousavy
521d7c8ccf feat: Use ByteBuffer for much faster toArrayBuffer() 2023-08-23 14:23:31 +02:00
Marc Rousavy
862e05b64f
feat: Allow build without Skia or Frame Processors (#1710)
* feat: Make Frame Processors optional in JS

* Allow Android build without Frame Processors

* fix: Fix `EncoderProfiles.width` null-error

* Update gradle.properties

* Update gradle.properties

* fix: Use `#ifdef` instead of `#if`

* Update JVisionCameraProxy.cpp

* fix: Fix definitions

* Revert "fix: Use `#ifdef` instead of `#if`"

This reverts commit b19f32e5ce7df558cadcc8c4b5006c9cdf2cbe66.

* fix: Fix build

* chore: Codestyle

* Update JFrameProcessor.cpp
2023-08-23 12:42:38 +02:00
Marc Rousavy
617c5607d4 fix: Remove unused imports 2023-08-23 10:34:13 +02:00
Marc Rousavy
a46839a57b
feat: Add enableShutterSound prop to takePhoto() 🔊 (#1702)
* feat: Add `enableShutterSound` prop to `takePhoto()` 🔊

* Swift lint
2023-08-21 15:27:42 +02:00
Marc Rousavy
0a51980f26 fix: Use default HDR if not applicable 2023-08-21 14:45:48 +02:00
Marc Rousavy
94d9b69903 fix: Remove unused constructor 2023-08-21 14:43:12 +02:00
Marc Rousavy
4d77bc3ea9 Try to select HDR profile 2023-08-21 14:42:34 +02:00
Marc Rousavy
e1b04088c6 fix: Clean up codebase 2023-08-21 14:24:06 +02:00
Marc Rousavy
07ba0e1a41 fix: Improve build.gradle 2023-08-21 14:08:10 +02:00