Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Fix double configuration on device change #2537

Merged
merged 6 commits into from
Feb 13, 2024
Merged

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented Feb 10, 2024

What

Fixes the visual Camera zoom glitch that happened everytime you switch the Camera device, as well as on the initial mount of the camera.

The reason for this bug was that the device was configured after the session, meaning we had a double configuration instead of one single batch, causing an additonal delay/flicker of the preview.

This now also means the session starts faster! 🔥 🚀

Before:

RPReplay_Final1707826712.MP4

After:

RPReplay_Final1707826776.MP4

Changes

Tested on

Related issues

Fixes a situation that happened on every device change (or initial mount) where the device was configured after the session, separately, instead of just all at once causing an additonal delay/flicker of the prevjew.
Copy link

vercel bot commented Feb 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2024 0:15am

@mrousavy mrousavy marked this pull request as ready for review February 13, 2024 12:14
@mrousavy mrousavy changed the title fix: Fix double configuration on device change perf: Fix double configuration on device change Feb 13, 2024
@mrousavy mrousavy merged commit b3a8827 into main Feb 13, 2024
9 checks passed
@mrousavy mrousavy deleted the perf/fix-double-config branch February 13, 2024 12:32
isaaccolson pushed a commit to isaaccolson/deliveries-mobile that referenced this pull request Oct 30, 2024
…y#2537)

* fix: Fix double configuration on device change

Fixes a situation that happened on every device change (or initial mount) where the device was configured after the session, separately, instead of just all at once causing an additonal delay/flicker of the prevjew.

* Try?

* Format

* Update CameraSession.swift

* Use `defer`

* Throw `.device`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Camera Glitchy on Initial Switch From Front to Back
1 participant