public void StopCameraStreaming(PublishedCamera camera) { if (camera == null) { throw new ArgumentNullException("camera"); } lock (_syncRoot) { if (_cameras.Count(c => c.Id == camera.Id) == 0) { return; } StreamingCamera streamingCamera = _cameras.Find(c => c.Id == camera.Id); streamingCamera.Stop(); _cameras.Remove(streamingCamera); } }
public void StartCameraStreaming(PublishedCamera camera) { if (camera == null) { throw new ArgumentNullException("camera"); } lock (_syncRoot) { if (_cameras.Count(c => c.Id == camera.Id) > 0) { return; } StreamingCamera streamingCamera = new StreamingCamera(camera); streamingCamera.Start(); _cameras.Add(streamingCamera); } }