private void StartCapture() { #if PLATFORM_LUMIN if (!isCapturing) { MLPrivileges.RequestPrivileges(MLPrivileges.Id.CameraCapture); MLCamera.Connect(); MLCamera.PrepareCapture(MLCamera.CaptureType.VideoRaw, ref this.captureSettings); MLCamera.OnRawVideoFrameAvailableYUV_NativeCallbackThread += OnMLCameraFrameYUV; MLCamera.StartRawVideoCapture(); isCapturing = true; } #endif }
private void StopCapture() { #if PLATFORM_LUMIN if (isCapturing) { if (MLCamera.IsStarted) { MLCamera.StopVideoCapture(); MLCamera.Disconnect(); } MLCamera.OnRawVideoFrameAvailableYUV_NativeCallbackThread -= OnMLCameraFrameYUV; isCapturing = false; } #endif }