コード例 #1
0
        public ClientStream AddClient(ClientConnection client)
        {
            ClientStream stream = new ClientStream(client, Encoder);

            Task.Run(() => {
                stream.Run().Wait();
                stream.Stop();

                CurrentStreams.Remove(stream);
                StreamStopped?.Invoke(this, new StreamStoppedEventArgs(stream));

                if (!CurrentStreams.Any())
                {
                    Source.StopCapture();
                }
            });

            if (!CurrentStreams.Any())
            {
                Source.StartCapture();
            }

            CurrentStreams.Add(stream);
            StreamStarted?.Invoke(this, new StreamStartedEventArgs(stream));

            return(stream);
        }
コード例 #2
0
 public StreamStartedEventArgs(ClientStream stream)
 {
     Stream = stream;
 }