Exemplo n.º 1
0
        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();
                }
            }
        }
Exemplo n.º 3
0
        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();
                }
            }
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
        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();
 }