Table of Contents

Class ARCoreCameraDevice

Namespace
easyar

ARCoreCameraDevice implements an ARCore-based camera device, outputting InputFrame (including image, camera parameters, timestamp, 6DOF position information, and tracking status). When using, you need to first use java.lang.System.loadLibrary to load libarcore_sdk_c.so. After creation, you can call start/stop to start and stop collecting video stream data. When the device is no longer needed, you can call close to close it. Do not continue to use it after close. ARCoreCameraDevice outputs InputFrame through inputFrameSource, and the inputFrameSource should be connected to InputFrameSink for use. bufferCapacity indicates the capacity of InputFrame buffer. If there are more InputFrame output from this device than this number and not released, the device will no longer output new InputFrame until the previous InputFrame is released. This may cause problems such as stuck screen. Note: The current implementation of ARCore (v1.13.0) has a memory leak when creating and destroying the session. Multiple creations and destructions will lead to continuous growth of memory usage and will 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

Check if available. Returns true only on Android system and with ARCore installed. Returns false when libarcore_sdk_c.so is not loaded. Note: If the device does not support ARCore but ARCore's apk is sideloaded, this function will return true, but ARCore cannot be used 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

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

Set the capacity of 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

capacity Int32

Returns

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

InputFrameSource

setFocusMode

Set 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

Start 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

Stop 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

Close. Do not continue to use it 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

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 angle to rotate clockwise when the camera image is displayed 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

Int32

size

Get 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

Get 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

Get 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