Table of Contents

Class ARCoreCameraDevice

Namespace
easyar

ARCoreCameraDevice implements an ARCore-based camera device that outputs InputFrame (containing images, camera parameters, timestamps, 6DOF position information, and tracking status). When using it, first use java.lang.System.loadLibrary to load libarcore_sdk_c.so. After creation, you can call start/stop to begin and stop collecting video stream data. When the device is no longer needed, call close to shut it down. After close, it should not be used further. ARCoreCameraDevice outputs InputFrame through inputFrameSource, and inputFrameSource should be connected to InputFrameSink for use. bufferCapacity represents the buffer capacity of InputFrame. If more than this number of InputFrame are output from this device and not released, the device will stop outputting new InputFrame until the previous ones are released. This may cause issues such as screen freezes. Note: The current implementation of ARCore (v1.13.0) has memory leaks when creating and destroying sessions. Repeated creation and destruction can lead to continuously growing memory usage that is not released even 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 if available. Returns true only on Android systems with ARCore installed. Calling without loading libarcore_sdk_c.so will return false. Note: If the device does not support ARCore, but has the ARCore apk installed via sideloading, this function will return true, but ARCore cannot function normally.

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

Boolean

isDeviceSupported

Checks if 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

Boolean

bufferCapacity

The buffer capacity of InputFrame, 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

Int32

setBufferCapacity

Sets the buffer capacity of InputFrame.

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

capacity Int32

Returns

Void

inputFrameSource

The output port for InputFrame.

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

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

focusMode ARCoreCameraDeviceFocusMode

Returns

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

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

Void

close

Closes. After close, it should not be used further.

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

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

CameraDeviceType

cameraOrientation

The clockwise rotation angle required to display the camera image in the device's natural orientation.

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

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

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

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

Double