Class XREALCameraDevice
- Namespace
- easyar
XREALCameraDevice implements a camera device based on XREAL Enterprise Native SDK Plugin and outputs InputFrame (image, camera parameters, timestamp, 6DOF position information, and tracking status cannot be obtained). After creation, start/stop can be called to start and stop collecting video stream data. Ensure start is called only after isDeviceSupported returns true. When the device is no longer needed, close can be called to close it. It should not be used after close. XREALCameraDevice 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.
Constructors
XREALCameraDevice
void easyar_XREALCameraDevice__ctor(easyar_XREALCameraDevice * * Return)
XREALCameraDevice()
public XREALCameraDevice()
constructor()
+ (easyar_XREALCameraDevice *) create
public convenience init()
public XREALCameraDevice()
Methods
isAvailable
Checks whether it is available. Returns true only on devices that support XREAL glasses and after XREAL glasses are successfully connected.
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
| Type | Description |
|---|---|
| Boolean |
isDeviceSupported
Checks whether the glasses are supported. On available devices, it has a value only after XREAL completes initialization.
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
| Type | Description |
|---|---|
| Optional<> |
bufferCapacity
Capacity of the InputFrame buffer. The 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
| Type | Description |
|---|---|
| Int32 |
setBufferCapacity
Sets 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
| Name | Type | Description |
|---|---|---|
| capacity | Int32 |
Returns
| Type | Description |
|---|---|
| Void |
inputFrameSource
InputFrame output port.
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
| Type | Description |
|---|---|
| InputFrameSource |
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
| Type | Description |
|---|---|
| Optional<MotionInputData> |
receivedFrameCount
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 be working properly. In that case, get help directly from XREAL official support.
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
| Type | Description |
|---|---|
| Int32 |
open
Opens the camera device. Use after isDeviceSupported returns true. On devices such as Air2 Ultra, the XREAL license must first be verified by 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| Void |
close
Closes. It should not be used 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
| Type | Description |
|---|---|
| Void |
type
Camera type. Call 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
| Type | Description |
|---|---|
| CameraDeviceType |
cameraOrientation
Clockwise rotation angle required for displaying the camera image in the natural orientation of the device. Call 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
| Type | Description |
|---|---|
| Int32 |
size
Gets the current image size. Call 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
| Type | Description |
|---|---|
| Vec2I |
frameRate
Gets the current frame rate. Call 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
| Type | Description |
|---|---|
| Double |