Commit Graph

16 Commits

Author SHA1 Message Date
Marc Rousavy
9a187c6d19
feat: Add width and height to VideoFile output (#2281)
* feat: Add `width` and `height` to `VideoFile` output

* Format
2023-12-12 16:43:57 +01:00
Marc Rousavy
d7f7095d1a
fix: Use bitRate multiplier instead of setting it to an absolute value (#2216)
* fix: Use `bitRate` multiplier instead of setting it to an absolute value

* Pass override

* Format

* Rename

* feat: Also implement Android

* fix: Log Mbps properly

* fix: Up-/Down-scale bit-rate if different options

* fix: Parse in Manager

* Update RecordingSession+getRecommendedBitRate.kt
2023-11-27 17:20:26 +01:00
Marc Rousavy
cad5240420
fix: Move minExposure/maxExposure from format into device (#2211)
* fix: Move `minExposure`/`maxExposure` into `device`

* Update docs

* chore: Remove unneeded dependency

* chore: Update code
2023-11-24 18:20:56 +01:00
Marc Rousavy
da0067d9f7
fix: Fix iOS not reading videoCodec and videoBitRate from options (#2202)
* fix: Fix iOS not reading `videoCodec` and `videoBitRate` from options

* Update AVVideoCodecType+descriptor.swift
2023-11-22 17:54:49 +01:00
Marc Rousavy
cf8f3d05e3
fix: Fix Video Recording delay and improve startRecording() performance (#2192)
* fix: Add more logs

* perf: Init audio AVAssetWriter in parallel

* chore: Log Audio Session activation

* perf: Init Audio Session asynchronously

* chore: Log when category changed

* fix: Revert lazy audio initialization

* Update Podfile.lock

* Pass `sourceFormatHint` to video and audio AVAssetWriter

* fix: Remove `sourceFormatHint` from Video Asset Writer

* Use default options for Audio Asset Writer

* Update Podfile.lock

* Revert "Use default options for Audio Asset Writer"

This reverts commit e575a14c5342ddc7f9db557d5e3915328ed9e798.

* Add time logs

* fix: Don't synchronize audio buffers, they are already in sync

* shouldOptimizeForNetworkUse = false

* fix: Only update `latestTimestamp` once video buffer has been written

* perf: Use `AVAssetWriterInput` instead of `AVAssetWriterInputPixelBufferAdaptor`

* fix: Fix Audio not being synchronized with Video

* Remove logs add comments

* Format

* feat: Set `.videoRecording` AVAudioSession mode

* Refactor `startRecording()` a bit

* Format

* chore: Throw error directly instead of double-checking
2023-11-22 17:53:10 +01:00
Marc Rousavy
49d58d0d0c
perf: Use lossy compressed YUV buffers if available (#2195) 2023-11-22 16:19:29 +01:00
Marc Rousavy
9c5eb9105e
fix: Expose minExposure/maxExposure in format (#2179)
* fix: Expose `minExposure`/`maxExposure` in `format`

I forgot to do that on iOS before

* Update CameraDeviceFormat.swift
2023-11-19 16:43:04 +01:00
Marc Rousavy
c5dfb6c247
feat: Split videoHdr and photoHdr into two settings (#2161)
* feat: Split `videoHdr` and `photoHdr` into two settings

* fix: Rename all `hdr`

* fix: Fix HDR on Android

* Update CameraDeviceDetails.kt

* Update CameraDeviceDetails.kt

* fix: Correctly configure `pixelFormat` AFTER `format`

* Update CameraSession+Configuration.swift

* fix: Also after format changed
2023-11-15 18:33:12 +01:00
Marc Rousavy
abf5538bb0
feat: Support setting videoStabilizationMode (#2160)
* feat: Support setting `videoStabilizationMode`

* fix: Use `outputs`

* Format

* Set Video Stabilization Mode
2023-11-15 17:00:41 +01:00
Marc Rousavy
cc65ec26a9
fix: Fix Video codec, bitRate and flash being ignored on iOS (#2113)
* fix: Fix VIdeo `codec`, `bitRate` and `flash` being ignored on iOS

* Update RecordVideoOptions.swift
2023-10-31 15:09:27 +01:00
Marc Rousavy
bcf201a9a3
fix: Ensure format is properly checked for equality (#2083)
* fix: Properly check for equality in `CameraDeviceFormat`

* Update CameraSession.kt

* fix: Fix `autoFocusSystem` parsing

* Format
2023-10-25 12:56:32 +02:00
Marc Rousavy
5e20f9c8fa
chore: Rename CodeScanner to CodeScannerOptions in native (#2010)
* chore: Rename `CodeScanner` to `CodeScannerOptions` on native

* chore: Rename `CodeScanner` on iOS

* fix: Unwrap `options`

* Format
2023-10-16 16:56:39 +02:00
Marc Rousavy
ea98112a21
fix: Fix basic Orientation on iOS (#2000)
* fix: Fix basic Orientation on iOS

* ci: Use macOS 13 runner for latest Xcode 15

* chore: Remove Xcode 15 checks

* Format
2023-10-14 13:17:14 +02:00
Marc Rousavy
cd0b413706
feat: New Core/ library (#1975)
Moves everything Camera related into `core/` / `Core/` so that it is better encapsulated from React Native.

Benefits:

1. Code is much better organized. Should be easier for collaborators now, and cleaner codebase for me.
2. Locking is fully atomically as you can now only configure the session through a lock/Mutex which is batch-overridable
    * On iOS, this makes Camera startup time **MUCH** faster, I measured speedups from **1.5 seconds** to only **240 milliseconds** since we only lock/commit once! 🚀 
    * On Android, this fixes a few out-of-sync/concurrency issues like "Capture Request contains unconfigured Input/Output Surface!" since it is now a single lock-operation! 💪 
3. It is easier to integrate VisionCamera outside of React Native (e.g. Native iOS Apps, NativeScript, Flutter, etc)

With this PR, VisionCamera V3 is up to **7x** faster than V2
2023-10-13 18:33:20 +02:00
Marc Rousavy
6640b72a00
feat: Code Scanner API (#1912)
* feat: CodeScanner JS API

* feat: iOS

* Use guard

* Format

* feat: Android base

* fix: Attach Surfaces

* Use isBusy var

* fix: Use separate Queue

* feat: Finish iOS types

* feat: Implement all other code types on Android

* fix: Call JS event

* fix: Pass codetypes on Android

* fix: iOS use Preview coordinate system

* docs: Add comments

* chore: Format code

* Update CameraView+AVCaptureSession.swift

* docs: Add Code Scanner docs

* docs: Update

* feat: Use lazily downloaded model on Android

* Revert changes in CameraPage

* Format

* fix: Fix empty QR codes

* Update README.md
2023-10-04 12:53:52 +02:00
Marc Rousavy
3169444697
feat: Implement resizeMode prop for iOS (#1838)
* feat: Implement `resizeMode` prop for iOS

- `"cover"`: Keep aspect ratio, but fill entire parent view (centered).
- `"contain"`: Keep aspect ratio, but make sure the entire content is visible even if it introduces additional blank areas (centered).

* chore: Update prop docs

* Update CameraProps.ts

* Lint & Format
2023-09-23 10:14:27 +02:00