Class FrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
A frame source represents the data source of frame input data, which provides image data or motion data at the same time.
You can implement a custom camera by inheriting some subtypes of FrameSource, but you cannot inherit FrameSource directly. A custom camera usually represents a new device or a new data input method.
When using trial products (personal license, trial XR license, or trial Mega service, etc.) on a custom camera or headset, EasyAR Sense will stop responding for a fixed limited time each time it starts.
[DisallowMultipleComponent]
public abstract class FrameSource : MonoBehaviour
- Inheritance
-
FrameSource
- Derived
Properties
AvailableCenterMode
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
All available center modes.
protected virtual IReadOnlyList<ARSession.ARCenterMode> AvailableCenterMode { get; }
Property Value
Camera
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
On desktop devices or mobile phones, this camera represents the corresponding Camera of the camera device in the real environment in the virtual world. Its projection matrix and position will correspond to the real camera and be controlled by EasyAR. On the headset, this camera is only used to display some diagnostic text in front of the eyes, not for screen rendering, and the camera is not controlled by EasyAR.
protected abstract Camera Camera { get; }
Property Value
CameraFrameStarted
Provided only when creating a new frame source. It will be accessed throughout the lifetime of ARSession.
Whether the camera frame has started inputting.
protected abstract bool CameraFrameStarted { get; }
Property Value
DeviceCameras
Provided only when creating a new frame source. It will be accessed when CameraFrameStarted is true.
The device camera that provides the camera frame data. If the camera frame data is provided by multiple cameras, all cameras need to be included in the list.
Ensure that the value is correct when CameraFrameStarted is true.
protected abstract List<FrameSourceCamera> DeviceCameras { get; }
Property Value
Display
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
Provides display system information. You can use DefaultSystemDisplay or DefaultHMDDisplay to obtain default display information.
protected abstract IDisplay Display { get; }
Property Value
IsAvailable
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
Whether the current frame source is available.
If the value is null, CheckAvailability() will be called, and the value will be obtained after the Coroutine ends.
protected abstract Optional<bool> IsAvailable { get; }
Property Value
IsCameraUnderControl
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
When the value is true, the session will update the camera's transform and render the camera image.
When creating a headset extension, it 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 abstract bool IsCameraUnderControl { get; }
Property Value
IsHMD
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
Whether the current frame source is a headset. If it is a headset, diagnostic information will be displayed on the 3D board in front of the camera.
Some frame filters will be different when running on the device.
protected abstract bool IsHMD { get; }
Property Value
Methods
CheckAvailability()
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
IsAvailable is null when used to check the coroutine for whether the frame source is available Coroutine.
protected virtual IEnumerator CheckAvailability()
Returns
OnSessionStart(ARSession)
Provided only when creating a new frame source. It will only be accessed during the StartSession() process.
protected abstract void OnSessionStart(ARSession session)
Parameters
session
OnSessionStop()
Provided only when creating a new frame source. It will be accessed during StopSession(bool) or other session stop/damage processes.
Handle session stop if this frame source has been assembled into Assembly. You can use this method to destroy StartSession() and resources created during session operation and restore internal state. This method will be guaranteed to be called before the session is destroyed. If the frame source is destroyed before the session, it will not be called and the session will be damaged.
protected abstract void OnSessionStop()