Table of Contents

Class XREALCameraDevice

Namespace
easyar

The XREALCameraDevice implements a camera device based on the XREAL Enterprise Native SDK Plugin, outputting InputFrame (unable to obtain image, camera parameters, timestamp, 6DOF position information, and tracking status). After creation, start/stop can be called to start and stop collecting video stream data. Ensure that start is called after isDeviceSupported returns true. When the device is no longer needed, close can be called to close it. Do not continue to use after close. The XREALCameraDevice outputs InputFrame through inputFrameSource, which should be connected to InputFrameSink for use. bufferCapacity indicates the capacity of the 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 frozen screen.

XREALCameraDevice

Constructors

XREALCameraDevice

void easyar_XREALCameraDevice__ctor(easyar_XREALCameraDevice * * Return)
XREALCameraDevice()
public XREALCameraDevice()
constructor()
+ (easyar_XREALCameraDevice *) create
public convenience init()
public XREALCameraDevice()

Methods

isAvailable

Check if available. Returns true only on devices supporting XREAL glasses and after successfully connecting to XREAL glasses.

bool easyar_XREALCameraDevice_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 glasses are supported. On available devices, the value is only present after XREAL is initialized.

easyar_OptionalOfBool easyar_XREALCameraDevice_isDeviceSupported(void)
static std::optional<bool> isDeviceSupported()
public static java.lang.@Nullable Boolean isDeviceSupported()
companion object fun isDeviceSupported(): Boolean?
+ (NSNumber *)isDeviceSupported
public static func isDeviceSupported() -> Bool?
public static Optional<bool> isDeviceSupported()

Returns

Optional<>

bufferCapacity

The capacity of the InputFrame buffer, default value is 8.

int easyar_XREALCameraDevice_bufferCapacity(const easyar_XREALCameraDevice * 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 the InputFrame buffer.

void easyar_XREALCameraDevice_setBufferCapacity(easyar_XREALCameraDevice * 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 of InputFrame.

void easyar_XREALCameraDevice_inputFrameSource(const easyar_XREALCameraDevice * 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

getMotionInputData

Get synchronized motion input data. Used after isDeviceSupported returns true.

void easyar_XREALCameraDevice_getMotionInputData(const easyar_XREALCameraDevice * This, easyar_OptionalOfMotionInputData * Return)
std::optional<std::shared_ptr<MotionInputData>> getMotionInputData()
public @Nullable MotionInputData getMotionInputData()
fun getMotionInputData(): MotionInputData?
- (easyar_MotionInputData *)getMotionInputData
public func getMotionInputData() -> MotionInputData?
public virtual Optional<MotionInputData> getMotionInputData()

Returns

Optional<MotionInputData>

receivedFrameCount

The number of frames obtained from the camera. After start, it should keep increasing; otherwise, the device connection may be unstable or the XREAL service/SDK may not work properly, and then direct help should be obtained from XREAL official.

int easyar_XREALCameraDevice_receivedFrameCount(const easyar_XREALCameraDevice * This)
int receivedFrameCount()
public int receivedFrameCount()
fun receivedFrameCount(): Int
- (int)receivedFrameCount
public func receivedFrameCount() -> Int32
public virtual int receivedFrameCount()

Returns

Int32

open

Open the camera device. Used after isDeviceSupported returns true. On devices such as Air2 Ultra, the XREAL license must be verified through XREAL official methods first.

bool easyar_XREALCameraDevice_open(easyar_XREALCameraDevice * This)
bool open()
public boolean open()
fun open(): Boolean
- (bool)open
public func `open`() -> Bool
public virtual bool open()

Returns

Boolean

start

Start collecting video stream data.

bool easyar_XREALCameraDevice_start(easyar_XREALCameraDevice * 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_XREALCameraDevice_stop(easyar_XREALCameraDevice * 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 after close.

void easyar_XREALCameraDevice_close(easyar_XREALCameraDevice * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()

Returns

Void

type

Camera type. Called after successful open.

easyar_CameraDeviceType easyar_XREALCameraDevice_type(const easyar_XREALCameraDevice * 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 be rotated clockwise when the camera image is displayed in the natural orientation of the device. Called after successful open.

int easyar_XREALCameraDevice_cameraOrientation(const easyar_XREALCameraDevice * 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. Called after successful open.

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

Returns

Vec2I

frameRate

Get the current frame rate. Called after successful open.

double easyar_XREALCameraDevice_frameRate(const easyar_XREALCameraDevice * This)
double frameRate()
public double frameRate()
fun frameRate(): Double
- (double)frameRate
public func frameRate() -> Double
public virtual double frameRate()

Returns

Double