public DashManifestProvider(String clipUrl, DashMediaPipeline audioPipeline, DashMediaPipeline videoPipeline) { this.Manifest = new DashManifest(clipUrl); this.audioPipeline = audioPipeline; this.videoPipeline = videoPipeline; }
public DashDataProvider( string clipUrl, DashMediaPipeline audioPipeline, DashMediaPipeline videoPipeline) { this.audioPipeline = audioPipeline ?? throw new ArgumentNullException(nameof(audioPipeline), "audioPipeline cannot be null"); this.videoPipeline = videoPipeline ?? throw new ArgumentNullException(nameof(videoPipeline), "videoPipeline cannot be null"); manifestProvider = new DashManifestProvider(clipUrl, audioPipeline, videoPipeline); manifestReadySub = manifestProvider.ManifestReady() .Subscribe(async unit => await OnManifestReady(), SynchronizationContext.Current); }
public void SynchronizeWith(DashMediaPipeline synchronizeWith) { var myRepresentation = GetRepresentation(); var syncRepresentation = synchronizeWith.GetRepresentation(); var myGood = myRepresentation != null; var syncGood = syncRepresentation != null; if (!myGood || !syncGood) { throw new ArgumentNullException( $"{StreamType}: Null or Failed Init. Representation. {myGood}/{syncGood}"); } myRepresentation.AlignStartSegmentsWith(syncRepresentation); Logger.Info( $"Segment Alignment: {StreamType}={myRepresentation.AlignedStartSegmentID} {synchronizeWith.StreamType}={syncRepresentation.AlignedStartSegmentID} TrimOffset={myRepresentation.AlignedTrimOffset}"); }
public void Dispose() { if (disposed) { return; } disposed = true; OnStopped(); manifestReadySub.Dispose(); manifestProvider.Dispose(); audioPipeline?.Dispose(); audioPipeline = null; videoPipeline?.Dispose(); videoPipeline = null; }