XREALCameraDevice Class¶
Description¶
XREALCameraDevice implements a camera device based on XREAL Enterprise Native SDK Plugin, which outputs InputFrame (image, camera parameters, timestamp, 6DOF location, and tracking status cannot be accessed).
After creation, start/stop can be invoked to start or stop data collection. Start must not be called before isDeviceSupported returns true.
When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
XREALCameraDevice outputs InputFrame from inputFrameSource. inputFrameSource shall be connected to InputFrameSink for use. Refer to Overview .
bufferCapacity is the capacity of InputFrame buffer. If the count of InputFrame which has been output from the device and have not been released is more than this number, the device will not output new InputFrame , until previous InputFrame have been released. This may cause screen stuck. Refer to Overview .
Constructor¶
- C
void easyar_XREALCameraDevice__ctor(easyar_XREALCameraDevice * * Return)
- C++
XREALCameraDevice()
- Java
public XREALCameraDevice()
- Kotlin
constructor()
- Objective-C
+ (easyar_XREALCameraDevice *) create
- Swift
public convenience init()
- C#
public XREALCameraDevice()
isAvailable¶
Checks if the component is available. It returns true only when XREAL eyewear is connected on the device supported.
- C
bool easyar_XREALCameraDevice_isAvailable(void)
- C++
static bool isAvailable()
- Java
public static boolean isAvailable()
- Kotlin
companion object fun isAvailable(): Boolean
- Objective-C
+ (bool)isAvailable
- Swift
public static func isAvailable() -> Bool
- C#
public static bool isAvailable()
isDeviceSupported¶
Checks if the eyewear is supported. Has value only after XREAL finishes initialization on devices where isAvailable is ture.
- C
easyar_OptionalOfBool easyar_XREALCameraDevice_isDeviceSupported(void)
- C++
static std::optional<bool> isDeviceSupported()
- Java
public static java.lang.@Nullable Boolean isDeviceSupported()
- Kotlin
companion object fun isDeviceSupported(): Boolean?
- Objective-C
+ (NSNumber *)isDeviceSupported
- Swift
public static func isDeviceSupported() -> Bool?
- C#
public static Optional<bool> isDeviceSupported()
bufferCapacity¶
InputFrame buffer capacity. The default is 8.
- C
int easyar_XREALCameraDevice_bufferCapacity(const easyar_XREALCameraDevice * This)
- C++
int bufferCapacity()
- Java
public int bufferCapacity()
- Kotlin
fun bufferCapacity(): Int
- Objective-C
- (int)bufferCapacity
- Swift
public func bufferCapacity() -> Int32
- C#
public virtual int bufferCapacity()
setBufferCapacity¶
Sets InputFrame buffer capacity.
- C
void easyar_XREALCameraDevice_setBufferCapacity(easyar_XREALCameraDevice * This, int capacity)
- C++
void setBufferCapacity(int capacity)
- Java
public void setBufferCapacity(int capacity)
- Kotlin
fun setBufferCapacity(capacity: Int): Unit
- Objective-C
- (void)setBufferCapacity:(int)capacity
- Swift
public func setBufferCapacity(_ capacity: Int32) -> Void
- C#
public virtual void setBufferCapacity(int capacity)
inputFrameSource¶
InputFrame output port.
- C
void easyar_XREALCameraDevice_inputFrameSource(const easyar_XREALCameraDevice * This, easyar_InputFrameSource * * Return)
- C++
std::shared_ptr<InputFrameSource> inputFrameSource()
- Java
public @Nonnull InputFrameSource inputFrameSource()
- Kotlin
fun inputFrameSource(): InputFrameSource
- Objective-C
- (easyar_InputFrameSource *)inputFrameSource
- Swift
public func inputFrameSource() -> InputFrameSource
- C#
public virtual InputFrameSource inputFrameSource()
getMotionInputData¶
Get synchoronous motion input data. Call after isDeviceSupported return true.
- C
void easyar_XREALCameraDevice_getMotionInputData(const easyar_XREALCameraDevice * This, easyar_OptionalOfMotionInputData * Return)
- C++
std::optional<std::shared_ptr<MotionInputData>> getMotionInputData()
- Java
public @Nullable MotionInputData getMotionInputData()
- Kotlin
fun getMotionInputData(): MotionInputData?
- Objective-C
- (easyar_MotionInputData *)getMotionInputData
- Swift
public func getMotionInputData() -> MotionInputData?
- C#
public virtual Optional<MotionInputData> getMotionInputData()
receivedFrameCount¶
Received frame count from camera. It should continously increase after start, otherwise the device connection may not be stable or XREAL service/SDK not working correctly, and you need to get help from XREAL directly.
- C
int easyar_XREALCameraDevice_receivedFrameCount(const easyar_XREALCameraDevice * This)
- C++
int receivedFrameCount()
- Java
public int receivedFrameCount()
- Kotlin
fun receivedFrameCount(): Int
- Objective-C
- (int)receivedFrameCount
- Swift
public func receivedFrameCount() -> Int32
- C#
public virtual int receivedFrameCount()
open¶
Opens camera. Call after isDeviceSupported return true. XREAL license must be validated through XREAL official method on Air2 Ultra and some other devices before open.
- C
bool easyar_XREALCameraDevice_open(easyar_XREALCameraDevice * This)
- C++
bool open()
- Java
public boolean open()
- Kotlin
fun open(): Boolean
- Objective-C
- (bool)open
- Swift
public func `open`() -> Bool
- C#
public virtual bool open()
getXREALError¶
Get XREAL error. It is normally used to acquire XREAL related error when open fail.
- C
easyar_OptionalOfXREALError easyar_XREALCameraDevice_getXREALError(const easyar_XREALCameraDevice * This)
- C++
std::optional<XREALError> getXREALError()
- Java
public @Nullable Integer getXREALError()
- Kotlin
fun getXREALError(): Int?
- Objective-C
- (NSNumber *)getXREALError
- Swift
public func getXREALError() -> XREALError?
- C#
public virtual Optional<XREALError> getXREALError()
start¶
Starts video stream capture.
- C
bool easyar_XREALCameraDevice_start(easyar_XREALCameraDevice * This)
- C++
bool start()
- Java
public boolean start()
- Kotlin
fun start(): Boolean
- Objective-C
- (bool)start
- Swift
public func start() -> Bool
- C#
public virtual bool start()
stop¶
Stops video stream capture.
- C
void easyar_XREALCameraDevice_stop(easyar_XREALCameraDevice * This)
- C++
void stop()
- Java
public void stop()
- Kotlin
fun stop(): Unit
- Objective-C
- (void)stop
- Swift
public func stop() -> Void
- C#
public virtual void stop()
close¶
Close. The component shall not be used after calling close.
- C
void easyar_XREALCameraDevice_close(easyar_XREALCameraDevice * This)
- C++
void close()
- Java
public void close()
- Kotlin
fun close(): Unit
- Objective-C
- (void)close
- Swift
public func close() -> Void
- C#
public virtual void close()
type¶
Camera type. Call after a successful open.
- C
easyar_CameraDeviceType easyar_XREALCameraDevice_type(const easyar_XREALCameraDevice * This)
- C++
CameraDeviceType type()
- Java
public int type()
- Kotlin
fun type(): Int
- Objective-C
- (easyar_CameraDeviceType)type
- Swift
public func type() -> CameraDeviceType
- C#
public virtual CameraDeviceType type()
cameraOrientation¶
Angles rotation required to rotate clockwise and display camera image on device with natural orientation. Call after a successful open.
- C
int easyar_XREALCameraDevice_cameraOrientation(const easyar_XREALCameraDevice * This)
- C++
int cameraOrientation()
- Java
public int cameraOrientation()
- Kotlin
fun cameraOrientation(): Int
- Objective-C
- (int)cameraOrientation
- Swift
public func cameraOrientation() -> Int32
- C#
public virtual int cameraOrientation()
size¶
Gets the current preview size. Call after a successful open.
frameRate¶
Gets the current frame rate. Call after a successful open.
- C
double easyar_XREALCameraDevice_frameRate(const easyar_XREALCameraDevice * This)
- C++
double frameRate()
- Java
public double frameRate()
- Kotlin
fun frameRate(): Double
- Objective-C
- (double)frameRate
- Swift
public func frameRate() -> Double
- C#
public virtual double frameRate()