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

Add HDR capture support #86

Merged
merged 4 commits into from
Aug 12, 2024
Merged

Add HDR capture support #86

merged 4 commits into from
Aug 12, 2024

Conversation

calren
Copy link
Contributor

@calren calren commented Jul 29, 2024

@calren calren changed the title Add HDR capture support [Not ready for review] Add HDR capture support Jul 29, 2024
@calren calren changed the title [Not ready for review] Add HDR capture support Add HDR capture support Jul 31, 2024
@calren calren requested a review from madebymozart July 31, 2024 20:16
@calren
Copy link
Contributor Author

calren commented Jul 31, 2024

@madebymozart this is ready for review now!

videoCapabilities.supportedDynamicRanges

supportedHdrEncoding = supportedDynamicRanges.firstOrNull {
it != DynamicRange.SDR // Ensure an HDR encoding is found

Choose a reason for hiding this comment

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

Why don't you directly check HDR, not SDR?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to this, can we just check if it is HDR instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'm not sure, i copied the code snippet from https://android-developers.googleblog.com/2023/06/camerax-13-is-now-in-beta.html which has the snippet:

supportedHdrEncoding = supportedDynamicRanges.firstOrNull {
            it != DynamicRange.SDR  // Ensure an HDR encoding is found
        }

@donovanfm any idea why we are checking for NOT SDR instead of checking for HDR directly?

Copy link
Contributor

@madebymozart madebymozart left a comment

Choose a reason for hiding this comment

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

Looks good overall, I think making the adjustments to specific HLG 10 bit is what we should do

videoCapabilities.supportedDynamicRanges

supportedHdrEncoding = supportedDynamicRanges.firstOrNull {
it != DynamicRange.SDR // Ensure an HDR encoding is found
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we actually make this more specific as well?

There seem to be multiple different dynamic range profiles and to make it consistent, we should choose one we know they all support, which would be HLG 10-bit

https://developer.android.com/reference/androidx/camera/core/DynamicRange

Any device that supports HDR should support HLG 10-bit at a minimum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

private var currentRecording: Recording? = null
private lateinit var recordingState: VideoRecordEvent

init {
val videoCaptureBuilder = VideoCapture.Builder(recorder)

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: any reason for the space here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think just habit for personal preference for code readability, but removed

@calren
Copy link
Contributor Author

calren commented Aug 7, 2024

updated based on feedback. @madebymozart can you take another look? thanks!

@madebymozart madebymozart self-requested a review August 12, 2024 15:18
@calren calren merged commit 85d11e8 into main Aug 12, 2024
2 checks passed
@calren calren deleted the caren/hdr_capture branch August 12, 2024 15:34
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