CameraConfig

Camera configuration.

Summary

Enumerations

ArCameraConfigDepthSensorUsage{
  AR_CAMERA_CONFIG_DEPTH_SENSOR_USAGE_REQUIRE_AND_USE = 0x0001,
  AR_CAMERA_CONFIG_DEPTH_SENSOR_USAGE_DO_NOT_USE = 0x0002
}
enum
Depth sensor usage.
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.
ArCameraConfigTargetFps{
  AR_CAMERA_CONFIG_TARGET_FPS_30 = 0x0001,
  AR_CAMERA_CONFIG_TARGET_FPS_60 = 0x0002
}
enum
Target camera capture frame rates.

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 camera image dimensions for the given camera config.
ArCameraConfig_getTextureDimensions(const ArSession *session, const ArCameraConfig *camera_config, int32_t *out_width, int32_t *out_height)
void
Obtains the texture dimensions for the given camera config.

Enumerations

ArCameraConfigDepthSensorUsage

 ArCameraConfigDepthSensorUsage

Depth sensor usage.

Properties
AR_CAMERA_CONFIG_DEPTH_SENSOR_USAGE_DO_NOT_USE

When used as a camera filter, via ArCameraConfigFilter_setDepthSensorUsage(), filters for camera configs where a depth sensor is not present, or is present but will not be used by ARCore.

Most commonly used to filter camera configurations when the app requires exclusive access to the depth sensor outside of ARCore, for example to support 3D mesh reconstruction. Available on all ARCore supported devices.

When returned by ArCameraConfig_getDepthSensorUsage(), indicates that the camera config will not use a depth sensor, even if it is present.

AR_CAMERA_CONFIG_DEPTH_SENSOR_USAGE_REQUIRE_AND_USE

When used as a camera filter, via ArCameraConfigFilter_setDepthSensorUsage(), filters for camera configs that require a depth sensor to be present on the device, and that will be used by ARCore.

See the ARCore Supported Devices (https://developers.google.com/ar/discover/supported-devices) page for a list of devices that currently have supported depth sensors.

When returned by ArCameraConfig_getDepthSensorUsage(), indicates that a depth sensor is present, and that the camera config will use the available depth sensor.

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, include AR_SESSION_FEATURE_FRONT_CAMERA in the feature list passed to ArSession_createWithFeatures().

ArCameraConfigTargetFps

 ArCameraConfigTargetFps

Target camera capture frame rates.

The target frame rate represents the maximum or desired frame rate. Actual camera capture frame rates can be lower than the target frame rate under low light conditions in order to accommodate longer exposure times.

Properties
AR_CAMERA_CONFIG_TARGET_FPS_30

Target 30fps camera capture frame rate.

Available on all ARCore supported devices.

Used as a camera filter, via ArCameraConfigFilter_setTargetFps().

AR_CAMERA_CONFIG_TARGET_FPS_60

Target 60fps camera capture frame rate.

Increases power consumption and may increase app memory usage.

See the ARCore Supported Devices (https://developers.google.com/ar/discover/supported-devices) page for a list of devices that currently support 60fps.

Used as a camera filter, via ArCameraConfigFilter_setTargetFps().

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).

Allocate with ArCameraConfig_create()
Release with ArCameraConfig_destroy()

ArCameraConfigList

struct ArCameraConfigList_ ArCameraConfigList

A list of camera config (value type).

Allocate with ArCameraConfigList_create()
Release with ArCameraConfigList_destroy()

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
A 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.

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 camera image dimensions for the given camera config.

ArCameraConfig_getTextureDimensions

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

Obtains the texture dimensions for the given camera config.

Send feedback about...