Search code examples
androidandroid-cameranexus-5hdr

Android camera api SCENE_MODE_HDR not supported in Nexus 5?


My Nexus 5 isn't supporting the HDR scene mode of the camera api (as well as the camera2 api). Is this due to the manufacturer support? If so, what I want to implement HDR scene mode in a custom camera app as in the stock camera?

I tried using both the camera APIs but none was supporting the SCENE_MODE_HDR parameter.

Using the android.hardware.camera api: (Logs HDR mode not supported)

List<String> sceneModes = params.getSupportedSceneModes();
if (sceneModes.contains(Camera.Parameters.SCENE_MODE_HDR)) {
    Log.d("HDR", "HDR mode supported");
    params.setSceneMode(Camera.Parameters.SCENE_MODE_HDR);
} else {
    Log.d("HDR", "HDR mode not supported");
}

And using the android.hardware.camera2 api: (Logs HDR mode not supported)

CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId);
int[] sceneModes= characteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES);
boolean isHDRsupported = false;
for (int sceneMode : sceneModes) {
    if (sceneMode == CameraCharacteristics.CONTROL_SCENE_MODE_HDR) {
        isHDRsupported = true;
        break;
    }
}
Log.d("HDR", "HDR mode " + (isHDRsupported ? "" : "not ") + "supported");

Am I missing something obvious here?


Solution

  • The Nexus 5 does not have support for an HDR scene mode.

    The HDR+ mode in the included camera app is part of the application itself (there's a blog post about how it works on top of the camera2 API).