Commit Graph

1549 Commits

Author SHA1 Message Date
Marc Rousavy
60925fc816
Update package.json 2024-03-27 14:36:21 +01:00
Kirill Zyusko
d731fe491d
docs: Compress images (#2667) 2024-03-20 11:16:26 +01:00
Danny Kim
ebe04b246c
fix: Changes relative import paths in usePreferredCameraDevice.ts (#2661)
Update import paths in usePreferredCameraDevice

The import paths for CameraDevice and useCameraDevices in the usePreferredCameraDevice file were updated. They now correctly reference 'react-native-vision-camera' instead of the non-existent relative path. This ensures correct and efficient module importation, enhancing code readability and maintainability.
2024-03-19 11:14:20 +01:00
Keaton Roux
97941a919f
feat: Add UPC-A support (#2563)
* Add UPC_A support

* Add documentation for UPC-A on iOS

* Doc adjustments

---------

Co-authored-by: Keaton Roux <keaton@codehesion.co.za>
2024-03-18 15:42:57 +01:00
Marc Rousavy
8e1f03907b
chore: release 3.9.1 2024-03-04 12:49:46 +01:00
Marc Rousavy
3f1a7c9e32
fix: Disable precapture sequence by default (#2629) 2024-03-04 12:49:03 +01:00
Guoting Lei
e8dd1e0b2e
fix: Use 0x0 as a fallback Size if SENSOR_INFO_PHYSICAL_SIZE is null (e.g. on USB cameras) (#2608)
2602:There is a NullPointerException here because CameraCharacteristics cannot get the SENSOR_INFO_PHYSICAL_SIZE value of the camera device
2024-02-29 14:53:36 +01:00
Jonas Thuresson
bca9472ab8
fix: Fix Boolean.parse string values from gradle properties (#2599)
* parse string booleans from gradle properties

* Define separate safeExtGetBool function

---------

Co-authored-by: Jonas Thuresson <jonas.thuresson@klarna.com>
2024-02-26 09:16:54 +01:00
Lihang Xu
79ebae56f3
docs: Add vision-camera-cropper to the plugins list (#2600) 2024-02-23 19:38:37 +01:00
mbghsource
86637ac112
chore: Update package README (#2601)
Update README.md

yarn bootstrap needs package.json which is in package directory.
2024-02-23 19:37:44 +01:00
Marc Rousavy
8225ac1aff
Create tea.yaml 2024-02-23 15:36:43 +01:00
Marc Rousavy
83b852acd0
chore: Use CameraRuntimeError if device is null 2024-02-23 10:43:50 +01:00
Marc Rousavy
5ab7b291db
Update gradle.properties 2024-02-20 21:07:41 +01:00
Marc Rousavy
eb57b3877c
chore: Update actions 2024-02-20 20:34:34 +01:00
Marc Rousavy
369cb4a043
fix: Fix Precapture timed out after 5 seconds error (#2586)
* fix: Fix precapture timeout error on capture

* fix: Catch timeout errors

* Update PersistentCameraCaptureSession.kt

* Update PersistentCameraCaptureSession.kt

* fix: Remove unsupported AE/AF/AWB triggers

* fix: Only enable flash if it is really AUTO

* Update CameraCaptureSession+precapture.kt

* Update CameraCaptureSession+setRepeatingRequestAndWaitForPrecapture.kt

* Update PersistentCameraCaptureSession.kt
2024-02-20 18:35:55 +01:00
Marc Rousavy
fabf019f66
fix: Fix "Unknown AF/AE/AWB State" error (#2592) 2024-02-20 08:54:26 +01:00
Lia/Leo Treloar
4c159aff61
docs: Fix toArrayBuffer example in Frame Processor Guide (#2595) 2024-02-20 08:54:08 +01:00
bglgwyng
55992bb954
fix: Fix Frame Processor SIGSEV crash in VisionCameraScheduler::trigger by locking mutex in dispatchAsync (#2591)
Add missing lock.
2024-02-19 16:01:21 +01:00
Marc Rousavy
7ac6f4d008
fix: Trigger measure and layout manually in PreviewView (#2588)
* fix: Trigger `measure` and `layout` manually to fix Preview stretching

* fix: Check for `0`/`NaN`
2024-02-19 14:54:13 +01:00
Marc Rousavy
9af6e61dc8
fix: Cancel focus on session close (#2578) 2024-02-19 14:11:14 +01:00
Marc Rousavy
2c52fb01e4
chore: Update comments 2024-02-19 13:41:23 +01:00
Marc Rousavy
f6b7163660
chore: Fix some C++ compiler warnings (#2576)
* chore: Fix some C++ compiler warnings

* Update MutableJByteBuffer.h

* Update MutableJByteBuffer.h

* Remove noexcept

* Explicit
2024-02-16 18:01:52 +01:00
Marc Rousavy
2c976d8ccd
feat: Upload .apk as a GitHub artifact (#2575)
* feat: Upload .apk as a GitHub artifact

* Update build-android.yml

* Update build-android.yml

* fix path

* Update build-android.yml
2024-02-16 17:55:35 +01:00
Marc Rousavy
147aff8683
chore: release 3.9.0 2024-02-16 13:52:12 +01:00
Marc Rousavy
bda43d3984
fix: Fix nullable props (#2573)
* fix: Fix nullable props

* Update CameraView.kt

* Pass error to JS
2024-02-16 13:46:13 +01:00
Marc Rousavy
b105de0194
fix: Add extra sanity-checks for CaptureRequest (#2571)
* fix: Add extra sanity-checks for `CaptureRequest`

* Update CameraDeviceDetails.kt

* Refactor zoom a bit

* fix: Remove unneeded flash

* Move to AE instead of FLASH control

* Revert "Move to AE instead of FLASH control"

This reverts commit 755689411535803d156a4e84f143d0c9d08c858f.

* Set AE Mode to ON for manual flash control
2024-02-16 13:13:56 +01:00
farwayer
57c6431353
fix: Replace deprecated RCTEventEmitter with UIManager (#2569)
use new events
2024-02-16 11:27:00 +01:00
Marc Rousavy
aad7d2b8b3
docs: Use SVG PlayStore Button 2024-02-15 20:37:26 +01:00
Marc Rousavy
e6c12e2ed2
chore: Update ShadowLens links for Android release 2024-02-15 20:34:49 +01:00
Marc Rousavy
31754eb74c
chore: release 3.9.0-beta.6 2024-02-15 17:37:19 +01:00
Marc Rousavy
129e21f14e
fix: Fix Session has been closed; further changes are illegal error by using tryStopRepeating() (#2568)
* feat: Allow focus calls to be cancelable

* Cancelable

* fix: Use `tryStopRepeating`
2024-02-15 17:34:55 +01:00
Marc Rousavy
4168d8f752
feat: Allow focus calls to be cancelable (#2567)
* feat: Allow focus calls to be cancelable

* Cancelable
2024-02-15 17:33:19 +01:00
Marc Rousavy
bcd12649e2
fix: Move PreviewView into SurfaceView to make it simpler (#2566)
* hmmm

* Set initial fixed size

* fix: Repair PreviewView again

* Update PreviewView.kt
2024-02-15 17:07:57 +01:00
Marc Rousavy
c5646ca1e2
chore: release 3.9.0-beta.5 2024-02-15 13:30:40 +01:00
Marc Rousavy
83c0184796
fix: Take Orientation into account for PreviewView (#2565)
* fix: Take Orientation into account for `PreviewView`

* Log

* Take aspect ratio into account

* Reorganize code a bit

* Set LANDSCAPE_LEFT as default

* chore: Format
2024-02-15 13:30:14 +01:00
Marc Rousavy
5df5ca9adf
fix: Fix PreviewView stretching on Android (now finally a real fix) (#2564)
* fix: Only resolve once SurfaceHolder actually resized

* fix: Fix onMeasure not being called for `PreviewView`

* fix: Auto-trigger layout computation on Surface Change

* fix: Add proper LayoutParams to `PreviewView`

* Format
2024-02-15 13:09:16 +01:00
Marc Rousavy
21042048ae
chore: release 3.9.0-beta.4 2024-02-14 17:05:05 +01:00
Marc Rousavy
a7701c8c9c
perf: Allow skipping pre-capture sequence if already focused (#2561)
This PR speeds up photo capture on Android by skipping pre-capture sequences on modes that are already focused (either AF, AE or AWB)
2024-02-14 17:04:25 +01:00
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
61b2f7dd4a
chore: Improve enableGpuBuffers docs 2024-02-14 13:52:02 +01:00
Marc Rousavy
14daaaaf9d
fix: Return after configure error 2024-02-14 13:47:18 +01:00
Marc Rousavy
1a0bd8f7c2
feat: Add enableGpuBuffers property (#2557)
* Revert "fix: Fix VideoPipeline crash on Samsung (Disable `USAGE_GPU_SAMPLED_IMAGE` ImageReader) (#2555)"

This reverts commit ad33dd91b1.

* feat: Add `enableGpuBuffers` prop

* Create ImageWriter separately
2024-02-14 12:47:40 +01:00
Marc Rousavy
478688529b
fix: Fix 60 FPS crashing on some Samsungs (#2556)
* fix: Fix 60 FPS crash on Samsung by checking `CamcorderProfile.maxFps`

* Log FPS clamp

* Update CameraDeviceDetails.kt

* Format code
2024-02-14 12:47:03 +01:00
Marc Rousavy
3699ccde94
chore: Organize code 2024-02-14 11:53:17 +01:00
Marc Rousavy
ad33dd91b1
fix: Fix VideoPipeline crash on Samsung (Disable USAGE_GPU_SAMPLED_IMAGE ImageReader) (#2555)
* fix: Fix VideoPipeline crash on Samsung (`USAGE_GPU_SAMPLED_IMAGE` not supported)

* Format code
2024-02-14 11:51:24 +01:00
Marc Rousavy
0130085376
chore: Update lockfile 2024-02-14 10:58:11 +01:00
Marc Rousavy
ec7ce36d25
fix: Use acquireLatestImage instead of acquireNextImage for CodeScanner (#2549) 2024-02-13 15:15:29 +01:00
Marc Rousavy
b7e24c444e
fix: Check if session is still valid before resetting AF after focus (#2550)
* fix: Check if session is still valid before resetting AF after focus

* Update PersistentCameraCaptureSession.kt
2024-02-13 15:15:19 +01:00
Marc Rousavy
a2a2e94865
fix: Fix "Invalid pixel format 35" HardwareBuffer crash (#2547) 2024-02-13 13:52:21 +01:00
Marc Rousavy
1011c3f039
fix: Fix java.lang.NoSuchMethodError in FrameProcessor initializer (#2546) 2024-02-13 13:46:17 +01:00