public void EnsureDisconnected() { if (cameraState == VideoCameraState.videoCameraRecording) { StopRecordingVideoFile(); } if (bitmapPlayer != null) { cameraState = VideoCameraState.videoCameraError; bitmapPlayer.Stop(); } alteredPixels = null; bitmapPlayer = null; isConnected = false; }
public void EnsureConnected() { if (bitmapPlayer == null) { bitmapPlayer = new BitmapVideoPlayer( aviTools, Settings.Default.UseEmbeddedVideoSource, Settings.Default.SourceBitmapFilesLocation, useBuffering ? bufferSize : 0); } alteredPixels = new int[bitmapPlayer.Height, bitmapPlayer.Width]; SetBitmapPlayerFrameRate(); bitmapPlayer.Start(); isConnected = true; cameraState = VideoCameraState.videoCameraRunning; }