-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force reinit of c2 view on surface change #150
The problem was that sometimes `onMeasure()` was being called after the preview was initialized, so the `startPreview()` call in the `onSurfaceChanged()` method would not do anything. The only way to force a reset of the preview is to pause and resume it, so the capture session is destroyed and can be properly recreated with the new resolutions. This added the issue of concurrent calls to `startPreview()`, some which were actually needed to update the resolution, while others were not. As we cannot create multiple captureSessions, we have to wait for the ongoing init to finish before destroying the session and calling the method again.
- Loading branch information
Showing
1 changed file
with
32 additions
and
1 deletion.
There are no files selected for viewing
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