> Documentation index: https://developer.android.com/reference/llms.txt

# CameraCharacteristicsWrapper.Keys

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

*** ** * ** ***


```
public static class CameraCharacteristicsWrapper.Keys
```

<br />

*** ** * ** ***

Custom `Metadata.Key` definitions for querying library-defined camera characteristics on a `CameraCharacteristicsWrapper`.

These keys represent extended or compatibility-wrapped metadata that can be queried from `CameraCharacteristicsWrapper` using `Metadata.get`.

| See also |
|---|---|
| `CameraCharacteristicsWrapper` |   |
| `Metadata.Key` |   |

## Summary

| ### Public fields |
|---|---|
| `static final @NonNull Metadata.Key<@NonNull ColorSpaceProfilesWrapper>` | `AVAILABLE_COLOR_SPACE_PROFILES` Key for retrieving the `ColorSpaceProfilesWrapper` supported by the camera device. |
| `static final @NonNull Metadata.Key<@NonNull DynamicRangeProfilesWrapper>` | `AVAILABLE_DYNAMIC_RANGE_PROFILES` Key for retrieving the `DynamicRangeProfilesWrapper` supported by the camera device. |
| `static @NonNull CameraCharacteristicsWrapper.Keys` | `INSTANCE` |
| `static final @NonNull Metadata.Key<@NonNull StreamConfigurationMapWrapper>` | `STREAM_CONFIGURATION_MAP` Key for `StreamConfigurationMapWrapper`. |

## Public fields

### AVAILABLE_COLOR_SPACE_PROFILES

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

```
public static final @NonNull Metadata.Key<@NonNull ColorSpaceProfilesWrapper> AVAILABLE_COLOR_SPACE_PROFILES
```

Key for retrieving the `ColorSpaceProfilesWrapper` supported by the camera device.

### AVAILABLE_DYNAMIC_RANGE_PROFILES

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

```
public static final @NonNull Metadata.Key<@NonNull DynamicRangeProfilesWrapper> AVAILABLE_DYNAMIC_RANGE_PROFILES
```

Key for retrieving the `DynamicRangeProfilesWrapper` supported by the camera device.

### INSTANCE

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

```
public static @NonNull CameraCharacteristicsWrapper.Keys INSTANCE
```

### STREAM_CONFIGURATION_MAP

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

```
public static final @NonNull Metadata.Key<@NonNull StreamConfigurationMapWrapper> STREAM_CONFIGURATION_MAP
```

Key for `StreamConfigurationMapWrapper`.

Use this key to query the compatibility wrapper for `android.hardware.camera2.params.StreamConfigurationMap`.

Prefer using the `CameraCharacteristicsWrappers.streamConfigurationMap` property to access this value.

```kotlin
import androidx.camera.common.CameraCharacteristicsWrapper
import androidx.camera.common.CameraCharacteristicsWrappers.streamConfigurationMap
import androidx.camera.common.CameraId
import androidx.camera.common.testing.FakeCameraCharacteristics
import androidx.camera.common.testing.FakeStreamConfigurationMap
import androidx.camera.common.testing.FakeStreamConfigurationMap.OutputKey
import androidx.camera.common.testing.FakeStreamConfigurationMap.OutputValues

// Create a fake stream configuration map with custom resolutions and formats.
val fakeStreamConfigurationMap =
    FakeStreamConfigurationMap(
        outputsTable =
            linkedMapOf(
                OutputKey(ImageFormat.YUV_420_888, Size(1920, 1080)) to OutputValues(),
                OutputKey(ImageFormat.JPEG, Size(1920, 1080)) to
                    OutputValues(
                        stallDuration = 200_000_000L // 200ms stall duration
                    ),
            )
    )

// Supply the fake stream configuration map via STREAM_CONFIGURATION_MAP metadata key.
val fakeCharacteristics: CameraCharacteristicsWrapper =
    FakeCameraCharacteristics(
        cameraId = CameraId("0"),
        cameraCharacteristics =
            mapOf(
                CameraCharacteristics.LENS_FACING to CameraCharacteristics.LENS_FACING_BACK,
                CameraCharacteristics.SENSOR_ORIENTATION to 90,
            ),
        cameraMetadata =
            mapOf(
                CameraCharacteristicsWrapper.Keys.STREAM_CONFIGURATION_MAP to
                    fakeStreamConfigurationMap
            ),
    )

// The extension property accesses the wrapped version (STREAM_CONFIGURATION_MAP) first,
// returning the FakeStreamConfigurationMap in unit tests without needing real camera hardware.
val streamConfigMap = checkNotNull(fakeCharacteristics.streamConfigurationMap)
val supportedFormats = streamConfigMap.getOutputFormats()
val yuvSizes = streamConfigMap.getOutputSizes(ImageFormat.YUV_420_888)
```