コード例 #1
0
        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
        }
コード例 #2
0
        private void StopCapture()
        {
#if PLATFORM_LUMIN
            if (isCapturing)
            {
                if (MLCamera.IsStarted)
                {
                    MLCamera.StopVideoCapture();
                    MLCamera.Disconnect();
                }
                MLCamera.OnRawVideoFrameAvailableYUV_NativeCallbackThread -= OnMLCameraFrameYUV;
                isCapturing = false;
            }
#endif
        }