Class XREALCameraDevice
- Namespace
- easyar
XREALCameraDevice implements a camera device based on the XREAL Enterprise Native SDK Plugin, outputting InputFrame (unable to obtain images, camera parameters, timestamps, 6DOF position information, and tracking status). After creation, you can call start/stop to start and stop collecting video stream data. Ensure that isDeviceSupported returns true before calling start. When the device is no longer needed, call close to shut it down. After close, it should not be used further. XREALCameraDevice outputs InputFrame through inputFrameSource, which should be connected to InputFrameSink for use. bufferCapacity represents the buffer capacity of InputFrame. If more than this number of InputFrame are output from the device and not released, the device will stop outputting new InputFrame until the previous ones are released. This may cause issues like screen freezing.
Constructors
XREALCameraDevice
void easyar_XREALCameraDevice__ctor(easyar_XREALCameraDevice * * Return)
XREALCameraDevice()
public XREALCameraDevice()
constructor()
+ (easyar_XREALCameraDevice *) create
public convenience init()
public XREALCameraDevice()
Methods
isAvailable
Checks if it is available. Returns true only on devices that support 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
Checks if the glasses are supported. On available devices, it only has a value after XREAL initialization is complete.
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 buffer capacity of InputFrame, with a default value of 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
Sets the buffer capacity of InputFrame.
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
capacityInt32
Returns
- Void
inputFrameSource
The output port for 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
getMotionInputData
Gets synchronized motion input data. Use 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 acquired from the camera. After start, it should continuously increase; otherwise, there might be unstable device connection or XREAL service/SDK malfunction, in which case you should seek help directly from XREAL official sources.
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
Opens the camera device. Use after isDeviceSupported returns true. On devices like Air2 Ultra, the XREAL license must first be validated through XREAL official methods.
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
Starts 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
Stops 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
Closes. After close, it should not be used further.
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 a 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
cameraOrientation
The angle at which the camera image needs to be rotated clockwise when displayed in the device's natural orientation. Called after a 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
Gets the current image size. Called after a 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
frameRate
Gets the current frame rate. Called after a 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