Added in API level 31

ExtensionSessionConfiguration


class ExtensionSessionConfiguration
kotlin.Any
   ↳ android.hardware.camera2.params.ExtensionSessionConfiguration

A class that aggregates all supported arguments for CameraExtensionSession initialization.

Summary

Public constructors

Create a new ExtensionSessionConfiguration

Public methods
Unit

Clear the color space, such that the default color space will be used.

ColorSpace?

Return the current color space.

Executor

Retrieve the Executor for the CameraExtensionSession instance.

Int

Retrieve the extension type.

MutableList<OutputConfiguration!>

Retrieve the OutputConfiguration list for the capture session.

OutputConfiguration?

Get the postview for still capture output configuration.

CaptureRequest?

Retrieve the session wide camera parameters (see CaptureRequest).

CameraExtensionSession.StateCallback

Retrieve the CameraCaptureSession.

Unit

Set a specific device-supported color space.

Unit

Set the postview for still capture output configuration.

Unit
setSessionWideParams(sessionCaptureParams: CaptureRequest)

Sets the session wide camera parameters (see CaptureRequest).

Public constructors

ExtensionSessionConfiguration

Added in API level 31
ExtensionSessionConfiguration(
    extension: Int,
    outputs: MutableList<OutputConfiguration!>,
    executor: Executor,
    listener: CameraExtensionSession.StateCallback)

Create a new ExtensionSessionConfiguration

Parameters
extension Int: to be used for processing.
Value is either 0 or a combination of the following:
outputs MutableList<OutputConfiguration!>: a list of output configurations for the capture session.
This value cannot be null.
executor Executor: the executor which will be used for invoking the callbacks.
This value cannot be null.
listener CameraExtensionSession.StateCallback: callbacks to be invoked when the state of the CameraExtensionSession changes.
This value cannot be null.

Public methods

clearColorSpace

Added in API level 35
fun clearColorSpace(): Unit

Clear the color space, such that the default color space will be used.

getColorSpace

Added in API level 35
fun getColorSpace(): ColorSpace?

Return the current color space.

Return
ColorSpace? the currently set color space, or null if not set

getExecutor

Added in API level 31
fun getExecutor(): Executor

Retrieve the Executor for the CameraExtensionSession instance.

Return
Executor The Executor on which the callback will be invoked.
This value cannot be null.

getOutputConfigurations

Added in API level 31
fun getOutputConfigurations(): MutableList<OutputConfiguration!>

Retrieve the OutputConfiguration list for the capture session.

Return
MutableList<OutputConfiguration!> A list of output configurations for the capture session.
This value cannot be null.

getPostviewOutputConfiguration

Added in API level 34
fun getPostviewOutputConfiguration(): OutputConfiguration?

Get the postview for still capture output configuration.

Return
OutputConfiguration? output configuration for postview.
This value may be null.

getSessionWideParams

Added in API level 31
fun getSessionWideParams(): CaptureRequest?

Retrieve the session wide camera parameters (see CaptureRequest).

Return
CaptureRequest? A capture request that includes the initial values for any available session wide capture keys.
This value may be null.

getStateCallback

Added in API level 31
fun getStateCallback(): CameraExtensionSession.StateCallback

Retrieve the CameraCaptureSession.StateCallback listener.

Return
CameraExtensionSession.StateCallback A state callback interface implementation.
This value cannot be null.

setColorSpace

Added in API level 35
fun setColorSpace(colorSpace: ColorSpace.Named): Unit

Set a specific device-supported color space.

Clients can choose from any profile advertised as supported in CameraCharacteristics.REQUEST_AVAILABLE_COLOR_SPACE_PROFILES queried using ColorSpaceProfiles.getSupportedColorSpaces. When set, the colorSpace will override the default color spaces of the output targets, or the color space implied by the dataSpace passed into an ImageReader's constructor.

Parameters
colorSpace ColorSpace.Named: This value cannot be null.

setPostviewOutputConfiguration

Added in API level 34
fun setPostviewOutputConfiguration(postviewOutput: OutputConfiguration?): Unit

Set the postview for still capture output configuration.

Parameters
postviewOutput OutputConfiguration?: output configuration for postview.
This value may be null.

setSessionWideParams

Added in API level 31
fun setSessionWideParams(sessionCaptureParams: CaptureRequest): Unit

Sets the session wide camera parameters (see CaptureRequest). This argument can be set for every supported session type and will be passed to the camera device as part of the capture session initialization. Session parameters are a subset of the available capture request parameters (see CameraCharacteristics.getAvailableSessionKeys) and their application can introduce internal camera delays. To improve camera performance it is suggested to change them sparingly within the lifetime of the capture session and to pass their initial values as part of this method.

Parameters
sessionCaptureParams CaptureRequest: A capture request that includes the initial values for any available session wide capture keys. Tags (see CaptureRequest.Builder.setTag) and output targets (see CaptureRequest.Builder.addTarget) are ignored if set. Parameter values not part of CameraCharacteristics.getAvailableSessionKeys will also be ignored. It is recommended to build the session parameters using the same template type as the initial capture request, so that the session and initial request parameters match as much as possible.
This value cannot be null.