public async Task StartStream() { await Task.Run(() => { _pipeline = MediaPipeline.CreateBuilder() .Source(new OpenCVRtspSource(SelectDataInterface(_dataSource), TimeSpan.FromMilliseconds(250))) .Transform(_transform) .Sink(this) .Build(); _pipeline.Start(); }); }
public override void Start() { lock (this) { if (_pipeline == null) { _pipeline = MediaPipeline.CreateBuilder() .Source(_src) .Transform(new RecordingTransform(_spy, Id)) .Transform(new RtpPacketizer(new DefaultRtpClock(90000), SSRC, _payloadType)) .Sink(new TcpInterleavedSink(_context, (byte)_ports.RtpPort)) .Build(); _pipeline.Start(); } } }
public void JumpToLive() { lock (PlayerLock) { if (!_isLive) { _isLive = true; _pipeline.SetFlushing(true); _pipeline.Stop(); _pipeline = _config.PipelineFactory.CreatePipeline(_transformSource, _isLive); _pipeline.SetFlushing(false); _pipeline.Start(); _source.JumpToLive(); } } }
public void Start(DateTime?playAt = null) { lock (PlayerLock) { if (_pipeline != null) { // Already started. return; } _transformSource = new RtpPayloadTransform(); _isLive = !playAt.HasValue; _source.Play(_transformSource, playAt); _pipeline = _config.PipelineFactory.CreatePipeline(_transformSource, _isLive); _pipeline.Start(); } }
public void Seek(DateTime seekTo) { lock (PlayerLock) { if (_transformSource == null) { throw new ArgumentException("Unable to seek before starting player"); } if (_isLive) { _isLive = false; _pipeline.SetFlushing(true); _pipeline.Stop(); _pipeline = _config.PipelineFactory.CreatePipeline(_transformSource, _isLive); _pipeline.Start(); } _source.Seek(seekTo); } }
public void Start() { _pipeline.Start(); }
public override void Start() { _pipeline.Start(); }