CameraDataCenter.cs 1.3 KB

12345678910111213141516171819202122232425
  1. using Abp.Dependency;
  2. using System.Collections.Concurrent;
  3. using System.Linq;
  4. using VideoSurveillanceAdapter;
  5. namespace Yunda.ISAS.DataMonitoringServer.DataCenter
  6. {
  7. public class CameraDataCenter : ISingletonDependency
  8. {
  9. public ConcurrentBag<VideoPlayer> CameraCollection = new ConcurrentBag<VideoPlayer>();
  10. public VideoPlayer FindCamera(VideoPlayer videoPlayer)
  11. {
  12. var videoInstance = CameraCollection.FirstOrDefault(video =>
  13. video.CameraConfigure.Ip == videoPlayer.CameraConfigure.Ip
  14. && video.CameraConfigure.Name == videoPlayer.CameraConfigure.Name
  15. && video.CameraConfigure.Password == videoPlayer.CameraConfigure.Password
  16. //&& video.CameraConfigure.PlayChannel == videoPlayer.CameraConfigure.PlayChannel
  17. && video.CameraConfigure.PlayFrame == videoPlayer.CameraConfigure.PlayFrame
  18. && video.CameraConfigure.Port == videoPlayer.CameraConfigure.Port
  19. && video.CameraConfigure.UserName == videoPlayer.CameraConfigure.UserName
  20. && video.CameraConfigure.CameraBrand == videoPlayer.CameraConfigure.CameraBrand);
  21. return videoInstance;
  22. }
  23. }
  24. }