Marc Rousavy
37398cc909
feat: Flash with AE Pre-capture trigger for Android ( #2558 )
...
### Flash (`flash`)
Adds `flash` functionality with a fully custom pre-capture AE/AF/AWB trigger sequence for Android. 🎉
```ts
camera.current.takePhoto({
flash: 'on' // or 'auto'
})
```
### Better photos (`qualityPrioritization`)
We now also run the AE/AF/AWB precapture sequence on every photo (unless `qualityPrioritization` is `speed`), meaning photos are now less blurry, properly exposed, and properly white-balanced - so in short: **photo quality is now better!**.
The fast path still exists when using `qualityPrioritization: speed`, as that will skip the precapture sequence and metering actions and just grab an Image from the Camera as quickly as possible.
Additionally, `qualityPrioritization` now controls these options:
- [COLOR_CORRECTION_MODE](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#COLOR_CORRECTION_MODE )
- [EDGE_MODE](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#EDGE_MODE )
- [COLOR_CORRECTION_ABERRATION_MODE](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE )
- [HOT_PIXEL_MODE](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#HOT_PIXEL_MODE )
- [DISTORTION_CORRECTION_MODE](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#DISTORTION_CORRECTION_MODE )
- [NOISE_REDUCTION_MODE](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#NOISE_REDUCTION_MODE )
- [SHADING_MODE](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SHADING_MODE )
- [TONEMAP_MODE](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#TONEMAP_MODE )
..by setting them to `_FAST` or `_HIGH_QUALITY`, which was previously left untouched.
This now means:
- `takePhoto({ qualityPrioritization: 'speed' })` got FASTER 🚀
- `takePhoto({ qualityPrioritization: 'quality' })` got BETTER QUALITY 📸
- `takePhoto({ qualityPrioritization: 'balanced' })` is left unchanged ✅
2024-02-14 16:43:30 +01:00
Marc Rousavy
5acc64e031
feat: Create persistent CaptureSession
to avoid any blackscreen issues or errors ( #2494 )
...
* feat: Create custom `CaptureSession` wrapper
* Create `PersistentCameraCaptureSession`
* Update VideoStabilizationMode.kt
* Create RepeatingRequest.kt
* Update CaptureSession.kt
* Delete CaptureSession.kt
* Update PersistentCameraCaptureSession.kt
* Update PersistentCameraCaptureSession.kt
* fix: Add `isRepeating`
* Update CameraSession.kt
* Make `SurfaceOutput` not `Closable` anymore
* Update PersistentCameraCaptureSession.kt
* Stub out the rest
* Format
* Set `isRunning` properly
* Close previous outputs
* onError callback
* Format
* Started/Stopped
* Update CameraPage.tsx
* Add `isValid`
* Log `isActive`
* Add `tryAbortCaptures`
* Configure()
* Try?
* Add `didDestroyFromOutside`
* Disable FP for testing
* fix: Call `super.onAttachedToWindow` first
* Hm
* Update CameraSession.kt
* Update PersistentCameraCaptureSession.kt
* Try catch `didDestroyFromOutside`
* Update PersistentCameraCaptureSession.kt
* Session can only be active with a preview
* Update PersistentCameraCaptureSession.kt
* Throw `no-outputs` if needed
* Update logs
* fix: Check for CAMERA permission
* fix: Close session when opening a new device
* perf: Make everything `by lazy` in CameraDeviceDetails
* Update CameraDeviceDetails.kt
* Update PersistentCameraCaptureSession.kt
* Update PersistentCameraCaptureSession.kt
* Move
* Update Podfile.lock
* Implement `capture()`
* Format
* fix: Fix orientation not being applied
* fix: Fix `isMirrored`
* fix: Fix getting size
* fix: Close `Surface` in `VideoPipeline`
* Format
* fix: Fix `VideoPipeline` not properly destroying itself
* Use FP again
* Update CameraConfiguration.kt
* Rename
* Clean up
* Format
* Update CameraConfiguration.kt
* fix: Don't stop repeating request when capturing
2024-02-06 14:19:25 +01:00
Marc Rousavy
d8c95c901f
feat: Synchronize Frame
properly ( #2501 )
...
* feat: Synchronize `Frame` properly
* Update CameraError.ts
* Image is not valid if `refCount` < 0
2024-02-05 12:34:32 +01:00
Marc Rousavy
b1fa06514f
fix: Catch insufficient-storage
errors ( #2422 )
...
* fix: Catch `insufficient-storage` errors
* feat: Implement `insufficient-storage` error for Android
* fix: Catch insufficient storage error also on takePhoto android
2024-01-24 11:48:38 +01:00
Marc Rousavy
cc60ad296a
fix: Validate input props (fps
, hdr
, torch
, ...) instead of silently crashing ( #2354 )
...
* fix: Fix Blackscreen by deterministically destroying session if `isActive=false`
* Re-open Camera if session died
* Simplify Camera
* Disconnect is optional, block when resetting state
* fix: Log in `configure { ... }`
* fix: Make concurrent configure safe
* fix: Don't resize preview
* fix: Use current `CameraConfiguration`
* Don't start if no outputs are available
* Only mount with preview outputs
* Update CameraSession.kt
* Update PreviewView.kt
* Better logging
* Update CameraSession.kt
* Extract
* fix: Rebuild entire session if `isActive` changed
* isActive safe
* Start session at 1
* Create ActiveCameraDevice.kt
* interrupts
* chore: Freeze `frame` in `useFrameProcessor`
* Revert "chore: Freeze `frame` in `useFrameProcessor`"
This reverts commit dff93d506e29a791d8dea8842b880ab5c892211e.
* chore: Better logging
* fix: Move HDR to `video`/`photo` config
* fix: Fix hdr usage
* fix: Ignore any updates after destroying Camera
* fix: Fix video HDR
* chore: Format code
* fix: Check Camera permission
* Remove unneeded error
* Update CameraSession.kt
* Update CameraPage.tsx
* Delete OutputConfiguration.toDebugString.kt
* Update CameraSession.kt
* fix: Perform sanity checks to make sure props are valid
* format
2024-01-08 12:13:05 +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
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
85564d6d02
fix: Remove unused Error codes ( #1887 )
...
* fix: Remove unused Errors
* Errors.kt -> CameraError.kt
* fix: remove .system
2023-09-29 21:54:35 +02:00
Marc Rousavy
14721d314f
chore: Remove semicolons ( #1846 )
...
* chore: Disable `semi` in Prettier
* chore: Format w/o semi
* Remove more `;`
* Lint example
* More ;
2023-09-26 11:39:17 +02:00
Marc Rousavy
9809075507
feat: Support 10-bit Video HDR ( #1827 )
...
* feat: Select 10-bit YUV HDR format if HDR is enabled
* fix: Remove video EDR setting in favor of new 10-bit video HDR
* Format Swift
2023-09-21 16:30:05 +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