Exemplo n.º 1
0
 protected void SetupNoSources()
 {
     _videoSourceDatabaseMock.Setup(x => x.Load()).Returns(
         new VideoSource[] {}
         );
     _videoSourceStorage = new VideoSourceStorage(_videoSourceDatabaseMock.Object);
 }
Exemplo n.º 2
0
 protected void SetupTwoSources()
 {
     _videoSourceDatabaseMock.Setup(x => x.Load()).Returns(
         new VideoSource[] { _videoSourcesFixtures.VideoSourceOne, _videoSourcesFixtures.VideoSourceTwo }
         );
     _videoSourceStorage = new VideoSourceStorage(_videoSourceDatabaseMock.Object);
 }
Exemplo n.º 3
0
        public ConnectionService(IVideoSourceStorage videoSourceStorage, IRtspClientFactory rtspClientfactory,
                                 IRtspServer rtspServer)
        {
            _videoSourceStorage = videoSourceStorage;
            _rtspClientFactory  = rtspClientfactory;

            _rtspServer = rtspServer;
            _rtspServer.OnConnectionAdded   += RtspServerConnectionAdded;
            _rtspServer.OnConnectionRemoved += RtspServerConnectionRemoved;
            _rtspServer.OnProvideSdpData    += RtspServerProvideSdpData;

            _rtspClientsDictionary = new ConcurrentDictionary <Guid, IRtspClient>();

            _serverConnectionsDictionary = new ConcurrentDictionary <Guid, List <Guid> >(
                _videoSourceStorage.VideoSources.ToList().ConvertAll(vs =>
            {
                return(new KeyValuePair <Guid, List <Guid> >(vs.Id, new List <Guid>()));
            })
                );

            _cancellationTokenSourceDictionary = new ConcurrentDictionary <Guid, CancellationTokenSource>();
        }
 public RequestUrlVideoSourceResolverStrategy(IVideoSourceStorage videoSourceStorage)
 {
     _videoSourceStorage = videoSourceStorage;
 }