public static RecordingResult StartRecording(IntPtr sessionHandle, ARCoreRecordingConfig config) { IntPtr recordingConfigHandle = RecordingConfigApi.Create(sessionHandle, config); ApiArStatus status = ExternApi.ArSession_startRecording( sessionHandle, recordingConfigHandle); RecordingConfigApi.Destroy(recordingConfigHandle); // Only specific ArStatus responses are expected. switch (status) { case ApiArStatus.Success: return(RecordingResult.OK); case ApiArStatus.ErrorIllegalState: return(RecordingResult.ErrorIllegalState); case ApiArStatus.ErrorInvalidArgument: return(RecordingResult.ErrorInvalidArgument); case ApiArStatus.ErrorRecordingFailed: return(RecordingResult.ErrorRecordingFailed); default: Debug.LogErrorFormat("Attempt to start a recording failed with unexpected " + "status: {0}", status); break; } return(RecordingResult.ErrorRecordingFailed); }
public static RecordingResult StartRecording( IntPtr sessionHandle, ARCoreRecordingConfig config) { IntPtr recordingConfigHandle = RecordingConfigApi.Create(sessionHandle, config); ApiArStatus status = ExternApi.ArSession_startRecording( sessionHandle, recordingConfigHandle); RecordingConfigApi.Destroy(recordingConfigHandle); return(status.ToRecordingResult()); }
public static RecordingResult StartRecording( IntPtr sessionHandle, ARCoreRecordingConfig config) { ApiArStatus status = ApiArStatus.ErrorFatal; #if UNITY_ANDROID IntPtr recordingConfigHandle = RecordingConfigApi.Create(sessionHandle, config); status = ExternApi.ArSession_startRecording(sessionHandle, recordingConfigHandle); RecordingConfigApi.Destroy(recordingConfigHandle); #endif return(status.ToRecordingResult()); }