Table of Contents

Class XREALFrameSource

Namespace
easyar
Assembly
EasyAR.Sense.dll

Controls the XREAL camera device (easyar.XREALCameraDevice) in the scene, providing functional extensions within the Unity environment.

This frame source is a motion-tracking device that outputs motion data in the ARSession.

When using trial products (Personal license, trial XR license, or trial Mega service) on custom cameras or head-mounted displays, EasyAR Sense will stop responding after a fixed limited time upon each startup.

public class XREALFrameSource : FrameSource
Inheritance
XREALFrameSource

Properties

AvailableCenterMode

Provided only when creating a new frame source. Accessible solely during the Assemble() process.

All available center modes.

protected override IReadOnlyList<ARSession.ARCenterMode> AvailableCenterMode { get; }

Property Value

Camera

Provided only when creating a new frame source. Accessible solely during the Assemble() process.

On desktops or mobile devices, this camera represents the virtual-world counterpart Camera of the physical camera device, with its projection matrix and position controlled by EasyAR to match reality. On head-mounted displays, this camera is only used to display diagnostic text in front of the eyes, not for rendering; its control remains outside EasyAR.

protected override Camera Camera { get; }

Property Value

CameraFrameStarted

Provided only when creating a new frame source. Accessible throughout the lifetime of the ARSession.

Whether camera frame input has started.

protected override bool CameraFrameStarted { get; }

Property Value

DeviceCameras

Provided only when creating a new frame source. Accessible only when CameraFrameStarted is true.

Provides the device camera supplying camera frame data. If multiple cameras provide data, include all in the list.

Ensure the value is correct when CameraFrameStarted is true.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Property Value

Display

Provided only when creating a new frame source. Accessible solely during the Assemble() process.

Provides display system information. Use DefaultSystemDisplay or DefaultHMDDisplay to obtain default display information.

protected override IDisplay Display { get; }

Property Value

FrameRate

Frame rate range. Only available when Opened is true.

public double FrameRate { get; }

Property Value

IsAvailable

Provided only when creating a new frame source. Accessible solely during the Assemble() process.

Whether the current frame source is available.

If the value equals null, CheckAvailability() will be called, and the value will be retrieved after the Coroutine completes.

protected override Optional<bool> IsAvailable { get; }

Property Value

IsCameraUnderControl

Provided only when creating a new frame source. Accessible solely during the Assemble() process.

When true, the session updates the camera's transform and renders the camera image.

Set this to false when creating head-mounted display extensions. You should fully control the 3D camera in the scene and handle camera rendering, especially in VST mode.

protected override bool IsCameraUnderControl { get; }

Property Value

IsHMD

Provided only when creating a new frame source. Accessible solely during the Assemble() process.

Whether the current frame source is a head-mounted display. If it is, diagnostic information will be displayed on a 3D board in front of the camera.

Some frame filters behave differently when running on the device.

protected override bool IsHMD { get; }

Property Value

Opened

Whether the camera is open.

public bool Opened { get; }

Property Value

ReceivedFrameCount

Acquired frame count. Typically used for debugging. If this value stops increasing, it is usually a hardware issue; re-plugging may resolve it.

public int ReceivedFrameCount { get; }

Property Value

Size

Current image size. Only available when Opened is true.

public Vector2Int Size { get; }

Property Value

Methods

CheckAvailability()

Provided only when creating a new frame source. Accessible solely during the Assemble() process.

Coroutine used to check frame source availability when IsAvailable equals null.

protected override IEnumerator CheckAvailability()

Returns

Close()

Closes the device.

public void Close()

OnSessionStart(ARSession)

Provided only when creating a new frame source. Accessible solely during the StartSession() process.

Handles session startup if this frame source is assembled into Assembly. Designed for deferred initialization, perform AR-specific initialization here.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

Provided only when creating a new frame source. Accessed during StopSession(bool) or other session stop/corruption processes.

Handles session stop if this frame source is assembled into Assembly. Use this to destroy resources created during StartSession() or session runtime and restore internal state. Guaranteed to be called before session destruction. If the frame source is destroyed before the session, this won't be called, and the session will become corrupted.

protected override void OnSessionStop()

Open()

Opens the device. If not manually calling Open() and Close(), ARSession will automatically call Open() upon startup.

public void Open()

Events

DeviceClosed

Device close event.

public event Action DeviceClosed

Event Type

DeviceOpened

Device open event, the bool value indicates success status.

public event Action<bool, PermissionStatus, string> DeviceOpened

Event Type