public void EnqueueRequest(Segment segment, IEnumerable<MediaStream> streamsToAdd, IEnumerable<MediaStream> streamsToRemove)
 {
     AddRequest(new StreamModifyRequest(segment, streamsToAdd, streamsToRemove));
 }
 public void EnqueueRequest(Segment segment, IEnumerable<MediaStream> streams)
 {
     var request = new StreamSelectionRequest(segment, streams);
     AddRequest(request);
 }
 public StreamSelectionRequest(Segment segment, IEnumerable<MediaStream> mediaStreams)
 {
     Segment = segment;
     Streams = mediaStreams;
 }
 public StreamModifyRequest(Segment segment, IEnumerable<MediaStream> mediaStreamsToAdd, IEnumerable<MediaStream> mediaStreamsToRemove)
 {
     Segment = segment;
     StreamsToAdd = mediaStreamsToAdd;
     StreamsToRemove = mediaStreamsToRemove;
 }
 private void StreamSelectionManager_StreamSelectionCompleted(StreamSelectionManager streamSelectionManager, Segment segment, IEnumerable<MediaStream> streams, StreamUpdatedListEventArgs e)
 {
     if (e.Error == null)
     {
         foreach (StreamUpdatedEventArgs update in e.StreamUpdatedEvents)
         {
             if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamSelected)
             {
                 StreamSelected.IfNotNull(i => i(this, new MediaStream(update.Stream)));
             }
             else if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamDeselected)
             {
                 StreamUnselected.IfNotNull(i => i(this, new MediaStream(update.Stream)));
             }
         }
     }
     else
     {
         StreamSelectionFailed.IfNotNull(i => i(this, streams.Cast<IMediaStream>(), e.Error));
     }
 }
 private void StreamSelectionManager_StreamSelectionExceededMaximumRetries(StreamSelectionManager streamSelectionManager, Segment segment, IEnumerable<MediaStream> streams)
 {
     StreamSelectionFailed.IfNotNull(i => i(this, streams.Cast<IMediaStream>(), new StreamSelectionTimeOutException()));
 }