Class ExternalDeviceMotionFrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Represents a frame source for external devices with motion tracking capability. Usually refers to head-mounted devices, where camera rendering and device tracking are handled by the device SDK.
This frame source is a motion tracking device that outputs motion data in ARSession.
You can implement device inputs like headsets by inheriting from it, but you must handle the motion tracking yourself; EasyAR's motion tracking cannot be used directly on external devices. You need to obtain image and pose data from hardware or other sources and input it to EasyAR; EasyAR does not provide the capability to acquire this data, but it does provide the ability to run EasyAR features after inputting this data.
When using trial products (such as Personal Edition license, Trial XR license, or Trial Mega service, etc.) on custom cameras or headsets, EasyAR Sense will stop responding after a fixed limited time upon each startup.
public abstract class ExternalDeviceMotionFrameSource : ExternalDeviceFrameSource
- Inheritance
-
ExternalDeviceMotionFrameSource
- Derived
- Inherited Members
Methods
HandleCameraFrameData(DeviceFrameSourceCamera, double, Image, CameraParameters, Pose, MotionTrackingStatus)
Inputs camera frame data.
It is recommended to input data at 30 or 60 fps. The minimum acceptable frame rate = 2, but some algorithm response times may be affected. It can be called from any thread, as long as your APIs are thread-safe. This data needs to be consistent with the data when the camera sensor is exposed. Whenever possible, it is recommended to input color data to EasyAR Sense, as this is beneficial for EasyAR Mega effects. For optimal efficiency, you can design the entire data chain to pass raw YUV data directly through shared memory and directly use data pointers to input into EasyAR Sense. Please note data ownership.
protected bool HandleCameraFrameData(DeviceFrameSourceCamera deviceCamera, double timestamp, Image image, CameraParameters cameraParameters, Pose deviceToOriginTransform, MotionTrackingStatus trackingStatus)
Parameters
deviceCameratimestampimagecameraParametersdeviceToOriginTransformtrackingStatus
HandleRenderFrameData(double, Pose, MotionTrackingStatus)
Inputs rendered frame data.
Please ensure it is called every frame after the device data is ready, without skipping frames. This data needs to match the data driving the current Unity rendering camera within the same frame.
protected bool HandleRenderFrameData(double timestamp, Pose pose, MotionTrackingStatus trackingStatus)
Parameters
timestampposetrackingStatus