Пример #1
0
 public DashClient(IThroughputHistory throughputHistory, StreamType streamType)
 {
     this.throughputHistory = throughputHistory ??
                              throw new ArgumentNullException(nameof(throughputHistory),
                                                              "throughputHistory cannot be null");
     this.streamType = streamType;
 }
Пример #2
0
        private DashDownloader(DownloadRequest downloadRequest, CancellationToken cancellationToken,
                               IThroughputHistory throughputHistory)
        {
            request = downloadRequest;

            if (!string.IsNullOrEmpty(request.DownloadSegment.ByteRange))
            {
                downloadRange = new ByteRange(request.DownloadSegment.ByteRange);
            }

            this.cancellationToken = cancellationToken;
            this.throughputHistory = throughputHistory;
        }
Пример #3
0
 public DashClient(IThroughputHistory throughputHistory, StreamType streamType)
 {
     this.throughputHistory = throughputHistory ??
                              throw new ArgumentNullException(nameof(throughputHistory),
                                                              "throughputHistory cannot be null");
     this.streamType = streamType;
     dataRequest     = new DataRequest
     {
         Duration      = TimeSpan.Zero,
         IsBufferEmpty = true,
         StreamType    = this.streamType
     };
 }
Пример #4
0
        public DashMediaPipeline(IDashClient dashClient, IDemuxerController demuxerController,
                                 IThroughputHistory throughputHistory,
                                 StreamType streamType)
        {
            this.dashClient = dashClient ??
                              throw new ArgumentNullException(nameof(dashClient), "dashClient cannot be null");
            this.demuxerController = demuxerController ??
                                     throw new ArgumentNullException(nameof(demuxerController), "cannot be null");
            this.throughputHistory = throughputHistory ??
                                     throw new ArgumentNullException(nameof(throughputHistory),
                                                                     "throughputHistory cannot be null");
            StreamType = streamType;

            clientReadySub = dashClient.Ready()
                             .Subscribe(async unit => await OnClientReady(), SynchronizationContext.Current);
            SubscribeDemuxerEvents();
        }
Пример #5
0
        public static Task <DownloadResponse> DownloadDataAsync(DownloadRequest downloadRequest,
                                                                CancellationToken cancellationToken, IThroughputHistory throughputHistory)
        {
            var dashDownloader = new DashDownloader(downloadRequest, cancellationToken, throughputHistory);

            return(dashDownloader.DownloadInternalAsync());
        }