コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: SessionApi.cs プロジェクト: Jam3/arlabs-doodads
        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());
        }
コード例 #3
0
        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());
        }