Table of Contents

Class XREALFrameSource

Namespace
easyar
Assembly
EasyAR.Sense.dll

AMonoBehaviourthatcontrolsXREALcameradevices()inthescene,providingfunctionalextensionsintheUnityenvironment.

Thisframesourceisamotiontrackingdevicethatoutputsmotiondatain.

Whenusingtrialproducts(personaleditionlicense,trialeditionXRlicense,ortrialeditionMegaservice,etc.)oncustomcamerasorheadsets,EasyARSensewillstoprespondingafterafixedlimitedtimeaftereachstartup.

public class XREALFrameSource : FrameSource
Inheritance
XREALFrameSource

Properties

AvailableCenterMode

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Allcentermodesthatcanbeused.

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

Camera

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Ondesktopdevicesorphones,thiscameracorrespondstotheinthevirtualworldthatrepresentsthecameradeviceintherealenvironment;itsprojectionmatrixandpositionwillcorrespondtotherealcamerasandbecontrolledbyEasyAR.Onheadsets,thiscameraisonlyusedtodisplaysomediagnostictextinfrontoftheeyesandisnotusedforrendering;thecameraisnotcontrolledbyEasyAR.

protected override Camera Camera { get; }

CameraFrameStarted

Providedonlywhencreatinganewframesource.Itisaccessedthroughouttheentirelifecycleof.

Whetherthecameraframehasstartedinput.

protected override bool CameraFrameStarted { get; }

DeviceCameras

Providedonlywhencreatinganewframesource.Itisaccessedwhenistrue.

Thedevicecamerathatprovidesthecameraframedata.Ifthecameraframedataisprovidedbymultiplecameras,thelistshouldincludeallofthem.

Ensurethatthevalueiscorrectwhenistrue.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Display

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Providesdisplaysysteminformation.Youcanuseortoobtaindefaultdisplayinformation.

protected override IDisplay Display { get; }

FrameRate

Frameraterange.Onlyavailablewhenistrue.

public double FrameRate { get; }

IsAvailable

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Whetherthecurrentframesourceisavailable.

Ifthevalueisnull,willbecalled,andthevaluewillbeobtainedaftertheends.

protected override Optional<bool> IsAvailable { get; }

IsCameraUnderControl

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Whenthevalueistrue,thesessionwillupdatethecamera'stransformandrenderthecameraimage.

Whencreatingaheadsetextension,itshouldbefalse.Youshouldhavefullcontroloverthe3Dcamerainthescene.Youshouldhandlecamerarendering,especiallyinVSTmode.

protected override bool IsCameraUnderControl { get; }

IsHMD

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Whetherthecurrentframesourceisaheadset.Ifitisaheadset,diagnosticinformationwillbedisplayedona3Dboardinfrontofthecamera.

Someframefiltersmayoperatedifferentlyonthedevice.

protected override bool IsHMD { get; }

Opened

Whetherthecameraisopen.

public bool Opened { get; }

ReceivedFrameCount

Thecountofframesacquired.Typicallyusedindebugging.Ifthisvaluestopsincreasing,itisusuallyahardwareissue;re-pluggingmayresolveit.

public int ReceivedFrameCount { get; }

Size

Currentimagesize.Onlyavailablewhenistrue.

public Vector2Int Size { get; }

enabled

Starts/stopscollectingvideostreamdataduringruntime.Collectionwillonlystartafterthesessionstartsandwhen.enabledistrue.

public bool enabled { get; set; }

Methods

CheckAvailability()

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Ausedtocheckiftheframesourceisavailablewhenisequaltonull.

protected override IEnumerator CheckAvailability()

Close()

Closethedevice.

public void Close()

OnSessionStart(ARSession)

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheStartSessionprocessof.

Handlessessionstartupifthisframesourcehasbeenassembledinto.Thismethodisdesignedforlazyinitialization;youcanperformAR-specificinitializationworkinthismethod.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

Providedonlywhencreatinganewframesource.Itisaccessedduringorothersessionsessionstop/corruptionprocesses.

Handlessessionstopifthisframesourcehasbeenassembledinto.Youcanusethismethodtodestroyresourcescreatedduringandsessionoperationandrestoreinternalstate.Thismethodisguaranteedtobecalledbeforesessiondestruction.Iftheframesourceisdestroyedbeforethesession,itwillnotbecalled,andthesessionwillbecorrupted.

protected override void OnSessionStop()

Open()

Openthedevice.Ifandarenotmanuallycalled,itwillautomaticallyafterstarts.

public void Open()

Events

DeviceClosed

Theeventfordeviceclosing.

public event Action DeviceClosed

DeviceOpened

Theeventfordeviceopening,whereabooleanvalueindicateswhetheritwassuccessful.

public event Action<bool, PermissionStatus, string> DeviceOpened