public EsStream(StreamType type, EsPlayerPacketStorage storage, Synchronizer synchronizer, PlayerClockProvider playerClock) { streamType = type; packetStorage = storage; _dataSynchronizer = synchronizer; _dataSynchronizer.Initialize(streamType); _playerClock = playerClock; switch (streamType) { case StreamType.Audio: PushStreamConfig = PushAudioConfig; break; case StreamType.Video: PushStreamConfig = PushVideoConfig; break; default: throw new ArgumentException($"Stream Type {streamType} is unsupported"); } }
public EsStream(StreamType type, EsPlayerPacketStorage storage, Synchronizer synchronizer, SuspendResumeLogic suspendRedumeLogic) { streamType = type; packetStorage = storage; _dataSynchronizer = synchronizer; _dataSynchronizer.Initialize(streamType); _suspendResumeLogic = suspendRedumeLogic; switch (streamType) { case StreamType.Audio: PushStreamConfig = PushAudioConfig; break; case StreamType.Video: PushStreamConfig = PushVideoConfig; break; default: throw new ArgumentException($"Stream Type {streamType} is unsupported"); } _firstDataPacketTcs = new TaskCompletionSource <object>(); }
public EsStreamController(EsPlayerPacketStorage storage, Window window) { if (SynchronizationContext.Current == null) { throw new ArgumentNullException(nameof(SynchronizationContext.Current)); } _syncCtx = SynchronizationContext.Current; _playerClock = new PlayerClockProvider(_clockScheduler); _dataClock = new DataClockProvider(_clockScheduler, _playerClock); // Create placeholder to data streams & chunk states esStreams = new EsStream[(int)StreamType.Count]; streamReconfigureSubs = new IDisposable[(int)StreamType.Count]; playbackErrorSubs = new IDisposable[(int)StreamType.Count]; dataSynchronizer = new Synchronizer(_playerClock); packetStorage = storage; displayWindow = window; player = new ESPlayer.ESPlayer(); OpenPlayer(); }