ARCoreCameraDevice Class

This type is an EasyAR Sense API in C#: ARCoreCameraDevice . Some descriptions may not apply to Unity environment on this page.

This type is partially wrapped into Unity components: ARCoreFrameSource . Members and instances of this type are not required to be used directly in most situations. Use this type by ARCoreFrameSource.Device instead of creating new instances when a few unwrapped API is desired for use.

Description

ARCoreCameraDevice implements a camera device based on ARCore, which outputs InputFrame (including image, camera parameters, timestamp, 6DOF location, and tracking status).

Loading of libarcore_sdk_c.so with java.lang.System.loadLibrary is required.

After creation, start/stop can be invoked to start or stop video stream capture.

When the component is not needed anymore, call close function to close it. It shall not be used after calling close.

ARCoreCameraDevice outputs InputFrame from inputFrameSource. inputFrameSource shall be connected to InputFrameSink for use. Refer to Overview .

bufferCapacity is the capacity of InputFrame buffer. If the count of InputFrame which has been output from the device and have not been released is more than this number, the device will not output new InputFrame , until previous InputFrame have been released. This may cause screen stuck. Refer to Overview .

Caution: Currently, ARCore(v1.13.0) has memory leaks on creating and destroying sessions. Repeated creations and destructions will cause an increasing and non-reclaimable memory footprint.


Methods

isAvailable

C#

public static bool isAvailable()

Checks if the component is available. It returns true only on Android when ARCore is installed.

If called with libarcore_sdk_c.so not loaded, it returns false.

Notice: If ARCore is not supported on the device but ARCore apk is installed via side-loading, it will return true, but ARCore will not function properly.

isDeviceSupported

C#

public static bool isDeviceSupported()

Checks if the current device is supported.

bufferCapacity

C#

public virtual int bufferCapacity()

InputFrame buffer capacity. The default is 8.

setBufferCapacity

C#

public virtual void setBufferCapacity(int capacity)

Sets InputFrame buffer capacity.

inputFrameSource

C#

public virtual InputFrameSource inputFrameSource()

InputFrame output port.

setFocusMode

C#

public virtual void setFocusMode( ARCoreCameraDeviceFocusMode focusMode)

Sets focus mode to focusMode. Call before start.

start

C#

public virtual bool start()

Starts video stream capture.

stop

C#

public virtual void stop()

Stops video stream capture.

close

C#

public virtual void close()

Close. The component shall not be used after calling close.

type

C#

public virtual CameraDeviceType type()

Camera type.

cameraOrientation

C#

public virtual int cameraOrientation()

Angles rotation required to rotate clockwise and display camera image on device with natural orientation.

size

C#

public virtual Vec2I size()

Gets the current preview size.

frameRateRangeLower

C#

public virtual double frameRateRangeLower()

Gets lower bound of current frame rate range.

frameRateRangeUpper

C#

public virtual double frameRateRangeUpper()

Gets upper bound of current frame rate range.