public EsStreamController(EsPlayerPacketStorage storage, Window window) { if (SynchronizationContext.Current == null) { throw new ArgumentNullException(nameof(SynchronizationContext.Current)); } _syncCtx = SynchronizationContext.Current; // Create placeholder to data streams & chunk states esStreams = new EsStream[(int)StreamType.Count]; playbackErrorSubs = new IDisposable[(int)StreamType.Count]; _playerClock = new PlayerClockProvider(_clockScheduler); dataSynchronizer = new Synchronizer(_playerClock); _dataClock = new DataClockProvider(_clockScheduler, _playerClock); _dataClock.SynchronizerClock = dataSynchronizer.Pts(); packetStorage = storage; displayWindow = window; try { player = new ESPlayer.ESPlayer(); OpenPlayer(); } catch (Exception e) { logger.Error(e); } }
public EsStreamController(EsPlayerPacketStorage storage, Window window) { displayWindow = window; CreatePlayer(); packetStorage = storage; // Create placeholder to data streams & chunk states dataStreams = new DataStream[(int)StreamType.Count]; streamReconfigureSubs = new IDisposable[(int)StreamType.Count]; playbackErrorSubs = new IDisposable[(int)StreamType.Count]; AttachEventHandlers(); }
public EsPlayer(Window window) { try { packetStorage = new EsPlayerPacketStorage(); packetStorage.Initialize(StreamType.Audio); packetStorage.Initialize(StreamType.Video); streamControl = new EsStreamController(packetStorage, window); streamControl.Initialize(StreamType.Audio); streamControl.Initialize(StreamType.Video); } catch (InvalidOperationException ioe) { logger.Error(ioe, "EsPlayer failure"); throw ioe; } }
public EsStreamController(EsPlayerPacketStorage storage, Window window) { _playerClock = new PlayerClockProvider(_clockScheduler); _dataClock = new DataClockProvider(_clockScheduler); _suspendResumeLogic = new SuspendResumeLogic(SuspendPlayback, ResumePlayback, SetPlayerState, GetVideoPlayerState, SetDataTransferState, activeTaskCts.Token); displayWindow = window; CreatePlayer(); packetStorage = storage; // 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); AttachEventHandlers(); }
public EsStream(Common.StreamType type, EsPlayerPacketStorage storage) { streamType = type; packetStorage = storage; switch (streamType) { case StreamType.Audio: PushStreamConfig = PushAudioConfig; break; case StreamType.Video: PushStreamConfig = PushVideoConfig; break; default: throw new ArgumentException($"Stream Type {streamType} is unsupported"); } wakeup = new ManualResetEventSlim(false); }
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(Common.StreamType type, EsPlayerPacketStorage storage, StreamBufferController bufferController) { streamType = type; packetStorage = storage; streamBufferController = bufferController; switch (streamType) { case StreamType.Audio: PushStreamConfig = PushAudioConfig; break; case StreamType.Video: PushStreamConfig = PushVideoConfig; break; default: throw new ArgumentException($"Stream Type {streamType} is unsupported"); } wakeup = new ManualResetEventSlim(false); barrier = new PacketBarrier(TransferChunk); }
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) : this(storage, WindowUtils.CreateElmSharpWindow()) { usesExternalWindow = false; }