LowLightBoostSession

@RequiresApi(value = 30)
public interface LowLightBoostSession


A low light boost session.

Manages the necessary surfaces to provide to the camera capture session and outputs the brightened preview to a Surface provided by the app.

Summary

Public methods

abstract void
enableLowLightBoost(boolean enable)

Enables automatic preview brightening.

abstract @NonNull Surface

Returns the camera surface.

abstract boolean

Returns whether low light boost is enabled.

abstract void

Provides the latest capture result to the render service.

abstract void

Releases this session, freeing up resources.

abstract void
setSceneDetectorCallback(
    SceneDetectorCallback callback,
    Executor callbackExecutor
)

Sets the callback for scene detector.

Public methods

enableLowLightBoost

abstract void enableLowLightBoost(boolean enable)

Enables automatic preview brightening.

Enables low light boost to automatically vary the level of brightening applied based on what's appropriate for the scene's estimated luminance. Disabling low light boost will disable preview brightening.

Parameters
boolean enable

True to enable low boost and False to disable.

getCameraSurface

abstract @NonNull Surface getCameraSurface()

Returns the camera surface.

Returns
@NonNull Surface

The camera surface with the requested dimensions. To be used as a capture target.

isLowLightBoostEnabled

abstract boolean isLowLightBoostEnabled()

Returns whether low light boost is enabled.

processCaptureResult

abstract void processCaptureResult(@NonNull TotalCaptureResult captureResult)

Provides the latest capture result to the render service.

This must be called for every call to android.hardware.camera2.CameraCaptureSession.CaptureCallback.onCaptureCompleted in order for automatic adjustment of preview brightening to function.

Parameters
@NonNull TotalCaptureResult captureResult

The latest capture result.

release

abstract void release()

Releases this session, freeing up resources.

The session should no longer be used once released.

setSceneDetectorCallback

abstract void setSceneDetectorCallback(
    SceneDetectorCallback callback,
    Executor callbackExecutor
)

Sets the callback for scene detector.

Parameters
SceneDetectorCallback callback

The callback for scene detector.

Executor callbackExecutor

The executor to run the callback. If not provided, the callback will be run on the main thread.