Skip to content

Commit

Permalink
Camera: Relax UltraHDR camera capture requirements (#192)
Browse files Browse the repository at this point in the history
At the moment we expect UltraHDR capable device to also
support the 10-bit camera output capability. It is possible
for some devices to generate UltraHDR output without having
the 10-bit capability.
  • Loading branch information
epeevs authored Sep 23, 2024
1 parent 13f9b07 commit d350573
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,22 +355,17 @@ class Camera2UltraHDRCapture : Fragment() {
/**
* In order to capture and UltraHDR image, the camera device need to be capable of:
*
* - 10-bit dynamic range capture
* - Encoding the JPEG/R format (UltraHDR)
*
* This function will check for both to determine device support.
*/
private fun canCaptureUltraHDR(c: CameraCharacteristics): Boolean {
// Query the available capabilities and output formats.
val abilities = c.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES)
// Query the available output formats.
val formats = c.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)?.outputFormats

val isTenBit =
abilities?.contains(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT)
?: false
val canEncodeUltraHDR = formats?.contains(ImageFormat.JPEG_R) ?: false

return isTenBit && canEncodeUltraHDR
return canEncodeUltraHDR
}

/**
Expand Down

0 comments on commit d350573

Please sign in to comment.