# CameraExtensionCharacteristicsWrapper

Artifact: [androidx.camera:camera-common](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/common/CameraExtensionCharacteristicsWrapper.kt+class:androidx.camera.common.CameraExtensionCharacteristicsWrapper) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

*** ** * ** ***


```
interface CameraExtensionCharacteristicsWrapper : CameraCharacteristicsMetadata, UnsafeWrapper
```

<br />

Known direct subclasses [FakeCameraExtensionCharacteristics](https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` | A fake implementation of `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for testing. |

*** ** * ** ***

Compatibility wrapper around `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html`.

This wrapper provides type-safe, version-compatible access to the characteristics and capabilities of camera extension modes on a device. It extends `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata` to support querying characteristics keys and `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper` to allow accessing the underlying native characteristics object.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>?` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#getEstimatedCaptureLatencyRangeMillis(android.util.Size,kotlin.Int)( captureSize: https://developer.android.com/reference/android/util/Size.html, imageFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns the estimated capture latency range in milliseconds for the given capture size and format. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#getOutputSizes(kotlin.Int)(imageFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the output sizes supported for the given image format. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#getOutputSizes(java.lang.Class)(klass: https://developer.android.com/reference/java/lang/Class.html<*>)` Returns the output sizes supported for the given class (e.g., `https://developer.android.com/reference/android/graphics/SurfaceTexture.html`). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#getPostviewSizes(android.util.Size,kotlin.Int)(captureSize: https://developer.android.com/reference/android/util/Size.html, format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the supported postview sizes for a given capture size and format. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#cameraExtension()` The camera extension mode represented by this characteristics instance. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#cameraId()` The ID of the camera device associated with these extension characteristics. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#captureRequestKeys()` The set of capture request keys supported by this camera extension. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#captureResultKeys()` The set of capture result keys supported by this camera extension. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#dynamicKeys()` The set of camera characteristics keys that are dynamically updated for this extension. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#isCaptureProgressSupported()` Whether capture progress callbacks are supported for this extension mode. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#isPostviewSupported()` Whether postview is supported for this extension mode. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#isRestricted()` Whether access to some camera characteristics keys is restricted due to camera permissions. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#keys()` The set of camera characteristics keys supported by this camera extension. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper#restrictedKeys()` The set of camera characteristics keys that require specific permissions to be accessed. |

### Inherited functions

From [androidx.camera.common.CameraCharacteristicsMetadata](https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata) `operator T?` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#get(android.hardware.camera2.CameraCharacteristics.Key)(key: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<T>)`

Retrieves the value of the specified `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`.
`open T` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#getOrDefault(android.hardware.camera2.CameraCharacteristics.Key,kotlin.Any)(key: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<T>, default: T)`

Retrieves the value of the specified `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`, or returns `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#getOrDefault(android.hardware.camera2.CameraCharacteristics.Key,kotlin.Any)` if the value is `null` or the key is unsupported.
From [androidx.camera.common.Metadata](https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata) `operator T?` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata#get(androidx.camera.common.Metadata.Key)(key: https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<T>)`

Retrieves the value associated with the specified `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`.
`open T` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata#getOrDefault(androidx.camera.common.Metadata.Key,kotlin.Any)(key: https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<T>, default: T)`

Retrieves the value associated with the specified `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`, or returns `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata#getOrDefault(androidx.camera.common.Metadata.Key,kotlin.Any)` if the key is not present.
From [androidx.camera.common.UnsafeWrapper](https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper) `T?` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)(type: https://developer.android.com/reference/java/lang/Class.html<T>)`

Attempts to unwrap this object into the specified underlying `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`.

### Inherited properties

From [androidx.camera.common.Metadata](https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<*>>` `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata#metadataKeys()`

The set of all custom `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`s currently available in this container.

## Public functions

### getEstimatedCaptureLatencyRangeMillis

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun getEstimatedCaptureLatencyRangeMillis(
    captureSize: Size,
    imageFormat: Int
): Range<Long>?
```

Returns the estimated capture latency range in milliseconds for the given capture size and format.

| Parameters |
|---|---|
| `captureSize: https://developer.android.com/reference/android/util/Size.html` | the size of the capture. |
| `imageFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the format of the captured image. Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>?` | the range of estimated capture latency, or null if the latency is not available. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getEstimatedCaptureLatencyRangeMillis |

### getOutputSizes

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun getOutputSizes(imageFormat: Int): Set<Size>
```

Returns the output sizes supported for the given image format.

| Parameters |
|---|---|
| `imageFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the image format (e.g., `https://developer.android.com/reference/android/graphics/ImageFormat.html#JPEG`, `https://developer.android.com/reference/android/graphics/ImageFormat.html#YUV_420_888`). Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | the set of supported sizes for the image format. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getExtensionSupportedSizes |

### getOutputSizes

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun getOutputSizes(klass: Class<*>): Set<Size>
```

Returns the output sizes supported for the given class (e.g., `https://developer.android.com/reference/android/graphics/SurfaceTexture.html`).

| Parameters |
|---|---|
| `klass: https://developer.android.com/reference/java/lang/Class.html<*>` | the class of the output target. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | the set of supported sizes for the output class. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getExtensionSupportedSizes |

### getPostviewSizes

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun getPostviewSizes(captureSize: Size, format: Int): Set<Size>
```

Returns the supported postview sizes for a given capture size and format.

| Parameters |
|---|---|
| `captureSize: https://developer.android.com/reference/android/util/Size.html` | the size of the final high-quality capture. |
| `format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the image format of the postview. Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | the set of supported postview sizes, or an empty set if postview is not supported. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getPostviewSupportedSizes |

## Public properties

### cameraExtension

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val cameraExtension: Int
```

The camera extension mode represented by this characteristics instance.

Value is one of the native camera extension constants defined in `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` (e.g., `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_BOKEH`, `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_HDR`, `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_NIGHT`, `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_FACE_RETOUCH`, or `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_AUTOMATIC`).

### cameraId

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val cameraId: CameraId
```

The ID of the camera device associated with these extension characteristics.

### captureRequestKeys

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val captureRequestKeys: Set<CaptureRequest.Key<*>>
```

The set of capture request keys supported by this camera extension.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getAvailableCaptureRequestKeys |

### captureResultKeys

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val captureResultKeys: Set<CaptureResult.Key<*>>
```

The set of capture result keys supported by this camera extension.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getAvailableCaptureResultKeys |

### dynamicKeys

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val dynamicKeys: Set<CameraCharacteristics.Key<*>>
```

The set of camera characteristics keys that are dynamically updated for this extension.

### isCaptureProgressSupported

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val isCaptureProgressSupported: Boolean
```

Whether capture progress callbacks are supported for this extension mode.

If true, capture requests can report progress updates during the extension processing.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #isCaptureProcessProgressSupported |

### isPostviewSupported

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val isPostviewSupported: Boolean
```

Whether postview is supported for this extension mode.

A postview is a quickly available, lower-resolution preview of the captured image that can be displayed while the final high-quality capture is processing.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #isPostviewSupported |

### isRestricted

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val isRestricted: Boolean
```

Whether access to some camera characteristics keys is restricted due to camera permissions.

If true, querying restricted keys via `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#get(android.hardware.camera2.CameraCharacteristics.Key)` or `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#getOrDefault(android.hardware.camera2.CameraCharacteristics.Key,kotlin.Any)` may return null or default values, matching the behavior of restricted extension modes when CAMERA permission is not granted.

### keys

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val keys: Set<CameraCharacteristics.Key<*>>
```

The set of camera characteristics keys supported by this camera extension.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getKeys |

### restrictedKeys

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
val restrictedKeys: Set<CameraCharacteristics.Key<*>>
```

The set of camera characteristics keys that require specific permissions to be accessed.