Example #1
0
        public void StopRecordingAsync(OnStoppedRecordingVideoCallback onStoppedRecordingVideoCallback)
        {
            var result = new VideoCaptureResult();

            if (!IsRecording)
            {
                result.resultType = CaptureResultType.UnknownError;
                onStoppedRecordingVideoCallback?.Invoke(result);
            }
            else
            {
                try
                {
                    m_CaptureContext.StopCapture();
                    IsRecording       = false;
                    result.resultType = CaptureResultType.Success;
                    onStoppedRecordingVideoCallback?.Invoke(result);
                }
                catch (Exception)
                {
                    result.resultType = CaptureResultType.UnknownError;
                    onStoppedRecordingVideoCallback?.Invoke(result);
                    throw;
                }
            }
        }
Example #2
0
 public void StopRecordingAsync(OnStoppedRecordingVideoCallback onStoppedRecordingVideoCallback)
 {
     if (this.m_NativePtr == IntPtr.Zero)
     {
         throw new InvalidOperationException("You must create a Video Capture Object before recording video.");
     }
     if (onStoppedRecordingVideoCallback == null)
     {
         throw new ArgumentNullException("onStoppedRecordingVideoCallback");
     }
     this.StopRecordingVideoToDisk_Internal(this.m_NativePtr, onStoppedRecordingVideoCallback);
 }
Example #3
0
        public void StopRecordingAsync(OnStoppedRecordingVideoCallback onStoppedRecordingVideoCallback)
        {
            if (!IsRecording)
            {
                if (onStoppedRecordingVideoCallback != null)
                {
                    var result = new VideoCaptureResult();
                    result.resultType = CaptureResultType.UnknownError;
                    onStoppedRecordingVideoCallback(result);
                }
                return;
            }

            m_RecordBehaviour.StopRecord();
            if (onStoppedRecordingVideoCallback != null)
            {
                var result = new VideoCaptureResult();
                result.resultType = CaptureResultType.Success;
                onStoppedRecordingVideoCallback(result);
            }

            IsRecording = false;
        }
 private static void InvokeOnStoppedRecordingVideoToDiskDelegate(OnStoppedRecordingVideoCallback callback, long hResult)
 {
     callback(MakeCaptureResult(hResult));
 }
 public extern void StopRecordingAsync([NotNull] OnStoppedRecordingVideoCallback onStoppedRecordingVideoCallback);
 private extern void StopRecordingVideoToDisk_Internal(IntPtr videoCaptureObj, OnStoppedRecordingVideoCallback onStoppedRecordingVideoCallback);
 public void StopRecordingAsync(OnStoppedRecordingVideoCallback onStoppedRecordingVideoCallback)
 {
     if (this.m_NativePtr == IntPtr.Zero)
     {
         throw new InvalidOperationException("You must create a Video Capture Object before recording video.");
     }
     if (onStoppedRecordingVideoCallback == null)
     {
         throw new ArgumentNullException("onStoppedRecordingVideoCallback");
     }
     this.StopRecordingVideoToDisk_Internal(this.m_NativePtr, onStoppedRecordingVideoCallback);
 }
 private static void InvokeOnStoppedRecordingVideoToDiskDelegate(OnStoppedRecordingVideoCallback callback, long hResult)
 {
     callback(MakeCaptureResult(hResult));
 }
Example #9
0
 private extern void StopRecordingVideoToDisk_Internal(IntPtr videoCaptureObj, OnStoppedRecordingVideoCallback onStoppedRecordingVideoCallback);