Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#pubctors) \| [Methods](https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#inhmethods)

# ExtensionSessionConfiguration

*** ** * ** ***


`
public

final

class
ExtensionSessionConfiguration
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.camera2.params.ExtensionSessionConfiguration |

<br />

*** ** * ** ***

A class that aggregates all supported arguments for
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession` initialization.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#ExtensionSessionConfiguration(int,%20java.util.List<android.hardware.camera2.params.OutputConfiguration>,%20java.util.concurrent.Executor,%20android.hardware.camera2.CameraExtensionSession.StateCallback)(int extension, https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration> outputs, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession.StateCallback listener) ` Create a new ExtensionSessionConfiguration |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#clearColorSpace()() ` Clear the color space, such that the default color space will be used. |
| ` https://developer.android.com/reference/android/graphics/ColorSpace` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#getColorSpace()() ` Return the current color space. |
| ` https://developer.android.com/reference/java/util/concurrent/Executor` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#getExecutor()() ` Retrieve the Executor for the CameraExtensionSession instance. |
| ` int` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#getExtension()() ` Retrieve the extension type. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration>` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#getOutputConfigurations()() ` Retrieve the `https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration` list for the capture session. |
| ` https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#getPostviewOutputConfiguration()() ` Get the postview for still capture output configuration. |
| ` https://developer.android.com/reference/android/hardware/camera2/CaptureRequest` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#getSessionWideParams()() ` Retrieve the session wide camera parameters (see `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest`). |
| ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession.StateCallback` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#getStateCallback()() ` Retrieve the CameraCaptureSession.StateCallback listener. |
| ` void` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#setColorSpace(android.graphics.ColorSpace.Named)(https://developer.android.com/reference/android/graphics/ColorSpace.Named colorSpace) ` Set a specific device-supported color space. |
| ` void` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#setPostviewOutputConfiguration(android.hardware.camera2.params.OutputConfiguration)(https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration postviewOutput) ` Set the postview for still capture output configuration. |
| ` void` | ` https://developer.android.com/reference/android/hardware/camera2/params/ExtensionSessionConfiguration#setSessionWideParams(android.hardware.camera2.CaptureRequest)(https://developer.android.com/reference/android/hardware/camera2/CaptureRequest sessionCaptureParams) ` Sets the session wide camera parameters (see `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest`). |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### ExtensionSessionConfiguration

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ExtensionSessionConfiguration (int extension, 
                List<OutputConfiguration> outputs, 
                Executor executor, 
                CameraExtensionSession.StateCallback listener)
```

Create a new ExtensionSessionConfiguration

<br />

| Parameters ||
|---|---|
| `extension` | `int`: to be used for processing. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |
| `outputs` | `List`: a list of output configurations for the capture session. This value cannot be `null`. <br /> |
| `executor` | `Executor`: the executor which will be used for invoking the callbacks. This value cannot be `null`. <br /> |
| `listener` | `CameraExtensionSession.StateCallback`: callbacks to be invoked when the state of the CameraExtensionSession changes. This value cannot be `null`. <br /> |

## Public methods

### clearColorSpace

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void clearColorSpace ()
```

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

<br />

### getColorSpace

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ColorSpace getColorSpace ()
```

Return the current color space.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/ColorSpace` | the currently set color space, or null if not set <br /> |

### getExecutor

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Executor getExecutor ()
```

Retrieve the Executor for the CameraExtensionSession instance.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/concurrent/Executor` | The Executor on which the callback will be invoked. This value cannot be `null`. <br /> |

### getExtension

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getExtension ()
```

Retrieve the extension type.

<br />

| Returns ||
|---|---|
| `int` | the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |

### getOutputConfigurations

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<OutputConfiguration> getOutputConfigurations ()
```

Retrieve the `https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration` list for the capture
session.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration>` | A list of output configurations for the capture session. This value cannot be `null`. <br /> |

### getPostviewOutputConfiguration

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public OutputConfiguration getPostviewOutputConfiguration ()
```

Get the postview for still capture output configuration.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration` | output configuration for postview. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#isPostviewAvailable(int)`

### getSessionWideParams

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CaptureRequest getSessionWideParams ()
```

Retrieve the session wide camera parameters (see `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest`).

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest` | A capture request that includes the initial values for any available session wide capture keys. This value may be `null`. <br /> |

### getStateCallback

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CameraExtensionSession.StateCallback getStateCallback ()
```

Retrieve the CameraCaptureSession.StateCallback
listener.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession.StateCallback` | A state callback interface implementation. This value cannot be `null`. <br /> |

### setColorSpace

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setColorSpace (ColorSpace.Named colorSpace)
```

Set a specific device-supported color space.

Clients can choose from any profile advertised as supported in
`https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#REQUEST_AVAILABLE_COLOR_SPACE_PROFILES`
queried using `https://developer.android.com/reference/android/hardware/camera2/params/ColorSpaceProfiles#getSupportedColorSpaces(int)`.
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 `https://developer.android.com/reference/android/media/ImageReader`'s
constructor.

<br />

<br />

| Parameters ||
|---|---|
| `colorSpace` | `ColorSpace.Named`: This value cannot be `null`. <br /> |

### setPostviewOutputConfiguration

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setPostviewOutputConfiguration (OutputConfiguration postviewOutput)
```

Set the postview for still capture output configuration.

<br />

| Parameters ||
|---|---|
| `postviewOutput` | `OutputConfiguration`: output configuration for postview. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#isPostviewAvailable(int)`

### setSessionWideParams

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSessionWideParams (CaptureRequest sessionCaptureParams)
```

Sets the session wide camera parameters (see `https://developer.android.com/reference/android/hardware/camera2/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 `https://developer.android.com/reference/android/hardware/camera2/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.

<br />

| Parameters ||
|---|---|
| `sessionCaptureParams` | `CaptureRequest`: A capture request that includes the initial values for any available session wide capture keys. Tags (see `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Builder#setTag(java.lang.Object)`) and output targets (see `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Builder#addTarget(android.view.Surface)`) are ignored if set. Parameter values not part of `https://developer.android.com/reference/android/hardware/camera2/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`. <br /> |