Skip to content

Commit d350573

Browse files
authored
Camera: Relax UltraHDR camera capture requirements (#192)
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.
1 parent 13f9b07 commit d350573

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

samples/camera/camera2/src/main/java/com/example/platform/camera/imagecapture/Camera2UltraHDRCapture.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,22 +355,17 @@ class Camera2UltraHDRCapture : Fragment() {
355355
/**
356356
* In order to capture and UltraHDR image, the camera device need to be capable of:
357357
*
358-
* - 10-bit dynamic range capture
359358
* - Encoding the JPEG/R format (UltraHDR)
360359
*
361360
* This function will check for both to determine device support.
362361
*/
363362
private fun canCaptureUltraHDR(c: CameraCharacteristics): Boolean {
364-
// Query the available capabilities and output formats.
365-
val abilities = c.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES)
363+
// Query the available output formats.
366364
val formats = c.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)?.outputFormats
367365

368-
val isTenBit =
369-
abilities?.contains(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT)
370-
?: false
371366
val canEncodeUltraHDR = formats?.contains(ImageFormat.JPEG_R) ?: false
372367

373-
return isTenBit && canEncodeUltraHDR
368+
return canEncodeUltraHDR
374369
}
375370

376371
/**

0 commit comments

Comments
 (0)