/// <summary> /// Sets an MP4 dataset file to playback instead of using the live camera feed and IMU /// sensor data. /// /// Restrictions: /// <list type="bullet"> /// <item> /// Can only be called while the session is paused. Playback of the MP4 dataset file will /// start once the session is resumed. /// </item> /// <item> /// The MP4 dataset file must use the same camera facing direction as is configured in the /// session. /// </item> /// <item> /// Due to the way session data is processed, ARCore APIs may sometimes produce different /// results during playback than during recording and produce different results during /// subsequent playback sessions. For exmaple, the number of detected planes and other /// trackables, the precise timing of their detection and their pose over time may be /// different in subsequent playback sessions. /// </item> /// <item> /// Once playback has started pausing the session (by disabling the ARSession) will /// suspend processing of all camera image frames and any other recorded sensor data in /// the dataset. Camera image frames and sensor frame data that is discarded in this way /// will not be reprocessed when the session is again resumed (by re-enabling the /// ARSession). AR tracking for the session will generally suffer due to the gap in /// processed data. /// </item> /// </list> /// </summary> /// <param name="datasetFilepath"> The filepath of the MP4 dataset. Null if /// stopping the playback and resuming a live feed.</param> /// <returns><see cref="PlaybackResult"/>.<c>Success</c> if playback filepath was /// set without issue. Otherwise, the <see cref="PlaybackResult"/> will indicate the /// error.</returns> public PlaybackResult SetPlaybackDataset(string datasetFilepath) { if (ARCoreExtensions._instance.currentARCoreSessionHandle == IntPtr.Zero && ARCoreExtensions._instance.Session.subsystem != null && ARCoreExtensions._instance.Session.subsystem.nativePtr != null) { return(PlaybackResult.SessionNotReady); } return(SessionApi.SetPlaybackDataset( ARCoreExtensions._instance.currentARCoreSessionHandle, datasetFilepath)); }
/// <summary> /// Sets the filepath for a dataset to be played back. The ARCore session /// must be paused when using this method. Resume the session for the /// change to take effect. /// <param name="datasetFilepath"> The filepath of the dataset. Null if /// stopping the playback and resuming a live feed.</param> /// <returns><cref="PlaybackResult"/>.<c>Success</c> if playback filepath was /// set without issue. Otherwise, the <cref="PlaybackResult"/> will indicate the /// error.</returns> public static PlaybackResult SetPlaybackDataset(string datasetFilepath) { return(SessionApi.SetPlaybackDataset( ARCoreExtensions._instance.currentARCoreSessionHandle, datasetFilepath)); }