-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Create persistent CaptureSession
to avoid any blackscreen issues or errors
#2494
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
mrousavy
force-pushed
the
feat/custom-session
branch
from
February 1, 2024 10:56
08b0f7e
to
c8380ff
Compare
mrousavy
force-pushed
the
feat/custom-session
branch
from
February 1, 2024 11:44
c8380ff
to
d5e14ea
Compare
mrousavy
changed the title
feat: Create custom
feat: Create custom Feb 1, 2024
CaptureSession
wrapperCaptureSession
wrapper: PersistentCameraCaptureSession
mrousavy
changed the title
feat: Create custom
feat: Create persistent Feb 1, 2024
CaptureSession
wrapper: PersistentCameraCaptureSession
CaptureSession
to avoid any blackscreen issues or errors
This was referenced Feb 1, 2024
holy shit I think it works |
This was referenced Feb 6, 2024
isaaccolson
pushed a commit
to isaaccolson/deliveries-mobile
that referenced
this pull request
Oct 30, 2024
…ues or errors (mrousavy#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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Rewrites the
CameraSession
to use aPersistentCameraCaptureSession
instead of aCameraDevice
andCameraCaptureSession
combination to avoid the need of dynamically creating and droppingCameraCaptureSession
instances as it is currently.Before:
After:
In VisionCamera's
CameraSession
, we have the following dependency graph:Important to note is that
CameraDevice
andCameraCaptureSession
are asynchronous resources, meaning two things:Changes
PersistentCameraCaptureSession
which can auto-recover devices in a persistent class. This makes the code much simpler and saferPersistentCameraCaptureSession
instead ofCameraDevice
/CameraCaptureSession
abortCaptures()
when tearing down the session so that completion callbacks are calledpreview
is nullTested on
Related issues
TOO_MANY_OPEN_CAMERAS
error when rendering multiple Cameras #2378abortCaptures()
)