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

Use camera-compose and restore double-tap to flip camera #263

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

temcguir
Copy link
Collaborator

  • Move HDR color mode code out of CameraXViewfinder
  • Replace CameraXViewfinder with camera-compose version
  • Move double tap logic to same pointerInput as tapToFocus

val colorModeSnapshotFlow =
snapshotFlow { Pair(currentSurfaceRequest.dynamicRange, currentImplementationMode) }
.map { (dynamicRange, implMode) ->
val isSourceHdr = dynamicRange.encoding != CXDynamicRange.ENCODING_SDR

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any possible isSourceHdr would be not HDR Encoding, even it is not Encoding SDR, such as Encoding Dolby Vision, Encoding HLG, Encoding Unspecified?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dolby Vision, HLG10, HDR10 and HDR10+ are all considered HDR formats. Technically, the DynamicRange here from CameraX should never be UNSPECIFIED, since it is coming from SurfaceRequest. I'll make a note to update the CameraX documentation to better communicate that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CameraX documentation improvements will be tracked with https://issuetracker.google.com/366536534

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for everything.

@temcguir temcguir merged commit e5fb46b into main Sep 13, 2024
5 of 6 checks passed
@temcguir temcguir deleted the temcguir/upgrade_camerax_version_for_viewfinder branch September 13, 2024 22:00
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.

3 participants