public void Initialize(StreamType stream) { logger.Info(stream.ToString()); if (esStreams[(int)stream] != null) { throw new ArgumentException($"Stream {stream} already initialized"); } dataSynchronizer.Initialize(stream); var esStream = new EsStream(stream, packetStorage, dataSynchronizer, _playerClock); esStream.SetPlayer(player); streamReconfigureSubs[(int)stream] = esStream.StreamReconfigure() .Subscribe(async _ => await OnStreamReconfigure(), _syncCtx); playbackErrorSubs[(int)stream] = esStream.PlaybackError() .Subscribe(OnEsStreamError, _syncCtx); esStreams[(int)stream] = esStream; }
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>(); }