Table of Contents

Class ARCoreCameraDevice

Namespace
easyar

ARCoreCameraDevice implements an ARCore-based camera device and outputs InputFrame (including image, camera parameters, timestamp, 6DOF position information, and tracking status). Before use, java.lang.System.loadLibrary must be used to load libarcore_sdk_c.so. After creation, start/stop can be called to start and stop collecting video stream data. When the device is no longer needed, close can be called to close it. It should not be used after close. ARCoreCameraDevice outputs InputFrame through inputFrameSource, and inputFrameSource should be connected to InputFrameSink for use. bufferCapacity represents the capacity of the InputFrame buffer. If more than this number of InputFrame are output from the device and not released, the device will stop outputting new InputFrame until previous InputFrame are released. This may cause issues such as the image freezing. Note: The current ARCore (v1.13.0) implementation has a memory leak when creating and destroying sessions. Creating and destroying repeatedly will cause memory usage to keep increasing and not be released after destruction.

ARCoreCameraDevice

Constructors

ARCoreCameraDevice

void easyar_ARCoreCameraDevice__ctor(easyar_ARCoreCameraDevice * * Return)
ARCoreCameraDevice()
public ARCoreCameraDevice()
constructor()
+ (easyar_ARCoreCameraDevice *) create
public convenience init()
public ARCoreCameraDevice()

Methods

isAvailable

Checks whether it is available. Returns true only on Android systems with ARCore installed. Calling it without loading libarcore_sdk_c.so returns false. Note: If the device does not support ARCore but the ARCore apk is installed by sideloading, this function will return true, but ARCore cannot work properly.

bool easyar_ARCoreCameraDevice_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
+ (bool)isAvailable
public static func isAvailable() -> Bool
public static bool isAvailable()

Returns

Type Description
Boolean

isDeviceSupported

Checks whether the current device is supported.

bool easyar_ARCoreCameraDevice_isDeviceSupported(void)
static bool isDeviceSupported()
public static boolean isDeviceSupported()
companion object fun isDeviceSupported(): Boolean
+ (bool)isDeviceSupported
public static func isDeviceSupported() -> Bool
public static bool isDeviceSupported()

Returns

Type Description
Boolean

bufferCapacity

Capacity of the InputFrame buffer. The default value is 8.

int easyar_ARCoreCameraDevice_bufferCapacity(const easyar_ARCoreCameraDevice * This)
int bufferCapacity()
public int bufferCapacity()
fun bufferCapacity(): Int
- (int)bufferCapacity
public func bufferCapacity() -> Int32
public virtual int bufferCapacity()

Returns

Type Description
Int32

setBufferCapacity

Sets the capacity of the InputFrame buffer.

void easyar_ARCoreCameraDevice_setBufferCapacity(easyar_ARCoreCameraDevice * This, int capacity)
void setBufferCapacity(int capacity)
public void setBufferCapacity(int capacity)
fun setBufferCapacity(capacity: Int): Unit
- (void)setBufferCapacity:(int)capacity
public func setBufferCapacity(_ capacity: Int32) -> Void
public virtual void setBufferCapacity(int capacity)

Parameters

Name Type Description
capacity Int32

Returns

Type Description
Void

inputFrameSource

InputFrame output port.

void easyar_ARCoreCameraDevice_inputFrameSource(easyar_ARCoreCameraDevice * This, easyar_InputFrameSource * * Return)
std::shared_ptr<InputFrameSource> inputFrameSource()
public @Nonnull InputFrameSource inputFrameSource()
fun inputFrameSource(): InputFrameSource
- (easyar_InputFrameSource *)inputFrameSource
public func inputFrameSource() -> InputFrameSource
public virtual InputFrameSource inputFrameSource()

Returns

Type Description
InputFrameSource

setFocusMode

Sets the focus mode to focusMode.

void easyar_ARCoreCameraDevice_setFocusMode(easyar_ARCoreCameraDevice * This, easyar_ARCoreCameraDeviceFocusMode focusMode)
void setFocusMode(ARCoreCameraDeviceFocusMode focusMode)
public void setFocusMode(int focusMode)
fun setFocusMode(focusMode: Int): Unit
- (void)setFocusMode:(easyar_ARCoreCameraDeviceFocusMode)focusMode
public func setFocusMode(_ focusMode: ARCoreCameraDeviceFocusMode) -> Void
public virtual void setFocusMode(ARCoreCameraDeviceFocusMode focusMode)

Parameters

Name Type Description
focusMode ARCoreCameraDeviceFocusMode

Returns

Type Description
Void

start

Starts collecting video stream data.

bool easyar_ARCoreCameraDevice_start(easyar_ARCoreCameraDevice * This)
bool start()
public boolean start()
fun start(): Boolean
- (bool)start
public func start() -> Bool
public virtual bool start()

Returns

Type Description
Boolean

stop

Stops collecting video stream data.

void easyar_ARCoreCameraDevice_stop(easyar_ARCoreCameraDevice * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()

Returns

Type Description
Void

close

Closes. It should not be used after close.

void easyar_ARCoreCameraDevice_close(easyar_ARCoreCameraDevice * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()

Returns

Type Description
Void

type

Camera type.

easyar_CameraDeviceType easyar_ARCoreCameraDevice_type(const easyar_ARCoreCameraDevice * This)
CameraDeviceType type()
public int type()
fun type(): Int
- (easyar_CameraDeviceType)type
public func type() -> CameraDeviceType
public virtual CameraDeviceType type()

Returns

Type Description
CameraDeviceType

cameraOrientation

Clockwise rotation angle required for displaying the camera image in the natural orientation of the device.

int easyar_ARCoreCameraDevice_cameraOrientation(const easyar_ARCoreCameraDevice * This)
int cameraOrientation()
public int cameraOrientation()
fun cameraOrientation(): Int
- (int)cameraOrientation
public func cameraOrientation() -> Int32
public virtual int cameraOrientation()

Returns

Type Description
Int32

size

Gets the current image size.

easyar_Vec2I easyar_ARCoreCameraDevice_size(const easyar_ARCoreCameraDevice * This)
Vec2I size()
public @Nonnull Vec2I size()
fun size(): Vec2I
- (easyar_Vec2I *)size
public func size() -> Vec2I
public virtual Vec2I size()

Returns

Type Description
Vec2I

frameRateRangeLower

Gets the lower bound of the current frame rate range.

double easyar_ARCoreCameraDevice_frameRateRangeLower(const easyar_ARCoreCameraDevice * This)
double frameRateRangeLower()
public double frameRateRangeLower()
fun frameRateRangeLower(): Double
- (double)frameRateRangeLower
public func frameRateRangeLower() -> Double
public virtual double frameRateRangeLower()

Returns

Type Description
Double

frameRateRangeUpper

Gets the upper bound of the current frame rate range.

double easyar_ARCoreCameraDevice_frameRateRangeUpper(const easyar_ARCoreCameraDevice * This)
double frameRateRangeUpper()
public double frameRateRangeUpper()
fun frameRateRangeUpper(): Double
- (double)frameRateRangeUpper
public func frameRateRangeUpper() -> Double
public virtual double frameRateRangeUpper()

Returns

Type Description
Double