-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix: DispatchQueue for synchronizing the session configuration and start operations #214
base: next
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create your PR against next
and not against main
.
Co-authored-by: Robin Genz <[email protected]>
@jimcase Is this PR ready for review? |
@robingenz Yes, its ready |
@jimcase Please create your PR against the |
@jimcase Please merge the latest |
This PR addresses synchronization issues reported on an Apple Developer Forum thread, where users encountered NSGenericException due to premature execution of AVCaptureSession.startRunning(). The problem arises from startRunning() being called before the completion of commitConfiguration(), especially noted in iOS 17 and some iOS 16 devices.
To resolve this, we introduce a serial DispatchQueue for managing AVCaptureSession operations in a FIFO (First In, First Out) sequence. Configuration tasks are encapsulated within a synchronous block to ensure complete setup before proceeding. Following this, startRunning() is scheduled asynchronously, guaranteeing it executes only after the configuration is fully committed. This approach not only prevents the NSGenericException by ensuring proper sequence of operations but also maintains high performance and responsiveness of the application.## Pull request checklist
Related PR fix(barcode-scanning): add delay before starting camera session #188
Please check if your PR fulfills the following requirements:
npm run changeset
).