ArCameraConfig

Camera configuration.

Summary

Enumerations

ArCameraConfigFacingDirection{
  AR_CAMERA_CONFIG_FACING_DIRECTION_BACK = 0,
  AR_CAMERA_CONFIG_FACING_DIRECTION_FRONT = 1
}
enum
Describes the direction a camera is facing relative to the device.

Typedefs

ArCameraConfig typedef
struct ArCameraConfig_
A camera config struct that contains the config supported by the physical camera obtained from the low level device profiles.
ArCameraConfigList typedef
struct ArCameraConfigList_
A list of camera config (value type).

Functions

ArCameraConfigList_create(const ArSession *session, ArCameraConfigList **out_list)
void
Creates a camera config list object.
ArCameraConfigList_destroy(ArCameraConfigList *list)
void
Releases the memory used by a camera config list object, along with all the camera config references it holds.
ArCameraConfigList_getItem(const ArSession *session, const ArCameraConfigList *list, int32_t index, ArCameraConfig *out_camera_config)
void
Retrieves the specific camera config based on the position in this list.
ArCameraConfigList_getSize(const ArSession *session, const ArCameraConfigList *list, int32_t *out_size)
void
Retrieves the number of camera configs in this list.
ArCameraConfig_create(const ArSession *session, ArCameraConfig **out_camera_config)
void
Creates a camera config object.
ArCameraConfig_destroy(ArCameraConfig *camera_config)
void
Releases the memory used by a camera config object.
ArCameraConfig_getCameraId(const ArSession *session, const ArCameraConfig *camera_config, char **out_camera_id)
void
Obtains the camera id for the given camera config which is obtained from the list of ARCore compatible camera configs.
ArCameraConfig_getDepthSensorUsage(const ArSession *session, const ArCameraConfig *camera_config, uint32_t *out_depth_sensor_usage)
void
Gets the depth sensor usage settings.
ArCameraConfig_getFacingDirection(const ArSession *session, const ArCameraConfig *camera_config, ArCameraConfigFacingDirection *out_facing)
void
Obtains the facing direction of the camera selected by this config.
ArCameraConfig_getFpsRange(const ArSession *session, const ArCameraConfig *camera_config, int32_t *out_min_fps, int32_t *out_max_fps)
void
Obtains the minimum and maximum camera capture rate in frames per second (fps) for the current camera config.
ArCameraConfig_getImageDimensions(const ArSession *session, const ArCameraConfig *camera_config, int32_t *out_width, int32_t *out_height)
void
Obtains the CPU camera image dimensions for the given camera config.
ArCameraConfig_getStereoCameraUsage(const ArSession *session, const ArCameraConfig *camera_config, ArCameraConfigStereoCameraUsage *out_stereo_camera_usage)
void
Gets the stereo multi-camera (https://source.android.com/devices/camera/multi-camera) usage settings.
ArCameraConfig_getTextureDimensions(const ArSession *session, const ArCameraConfig *camera_config, int32_t *out_width, int32_t *out_height)
void
Obtains the GPU texture dimensions for the given camera config.

Enumerations

ArCameraConfigFacingDirection

 ArCameraConfigFacingDirection

Describes the direction a camera is facing relative to the device.

Used by ArCameraConfig_getFacingDirection.

Properties
AR_CAMERA_CONFIG_FACING_DIRECTION_BACK

Camera looks out the back of the device (away from the user).

AR_CAMERA_CONFIG_FACING_DIRECTION_FRONT

Camera looks out the front of the device (towards the user).

To create a session using the front-facing (selfie) camera, use ArSession_setCameraConfig to set a front-facing (selfie) camera config retrieved from ArSession_getSupportedCameraConfigsWithFilter.

When the front camera is selected, ARCore's behavior changes in the following ways:

Typedefs

ArCameraConfig

struct ArCameraConfig_ ArCameraConfig

A camera config struct that contains the config supported by the physical camera obtained from the low level device profiles.

(value type).

ArCameraConfigList

struct ArCameraConfigList_ ArCameraConfigList

A list of camera config (value type).

Functions

ArCameraConfigList_create

void ArCameraConfigList_create(
  const ArSession *session,
  ArCameraConfigList **out_list
)

Creates a camera config list object.

Details
Parameters
session
The ARCore session
out_list
A pointer to an ArCameraConfigList* to receive the address of the newly allocated ArCameraConfigList.

ArCameraConfigList_destroy

void ArCameraConfigList_destroy(
  ArCameraConfigList *list
)

Releases the memory used by a camera config list object, along with all the camera config references it holds.

ArCameraConfigList_getItem

void ArCameraConfigList_getItem(
  const ArSession *session,
  const ArCameraConfigList *list,
  int32_t index,
  ArCameraConfig *out_camera_config
)

Retrieves the specific camera config based on the position in this list.

ArCameraConfigList_getSize

void ArCameraConfigList_getSize(
  const ArSession *session,
  const ArCameraConfigList *list,
  int32_t *out_size
)

Retrieves the number of camera configs in this list.

ArCameraConfig_create

void ArCameraConfig_create(
  const ArSession *session,
  ArCameraConfig **out_camera_config
)

Creates a camera config object.

Details
Parameters
session
The ARCore session
out_camera_config
Pointer to an ArCameraConfig* to receive the address of the newly allocated ArCameraConfig.

ArCameraConfig_destroy

void ArCameraConfig_destroy(
  ArCameraConfig *camera_config
)

Releases the memory used by a camera config object.

ArCameraConfig_getCameraId

void ArCameraConfig_getCameraId(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  char **out_camera_id
)

Obtains the camera id for the given camera config which is obtained from the list of ARCore compatible camera configs.

The acquired ID must be released after use by the ArString_release function.

ArCameraConfig_getDepthSensorUsage

void ArCameraConfig_getDepthSensorUsage(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  uint32_t *out_depth_sensor_usage
)

Gets the depth sensor usage settings.

out_depth_sensor_usage will contain one of the values from ArCameraConfigDepthSensorUsage enum.

ArCameraConfig_getFacingDirection

void ArCameraConfig_getFacingDirection(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  ArCameraConfigFacingDirection *out_facing
)

Obtains the facing direction of the camera selected by this config.

ArCameraConfig_getFpsRange

void ArCameraConfig_getFpsRange(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  int32_t *out_min_fps,
  int32_t *out_max_fps
)

Obtains the minimum and maximum camera capture rate in frames per second (fps) for the current camera config.

Actual capture frame rate will vary within this range, depending on lighting conditions. Frame rates will generally be lower under poor lighting conditions to accommodate longer exposure times.

ArCameraConfig_getImageDimensions

void ArCameraConfig_getImageDimensions(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  int32_t *out_width,
  int32_t *out_height
)

Obtains the CPU camera image dimensions for the given camera config.

ArCameraConfig_getStereoCameraUsage

void ArCameraConfig_getStereoCameraUsage(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  ArCameraConfigStereoCameraUsage *out_stereo_camera_usage
)

Gets the stereo multi-camera (https://source.android.com/devices/camera/multi-camera) usage settings.

out_stereo_camera_usage will contain one of the values from ArCameraConfigStereoCameraUsage enum.

ArCameraConfig_getTextureDimensions

void ArCameraConfig_getTextureDimensions(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  int32_t *out_width,
  int32_t *out_height
)

Obtains the GPU texture dimensions for the given camera config.