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

Handle CameraX use cases separately #78

Merged

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented Aug 31, 2019

Fixes #50

Instead of binding all use cases to lifecycle at once on Activity startup, this PR creates and binds each use case as per the user needs, and unbinds the current use case when the user switches to another use case.

While this might produce some artifacts and small waits, it prevents the crash from happening on devices where a matching resolution for image still capture and resolution for video capture can't be found, thus ending up not finding a match for both cases at once (and crashing).

…to binding all use cases to lifecycle at once on Activity startup
@mzorz mzorz added the CameraX applicable only to CameraX implementation label Aug 31, 2019
@mzorz
Copy link
Contributor Author

mzorz commented Aug 31, 2019

Tested on emulators

  • API 26 (Android 8.0) works alright ✅
  • API 22 (Android 5.1.1) fixes the issue ✅ (some other issues appear later)
  • API 24 (Android 7.0) -> crashes before, opening issue Crash on preview start on Android 7.0 (API 24) #79
  • API 23 (Android 6.0 marshmallow) works alright ✅

@mzorz mzorz marked this pull request as ready for review August 31, 2019 21:03
@mzorz
Copy link
Contributor Author

mzorz commented Aug 31, 2019

Merging this one, can be reviewed later when a PR for branch demo1/1.0.0.6-feedback is up

@mzorz mzorz merged commit 28d0c78 into demo1/1.0.0.6-feedback Aug 31, 2019
@mzorz mzorz deleted the issue/50-camerax-no-supported-surface-combination branch August 31, 2019 21:04
@aforcier aforcier self-assigned this Sep 23, 2019
@aforcier aforcier added this to the Demo 1: Basic Creation milestone Sep 23, 2019
@aforcier
Copy link
Collaborator

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CameraX applicable only to CameraX implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants