Table of Contents

Class AREngineFrameSource

Namespace
easyar
Assembly
EasyAR.Sense.dll

ConnectstheoutputoftheAREnginecameradevicetotheEasyARinput'scustomframesourceinthescene.ProvidesHuaweiAREnginesupportthroughtheEasyARSensecustomcamerafunctionality.

Thisframesourceisamotiontrackingdeviceandoutputsmotiondatain.

Thisframesourcedoesnotusethe``HuaweiAREngineUnitySDK``anddoesnotneedtobeadded.

public class AREngineFrameSource : FrameSource
Inheritance
AREngineFrameSource
Inherited Members

Fields

DesiredFocusMode

Thedesiredfocusmode,effectiveonlyifmodifiedbeforetheeventorOnEnable.

Note:Duetohardwareorsystemlimitations,thefocusswitchmaybeineffectiveonsomedevices.

public AREngineCameraDeviceFocusMode DesiredFocusMode

Properties

Camera

Providedonlywhencreatinganewframesource.Itisonlyaccessedduringtheprocess.

Ondesktopormobiledevices,thiscamerarepresentsthecorrespondingtothephysicalcameradeviceinthevirtualworld.Itsprojectionmatrixandpositionwillcorrespondtotherealone,controlledbyEasyAR.Onahead-mounteddisplay,thiscameraisonlyusedtodisplaydiagnostictextinfrontoftheeyes,notforrendering,andisnotcontrolledbyEasyAR.

protected override Camera Camera { get; }

CameraCandidate

Alternativefor,effectiveonlywhenUnityXROriginisnotused.Ifnotset,Camera.mainwillbeused.

public Camera CameraCandidate { get; set; }

CameraFrameStarted

Providedonlywhencreatinganewframesource.Itisaccessedthroughoutthelifetimeof.

Whethercameraframeinputhasstarted.

protected override bool CameraFrameStarted { get; }

DeviceCameras

Providedonlywhencreatinganewframesource.Itisaccessedwhenistrue.

Thedevicecameraprovidingcameraframedata.Ifcameraframedatacomesfrommultiplecameras,allcamerasneedtobeincludedinthelist.

Ensurethevalueiscorrectwhenistrue.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Display

Providedonlywhencreatinganewframesource.Itisonlyaccessedduringtheprocess.

Providesthesystemdisplayinformation.Youcanuseortogetthedefaultdisplayinformation.

protected override IDisplay Display { get; }

FrameRateRange

Frameraterange.Availableonlywhenistrue.

public Vector2 FrameRateRange { get; }

IsAvailable

Providedonlywhencreatinganewframesource.Itisonlyaccessedduringtheprocess.

Whetherthecurrentframesourceisavailable.

Ifthevalueisnull,willbecalled,andthevaluewillbeobtainedaftertheends.

protected override Optional<bool> IsAvailable { get; }

IsCameraUnderControl

Providedonlywhencreatinganewframesource.Itisonlyaccessedduringtheprocess.

Whentrue,thesessionwillupdatethecamera'stransformandrenderthecameraimage.

Whencreatingahead-mounteddisplayextension,itshouldbefalse.Youshouldhavefullcontroloverthe3Dcamerainthescene.Youshouldhandlecamerarendering,especiallyinVST(videosee-through)mode.

protected override bool IsCameraUnderControl { get; }

IsHMD

Providedonlywhencreatinganewframesource.Itisonlyaccessedduringtheprocess.

Whetherthecurrentframesourceisahead-mounteddisplay.Ifitis,diagnosticinformationwillbedisplayedona3Dboardinfrontofthecamera.

Someframefiltersbehavedifferentlyondevices.

protected override bool IsHMD { get; }

Opened

Whetherthecameraisopen.

public bool Opened { get; }

Size

Currentimagesize.Availableonlywhenistrue.

public Optional<Vector2Int> Size { get; }

enabled

Start/stopsamplingvideostreamdatawhenisrunning.Aftersessionstart,itonlystartssamplingwhen.enabledistrue.

public bool enabled { get; set; }

Methods

Close()

Closethedevice.

public void Close()

OnSessionStart(ARSession)

Providedonlywhencreatinganewframesource.Itisonlyaccessedduringtheprocess.

Handlessessionstartup,ifthisframesourcehasbeenassembledinto.Thismethodisdesignedforlazyinitialization;youcanperformAR-specificinitializationhere.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

Providedonlywhencreatinganewframesource.Itisaccessedduringorothersessionstop/damageprocesses.

Handlessessionstop,ifthisframesourcehasbeenassembledinto.Youcanusethismethodtodestroyresourcescreatedduringandsessionruntime,andrestoreinternalstate.Thismethodisguaranteedtobecalledbeforethesessionisdestroyed.Iftheframesourceisdestroyedbeforethesession,itwillnotbecalled,andthesessionwillbedamaged.

protected override void OnSessionStop()

Open()

Openthedevice.Ifandarenotcalledmanually,willbecalledautomaticallyafterstarts.

public void Open()

Events

DeviceClosed

Eventwhendeviceisclosed.

public event Action DeviceClosed

DeviceOpened

Eventwhendeviceisopened,booleandindicatessuccess.

public event Action<bool, PermissionStatus, string> DeviceOpened