Table of Contents

Class FrameSource

Espacio de nombres
easyar
Ensayo
EasyAR.Sense.dll

A frame source represents the data source of frame input data. It provides image data, or image data together with motion data.

You can implement a custom camera by inheriting from some subtypes of FrameSource, but you cannot directly inherit from FrameSource. A custom camera usually represents a new device or a new data input method.

When using trial products (Personal license, trial XR license, trial Mega service, etc.) on custom cameras or headsets, EasyAR Sense will stop responding for a fixed limited time after each startup.

[DisallowMultipleComponent]
public abstract class FrameSource : MonoBehaviour
Herencia
FrameSource
Derived

Propiedades

AvailableCenterMode

Se proporciona solo al crear un nuevo frame source. It is accessed only during Assemble().

All center modes that can be used.

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

Camera

Se proporciona solo al crear un nuevo frame source. It is accessed only during Assemble().

On desktop devices or phones, this camera represents the Camera in the virtual world corresponding to the camera device in the real environment. Its projection matrix and position correspond to the real camera and are controlled by EasyAR. On headsets, this camera is used only to display diagnostic text in front of the eyes; it is not used for image rendering, and the camera is not controlled by EasyAR.

protected abstract Camera Camera { get; }

CameraFrameStarted

Se proporciona solo al crear un nuevo frame source. It is accessed throughout the lifecycle of ARSession.

Whether camera frame input has started.

protected abstract bool CameraFrameStarted { get; }

DeviceCameras

Se proporciona solo al crear un nuevo frame source. It is accessed when CameraFrameStarted is true.

Device cameras that provide camera frame data. If camera frame data is provided by multiple cameras, the list must contain all cameras.

Ensure that the value is correct when CameraFrameStarted is true.

protected abstract List<FrameSourceCamera> DeviceCameras { get; }

Display

Se proporciona solo al crear un nuevo frame source. It is accessed only during Assemble().

Proporciona display system information. You can use DefaultSystemDisplay or DefaultHMDDisplay to get default display information.

protected abstract IDisplay Display { get; }

IsAvailable

Se proporciona solo al crear un nuevo frame source. It is accessed only during Assemble().

Whether the current frame source is available.

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

protected abstract Optional<bool> IsAvailable { get; }

IsCameraUnderControl

Se proporciona solo al crear un nuevo frame source. It is accessed only during Assemble().

When the value is true, session updates the camera transform and renders the camera image.

When creating a headset extension, it should be false. You should fully control the 3D camera in the scene. You should handle camera rendering, especially in VST mode.

protected abstract bool IsCameraUnderControl { get; }

IsHMD

Se proporciona solo al crear un nuevo frame source. It is accessed only during Assemble().

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

Some frame filters behave differently when running on device.

protected abstract bool IsHMD { get; }

Métodos

CheckAvailability()

Se proporciona solo al crear un nuevo frame source. It is accessed only during Assemble().

The Coroutine used to check whether the frame source is available when IsAvailable is null.

protected virtual IEnumerator CheckAvailability()

OnSessionStart(ARSession)

Se proporciona solo al crear un nuevo frame source. It is accessed only during StartSession().

Gestiona session startup if this frame source has been assembled into Assembly. This method is designed for lazy initialization; you can perform AR-specific initialization work in this method.

protected abstract void OnSessionStart(ARSession session)

Parámetros

session

OnSessionStop()

Se proporciona solo al crear un nuevo frame source. It is accessed during StopSession(bool) or other session stop/damage processes.

Gestiona session stop if this frame source has been assembled into Assembly. You can use this method to destroy resources created by StartSession() and during session running, and 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 damaged.

protected abstract void OnSessionStop()