**Name String**

`XR_ANDROID_passthrough_camera_state`

**Extension Type**

Instance extension

**Registered Extension Number**

461

**Revision**

1

**Extension and Version Dependencies**

[OpenXR 1.0](https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#versions-1.0)

**Last Modified Date**

2024-09-05

**Contributors**

Spencer Quin, Google

Jared Finder, Google

Kevin Moule, Google

Nihav Jain, Google

## Overview

The passthrough camera can take time to start up and may not be immediately
available. This extension lets applications know the current state of the
passthrough camera.

## Get the current passthrough camera state

    XrResult xrGetPassthroughCameraStateANDROID(
        XrSession                                   session,
        const XrPassthroughCameraStateGetInfoANDROID* getInfo,
        XrPassthroughCameraStateANDROID*            cameraStateOutput);

### Parameter Descriptions

- `session` is an [XrSession](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrSession) handle previously created with [xrCreateSession](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#xrCreateSession).
- `getInfo` is any info that will affect how camera state is determined.
- `cameraStateOutput` is the current state of the camera.

[xrGetPassthroughCameraStateANDROID](https://developer.android.com/develop/xr/openxr/extensions/XR_ANDROID_passthrough_camera_state#xrGetPassthroughCameraStateANDROID) retrieves the current state of the
passthrough camera.

The [XrPassthroughCameraStateGetInfoANDROID](https://developer.android.com/develop/xr/openxr/extensions/XR_ANDROID_passthrough_camera_state#XrPassthroughCameraStateGetInfoANDROID) structure is an input/output
struct which specifies the camera state request
parameters.  

    typedef struct XrPassthroughCameraStateGetInfoANDROID {
        XrStructureType    type;
        void*              next;
    } XrPassthroughCameraStateGetInfoANDROID;

### Member Descriptions

- `type` is the [XrStructureType](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrStructureType) of this structure.
- `next` is `NULL` or a pointer to the next structure in a structure chain.

The [XrPassthroughCameraStateANDROID](https://developer.android.com/develop/xr/openxr/extensions/XR_ANDROID_passthrough_camera_state#XrPassthroughCameraStateANDROID) enumeration identifies different states
which the passthrough camera can be in.  

    typedef enum XrPassthroughCameraStateANDROID {
        XR_PASSTHROUGH_CAMERA_STATE_DISABLED_ANDROID = 0,
        XR_PASSTHROUGH_CAMERA_STATE_INITIALIZING_ANDROID = 1,
        XR_PASSTHROUGH_CAMERA_STATE_READY_ANDROID = 2,
        XR_PASSTHROUGH_CAMERA_STATE_ERROR_ANDROID = 3,
        XR_PASSTHROUGH_CAMERA_STATE_MAX_ENUM_ANDROID = 0x7FFFFFFF
    } XrPassthroughCameraStateANDROID;

The enums have the following meanings:

|                        Enum                        |                           Description                           |
|----------------------------------------------------|-----------------------------------------------------------------|
| `XR_PASSTHROUGH_CAMERA_STATE_DISABLED_ANDROID`     | The camera has been disabled by an app, the system or the user. |
| `XR_PASSTHROUGH_CAMERA_STATE_INITIALIZING_ANDROID` | The camera is still coming online and not yet ready to use.     |
| `XR_PASSTHROUGH_CAMERA_STATE_READY_ANDROID`        | The camera is ready to use.                                     |
| `XR_PASSTHROUGH_CAMERA_STATE_ERROR_ANDROID`        | The camera is in an unrecoverable error state.                  |

**New Object Types**

**New Flag Types**

**New Enum Constants**

[XrStructureType](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrStructureType) enumeration is extended with:

- `XR_TYPE_PASSTHROUGH_CAMERA_STATE_GET_INFO_ANDROID`

**New Enums**

- [XrPassthroughCameraStateANDROID](https://developer.android.com/develop/xr/openxr/extensions/XR_ANDROID_passthrough_camera_state#XrPassthroughCameraStateANDROID)

**New Structures**

- [XrPassthroughCameraStateGetInfoANDROID](https://developer.android.com/develop/xr/openxr/extensions/XR_ANDROID_passthrough_camera_state#XrPassthroughCameraStateGetInfoANDROID)

**New Functions**

- [xrGetPassthroughCameraStateANDROID](https://developer.android.com/develop/xr/openxr/extensions/XR_ANDROID_passthrough_camera_state#xrGetPassthroughCameraStateANDROID)

**Issues**

**Version History**

- Revision 1, 2024-09-05 (Spencer Quin)
- Initial version.

*** ** * ** ***

OpenXR™ and the OpenXR logo are trademarks owned
by The Khronos Group Inc. and are registered as a trademark in China,
the European Union, Japan and the United Kingdom.