/// <summary>
        /// Sets the streams that are selected within this ISegment.
        /// </summary>
        /// <param name="streams">All of the streams that should be selected when this operation completes.</param>
        public void SetSelectedStreams(IEnumerable <IMediaStream> streams)
        {
            List <StreamInfo> streamInfos = streams.Cast <MediaStream>()
                                            .Select(i => i.StreamInfo)
                                            .ToList();

            _segmentInfo.SelectStreamsAsync(streamInfos);
        }
Ejemplo n.º 2
0
        protected override void BeginRequest(RetryQueueRequest request)
        {
            //Adding an intentional delay here to work around a known timing issue
            //with the SSME.  If this is called too soon after initialization the
            //request will be aborted with no indication raised from the SSME.
            //TODO: Remove this workaround once the SSME has been fixed.
            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = TimeSpan.FromMilliseconds(250);
            EventHandler tickHandler = null;

            tickHandler = (s, e) =>
            {
                SegmentInfo       segment  = null;
                List <StreamInfo> streams  = null;
                var streamSelectionRequest = request as StreamSelectionRequest;
                if (streamSelectionRequest != null)
                {
                    streams = streamSelectionRequest.Streams.ToList();
                    segment = streamSelectionRequest.Segment;
                }
                else
                {
                    var streamModifyRequest = request as StreamModifyRequest;
                    if (streamModifyRequest != null)
                    {
                        streams = streamModifyRequest.Streams.ToList();
                        segment = streamModifyRequest.Segment;
                    }
                }
                segment.SelectStreamsAsync(streams, request);
                timer.Tick -= tickHandler;
                timer.Stop();
            };
            timer.Tick += tickHandler;
            timer.Start();
        }