# SessionConfiguration

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

# SessionConfiguration

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/hardware/camera2/params/SessionConfiguration "View this page in Kotlin")\|Java

`
public

final

class
SessionConfiguration
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable)`


`

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

<br />

*** ** * ** ***

A helper class that aggregates all supported arguments for capture session initialization.

## Summary

|                                                                                                                                                                                                                                                 ### Constants                                                                                                                                                                                                                                                 ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [SESSION_HIGH_SPEED](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_HIGH_SPEED) A high speed session type that can only contain instances of[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration).                                                                                                                                                                                  |
| `int` | [SESSION_REGULAR](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_REGULAR) A regular session type containing instances of[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration)running at regular non high speed FPS ranges and optionally[InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration)for reprocessable sessions. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable) |-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) Descriptor bit used with[describeContents()](https://developer.android.com/reference/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor.                                                                                                                                            | | `int` | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE) Flag for use with[writeToParcel(Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

|                                                                                                                                                                        ### Fields                                                                                                                                                                         ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[Creator](https://developer.android.com/reference/android/os/Parcelable.Creator)`<`[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration)`>` | [CREATOR](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#CREATOR) <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                     ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SessionConfiguration(int,%20java.util.List<android.hardware.camera2.params.OutputConfiguration>))`(int sessionType, `[List](https://developer.android.com/reference/java/util/List)`<`[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration)`> outputs) ` Create a new[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration)with sessionType and output configurations.                                                                                                                                                                                                                                                                                                     |
| ` `[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SessionConfiguration(int,%20java.util.List<android.hardware.camera2.params.OutputConfiguration>,%20java.util.concurrent.Executor,%20android.hardware.camera2.CameraCaptureSession.StateCallback))`(int sessionType, `[List](https://developer.android.com/reference/java/util/List)`<`[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration)`> outputs, `[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)` executor, `[CameraCaptureSession.StateCallback](https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback)` cb) ` Create a new[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration). |

|                                                                                                                                                                                                                                                                                                                                                 ### Public methods                                                                                                                                                                                                                                                                                                                                                  ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                                                                                                                   | ` `[clearColorSpace](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#clearColorSpace())`() ` Clear the color space, such that the default color space will be used.                                                                                                                                                                                                                                                                                                         |
| ` int`                                                                                                                                                                                    | ` `[describeContents](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                                                                                                                                                                                                                                                      |
| ` boolean`                                                                                                                                                                                | ` `[equals](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Check if this[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration)is equal to another[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration).                                |
| ` `[ColorSpace](https://developer.android.com/reference/android/graphics/ColorSpace)                                                                                                      | ` `[getColorSpace](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#getColorSpace())`() ` Return the current color space.                                                                                                                                                                                                                                                                                                                                                    |
| ` `[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)                                                                                                      | ` `[getExecutor](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#getExecutor())`() ` Retrieve the[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)for the capture session.                                                                                                                                                                                                                                                                  |
| ` `[InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration)                                                                       | ` `[getInputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#getInputConfiguration())`() ` Retrieve the[InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration).                                                                                                                                                                                                                                      |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration)`>` | ` `[getOutputConfigurations](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#getOutputConfigurations())`() ` Retrieve the[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration)list for the capture session.                                                                                                                                                                                                    |
| ` `[CaptureRequest](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest)                                                                                      | ` `[getSessionParameters](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#getSessionParameters())`() ` Retrieve the session wide camera parameters (see[CaptureRequest](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest)).                                                                                                                                                                                                                  |
| ` int`                                                                                                                                                                                    | ` `[getSessionType](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#getSessionType())`() ` Retrieve the type of the capture session.                                                                                                                                                                                                                                                                                                                                        |
| ` `[CameraCaptureSession.StateCallback](https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback)                                              | ` `[getStateCallback](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#getStateCallback())`() ` Retrieve the[CameraCaptureSession.StateCallback](https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback)for the capture session.                                                                                                                                                                                                |
| ` int`                                                                                                                                                                                    | ` `[hashCode](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                                                                                                   | ` `[setColorSpace](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#setColorSpace(android.graphics.ColorSpace.Named))`(`[ColorSpace.Named](https://developer.android.com/reference/android/graphics/ColorSpace.Named)` colorSpace) ` Set a specific device-supported color space.                                                                                                                                                                                            |
| ` void`                                                                                                                                                                                   | ` `[setInputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#setInputConfiguration(android.hardware.camera2.params.InputConfiguration))`(`[InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration)` input) ` Sets the[InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration)for a reprocessable session.                                     |
| ` void`                                                                                                                                                                                   | ` `[setSessionParameters](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#setSessionParameters(android.hardware.camera2.CaptureRequest))`(`[CaptureRequest](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest)` params) ` Sets the session wide camera parameters (see[CaptureRequest](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest)).                                                                     |
| ` void`                                                                                                                                                                                   | ` `[setStateCallback](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#setStateCallback(java.util.concurrent.Executor,%20android.hardware.camera2.CameraCaptureSession.StateCallback))`(`[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)` executor, `[CameraCaptureSession.StateCallback](https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback)` cb) ` Set the state callback and executor. |
| ` void`                                                                                                                                                                                   | ` `[writeToParcel](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel.                                                                                                                                                                                                                                   |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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*.                                                                                             | ||
| From interface` `[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable)` ` |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`  | ` `[describeContents](https://developer.android.com/reference/android/os/Parcelable#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                    | | ` abstract void` | ` `[writeToParcel](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### SESSION_HIGH_SPEED

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

```
public static final int SESSION_HIGH_SPEED
```

A high speed session type that can only contain instances of[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration). The outputs can run using high speed FPS ranges. Calls to[setInputConfiguration(InputConfiguration)](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#setInputConfiguration(android.hardware.camera2.params.InputConfiguration))are not supported.

When using this type, the CameraCaptureSession returned by[CameraCaptureSession.StateCallback](https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback)can be cast to a[CameraConstrainedHighSpeedCaptureSession](https://developer.android.com/reference/android/hardware/camera2/CameraConstrainedHighSpeedCaptureSession)to access the extra methods for constrained high speed recording.

<br />

<br />

**See also:**

- [CameraDevice.createConstrainedHighSpeedCaptureSession(List, StateCallback, Handler)](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createConstrainedHighSpeedCaptureSession(java.util.List<android.view.Surface>,%20android.hardware.camera2.CameraCaptureSession.StateCallback,%20android.os.Handler))

Constant Value: 1 (0x00000001)  

### SESSION_REGULAR

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

```
public static final int SESSION_REGULAR
```

A regular session type containing instances of[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration)running at regular non high speed FPS ranges and optionally[InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration)for reprocessable sessions.

<br />

**See also:**

- [CameraDevice.createCaptureSession(SessionConfiguration)](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration))
- [CameraDevice.createReprocessableCaptureSession(InputConfiguration, List, StateCallback, Handler)](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createReprocessableCaptureSession(android.hardware.camera2.params.InputConfiguration,%20java.util.List<android.view.Surface>,%20android.hardware.camera2.CameraCaptureSession.StateCallback,%20android.os.Handler))

Constant Value: 0 (0x00000000)

## Fields

### CREATOR

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

```
public static final Creator<SessionConfiguration> CREATOR
```

<br />

<br />

## Public constructors

### SessionConfiguration

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

```
public SessionConfiguration (int sessionType, 
                List<OutputConfiguration> outputs)
```

Create a new[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration)with sessionType and output configurations.

The SessionConfiguration objects created by this constructor can be used by[CameraDeviceSetup.isSessionConfigurationSupported](https://developer.android.com/reference/android/hardware/camera2/CameraDevice.CameraDeviceSetup#isSessionConfigurationSupported(android.hardware.camera2.params.SessionConfiguration))and[CameraDevice.CameraDeviceSetup.getSessionCharacteristics(SessionConfiguration)](https://developer.android.com/reference/android/hardware/camera2/CameraDevice.CameraDeviceSetup#getSessionCharacteristics(android.hardware.camera2.params.SessionConfiguration))to query a camera device's feature combination support and session specific characteristics. For the SessionConfiguration object to be used to create a capture session,[setStateCallback(Executor, StateCallback)](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#setStateCallback(java.util.concurrent.Executor,%20android.hardware.camera2.CameraCaptureSession.StateCallback))must be called to specify the state callback function, and any incomplete OutputConfigurations must be completed via[OutputConfiguration.addSurface](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration#addSurface(android.view.Surface))or[OutputConfiguration.setSurfacesForMultiResolutionOutput](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration#setSurfacesForMultiResolutionOutput(java.util.Collection<android.hardware.camera2.params.OutputConfiguration>,%20android.hardware.camera2.MultiResolutionImageReader))as appropriate.

<br />

<br />

|                                                                                                                                                           Parameters                                                                                                                                                            ||
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sessionType` | `int`: The session type. Value is[SESSION_REGULAR](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_REGULAR), or[SESSION_HIGH_SPEED](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_HIGH_SPEED) <br /> |
| `outputs`     | `List`: A list of output configurations for the capture session. This value cannot be`null`. <br />                                                                                                                                                                                                              |

**See also:**

- [SESSION_REGULAR](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_REGULAR)
- [SESSION_HIGH_SPEED](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_HIGH_SPEED)
- [CameraDevice.createCaptureSession(SessionConfiguration)](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration))
- [CameraDevice.CameraDeviceSetup.isSessionConfigurationSupported(SessionConfiguration)](https://developer.android.com/reference/android/hardware/camera2/CameraDevice.CameraDeviceSetup#isSessionConfigurationSupported(android.hardware.camera2.params.SessionConfiguration))
- [CameraDevice.CameraDeviceSetup.getSessionCharacteristics(SessionConfiguration)](https://developer.android.com/reference/android/hardware/camera2/CameraDevice.CameraDeviceSetup#getSessionCharacteristics(android.hardware.camera2.params.SessionConfiguration))  

### SessionConfiguration

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

```
public SessionConfiguration (int sessionType, 
                List<OutputConfiguration> outputs, 
                Executor executor, 
                CameraCaptureSession.StateCallback cb)
```

Create a new[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration).

<br />

|                                                                                                                                                                                                                                                                                                                                                                           Parameters                                                                                                                                                                                                                                                                                                                                                                           ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sessionType` | `int`: The session type. Value is[SESSION_REGULAR](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_REGULAR), or[SESSION_HIGH_SPEED](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_HIGH_SPEED) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `outputs`     | `List`: A list of output configurations for the capture session. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `executor`    | `Executor`: The executor which should be used to invoke the callback. In general it is recommended that camera operations are not done on the main (UI) thread. This value cannot be`null`. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/java/util/concurrent/Executor), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/android/content/Context#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)that dispatches to an appropriate thread. <br /> |
| `cb`          | `CameraCaptureSession.StateCallback`: A state callback interface implementation. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

**See also:**

- [SESSION_REGULAR](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_REGULAR)
- [SESSION_HIGH_SPEED](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_HIGH_SPEED)
- [CameraDevice.createCaptureSession(SessionConfiguration)](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration))

## Public methods

### clearColorSpace

Added in[API level 34](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 />

### describeContents

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

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of[writeToParcel(android.os.Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)), the return value of this method must include the[CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR)bit.

<br />

|                                                                                                                         Returns                                                                                                                         ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) <br /> |

### equals

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

```
public boolean equals (Object obj)
```

Check if this[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration)is equal to another[SessionConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration).

Two output session configurations are only equal if and only if the underlying input configuration, output configurations, and session type are equal.

<br />

<br />

|                    Parameters                    ||
|-------|-------------------------------------------|
| `obj` | `Object`: This value may be`null`. <br /> |

|                              Returns                               ||
|-----------|---------------------------------------------------------|
| `boolean` | `true`if the objects were equal,`false`otherwise <br /> |

### getColorSpace

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

```
public ColorSpace getColorSpace ()
```

Return the current color space.

<br />

|                                                                     Returns                                                                      ||
|-----------------------------------------------------------------------------------|---------------------------------------------------------------|
| [ColorSpace](https://developer.android.com/reference/android/graphics/ColorSpace) | the currently set color space This value may be`null`. <br /> |

### getExecutor

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

```
public Executor getExecutor ()
```

Retrieve the[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)for the capture session.

<br />

|                                                                    Returns                                                                    ||
|-----------------------------------------------------------------------------------|------------------------------------------------------------|
| [Executor](https://developer.android.com/reference/java/util/concurrent/Executor) | The Executor on which the callback will be invoked. <br /> |

### getInputConfiguration

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

```
public InputConfiguration getInputConfiguration ()
```

Retrieve the[InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration).

<br />

|                                                                              Returns                                                                              ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| [InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration) | The capture session input configuration. <br /> |

### getOutputConfigurations

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

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

Retrieve the[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration)list for the capture session.

<br />

|                                                                                                                         Returns                                                                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[OutputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration)`>` | A list of output configurations for the capture session. <br /> |

### getSessionParameters

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

```
public CaptureRequest getSessionParameters ()
```

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

<br />

|                                                                                                  Returns                                                                                                  ||
|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| [CaptureRequest](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest) | A capture request that includes the initial values for any available session wide capture keys. <br /> |

### getSessionType

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

```
public int getSessionType ()
```

Retrieve the type of the capture session.

<br />

|                                                                                                                                                         Returns                                                                                                                                                          ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | The capture session type. Value is[SESSION_REGULAR](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_REGULAR), or[SESSION_HIGH_SPEED](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_HIGH_SPEED) <br /> |

### getStateCallback

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

```
public CameraCaptureSession.StateCallback getStateCallback ()
```

Retrieve the[CameraCaptureSession.StateCallback](https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback)for the capture session.

<br />

|                                                                                           Returns                                                                                            ||
|-------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [CameraCaptureSession.StateCallback](https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback) | A state callback interface implementation. <br /> |

### hashCode

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

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by[HashMap](https://developer.android.com/reference/java/util/HashMap).

The general contract of`hashCode`is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the`hashCode`method must consistently return the same integer, provided no information used in`equals`comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))method, then calling the`hashCode`method on each of the two objects must produce the same integer result.
- It is*not* required that if two objects are unequal according to the[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))method, then calling the`hashCode`method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

|                     Returns                      ||
|-------|-------------------------------------------|
| `int` | a hash code value for this object. <br /> |

### setColorSpace

Added in[API level 34](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[CameraCharacteristics.REQUEST_AVAILABLE_COLOR_SPACE_PROFILES](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#REQUEST_AVAILABLE_COLOR_SPACE_PROFILES)queried using[ColorSpaceProfiles.getSupportedColorSpaces](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[ImageReader](https://developer.android.com/reference/android/media/ImageReader)'s constructor.

<br />

<br />

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

### setInputConfiguration

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

```
public void setInputConfiguration (InputConfiguration input)
```

Sets the[InputConfiguration](https://developer.android.com/reference/android/hardware/camera2/params/InputConfiguration)for a reprocessable session. Input configuration are not supported for[SESSION_HIGH_SPEED](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_HIGH_SPEED).

<br />

|                                       Parameters                                       ||
|---------|-------------------------------------------------------------------------------|
| `input` | `InputConfiguration`: Input configuration. This value cannot be`null`. <br /> |

|                                                                                                                                                   Throws                                                                                                                                                   ||
|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | In case it is called for[SESSION_HIGH_SPEED](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SESSION_HIGH_SPEED)type session configuration. |

### setSessionParameters

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

```
public void setSessionParameters (CaptureRequest params)
```

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

### setStateCallback

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

```
public void setStateCallback (Executor executor, 
                CameraCaptureSession.StateCallback cb)
```

Set the state callback and executor.

This function must be called for the SessionConfiguration object created via[SessionConfiguration(int, List<OutputConfiguration>)](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#SessionConfiguration(int,%20java.util.List<android.hardware.camera2.params.OutputConfiguration>))before it's used to create a capture session.

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                                                                                                                          ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `executor` | `Executor`: The executor which should be used to invoke the callback. In general it is recommended that camera operations are not done on the main (UI) thread. This value cannot be`null`. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/java/util/concurrent/Executor), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/android/content/Context#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)that dispatches to an appropriate thread. <br /> |
| `cb`       | `CameraCaptureSession.StateCallback`: A state callback interface implementation. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### writeToParcel

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

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

|                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | `Parcel`: The Parcel in which the object should be written. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                 |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE). Value is either`0`or a combination of[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES <br /> |