public DashClient(IThroughputHistory throughputHistory, StreamType streamType) { this.throughputHistory = throughputHistory ?? throw new ArgumentNullException(nameof(throughputHistory), "throughputHistory cannot be null"); this.streamType = streamType; }
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; }
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 }; }
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(); }
public static Task <DownloadResponse> DownloadDataAsync(DownloadRequest downloadRequest, CancellationToken cancellationToken, IThroughputHistory throughputHistory) { var dashDownloader = new DashDownloader(downloadRequest, cancellationToken, throughputHistory); return(dashDownloader.DownloadInternalAsync()); }