private Task CleanUpCameraAsync()
        {
            lock (lockObj)
            {
#if UNITY_EDITOR
                UnityCompositorInterface.StopArUcoMarkerDetector();
#else
                if (setupCameraTask == null)
                {
                    DebugLog("CleanupCameraAsync was called when no start task had been created.");
                    return(Task.CompletedTask);
                }

                DebugLog("Cleaning up HoloLensCamera");
                if (_holoLensCamera != null)
                {
                    _holoLensCamera.Dispose();
                    _holoLensCamera.OnCameraInitialized -= CameraInitialized;
                    _holoLensCamera.OnCameraStarted     -= CameraStarted;
                    _holoLensCamera.OnFrameCaptured     -= FrameCaptured;
                    _holoLensCamera = null;
                }

                setupCameraTask = null;
#endif
            }

            return(Task.CompletedTask);
        }