Table of Contents

Class ARCoreFrameSource

Namespace
easyar
Assembly
EasyAR.Sense.dll

Aeasyar.ARCoreCameraDevice-controllingMonoBehaviour in the scene, providing functionality extensions within the Unity environment.

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

public class ARCoreFrameSource : FrameSource
Inheritance
ARCoreFrameSource
Inherited Members

Fields

DesiredFocusMode

The desired focus mode; changes are only effective before theDeviceOpened event or OnEnable.

Note: Due to hardware or system limitations, the focus switch might be ineffective on some devices.

public ARCoreCameraDeviceFocusMode DesiredFocusMode

Properties

Camera

Provided only when creating a new frame source. Accessed only during theAssemble() process.

On desktop or mobile devices, this camera represents the virtual-world counterpartCamera of the physical camera device in the real environment. Its projection matrix and position will correspond to the real camera, controlled by EasyAR. On head-mounted displays, this camera is only used to display diagnostic text in front of the eyes, not for rendering the scene image, and the camera is not controlled by EasyAR.

protected override Camera Camera { get; }

CameraCandidate

Alternative toCamera, only valid when not using Unity XR Origin. If unset, Camera.main will be used.

public Camera CameraCandidate { get; set; }

CameraFrameStarted

Provided only when creating a new frame source. Accessed throughout the lifetime of theARSession.

Whether camera frame input has started.

protected override bool CameraFrameStarted { get; }

DeviceCameras

Provided only when creating a new frame source. Accessed whenCameraFrameStarted is true.

Provides the device camera supplying the camera frame data. If frame data is provided by multiple cameras, the list must include all of them.

Ensure the value is correct whenCameraFrameStarted is true.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Display

Provided only when creating a new frame source. Accessed only during theAssemble() process.

Provides the display system information. You can useDefaultSystemDisplay orDefaultHMDDisplay to get the default display information.

protected override IDisplay Display { get; }

FrameRateRange

Frame rate range. Only available whenOpened is true.

public Vector2 FrameRateRange { get; }

IsAvailable

Provided only when creating a new frame source. Accessed only during theAssemble() process.

Whether the current frame source is available.

If the value is null,CheckAvailability() will be called, and the value will be obtained after theCoroutine ends.

protected override Optional<bool> IsAvailable { get; }

IsCameraUnderControl

Provided only when creating a new frame source. Accessed only during theAssemble() process.

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

When creating a head-mounted display extension, this should be false. You should have full control over the 3D camera in the scene. You should handle camera rendering, especially in VST mode.

protected override bool IsCameraUnderControl { get; }

IsHMD

Provided only when creating a new frame source. Accessed only during theAssemble() 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 a device.

protected override bool IsHMD { get; }

Opened

Whether the camera is open.

public bool Opened { get; }

Size

Current image size. Only available whenOpened is true.

public Vector2Int Size { get; }

enabled

Starts/stops capturing the video stream when theARSession is running. Capture only starts after session launch and whenMonoBehaviour.enabled is true.

public bool enabled { get; set; }

Methods

Close()

Closes the device.

public void Close()

OnSessionStart(ARSession)

Provided only when creating a new frame source. Accessed only during theStartSession() process.

Handles session start if this frame source has been assembled intoAssembly. This method is designed for delayed initialization; you can perform AR-specific initialization work here.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

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

Handles session stop if this frame source has been assembled intoAssembly. Use this method to destroy resources created inStartSession() and during session runtime, and to restore internal state. This method is guaranteed to be called before session destruction. If the frame source is destroyed before the session, it will not be called, and the session will be corrupted.

protected override void OnSessionStop()

Open()

Opens the device. IfOpen() andClose() are not manually called, it will automaticallyOpen() afterARSession starts.

public void Open()

Events

DeviceClosed

Device closed event.

public event Action DeviceClosed

DeviceOpened

Device opened event; the bool value indicates success.

public event Action<bool, PermissionStatus, string> DeviceOpened