Esempio n. 1
0
        public void InitOutput(OutputStreamQueueReader <Packet> reader)
        {
            ShutDown();

            _reader            = reader;
            _timerSubscription = _clientStreamer.Subscribe(990, OnTimer);
        }
        public VideoBlenderContext(VideoBlenderSetup setup, PayloadPool <Frame> framePool, IStreamerBase streamer, OverloadController overloadController, Action pushPipeline)
        {
            _name               = new NodeName("VE", null, "BL", 1);
            _fps                = setup.Fps;
            _framePool          = framePool;
            _streamer           = streamer;
            _overloadController = overloadController;
            _pushPipeline       = pushPipeline;
            _delayFromRuntime   = ToTime(setup.DelayFromRuntimeFrames);  // 3 frames in client
            _pushPipelineDelay  = ToTime(setup.PushPipelineDelayFrames); // 3 frames

            Reconfigure(setup);

            _timer = _streamer.Subscribe(15, OnTimer);
            if (setup.Dx != null)
            {
                if (setup.BlendingType == BlendingType.Smart)
                {
                    _directXPipeline       = LoadPipline(BlendingType.Linear, setup.Dx);
                    _directXPipelineLowRes = LoadPipline(BlendingType.BilinearLowRes, setup.Dx);
                }
                else
                {
                    _directXPipeline = LoadPipline(setup.BlendingType, setup.Dx);
                }
            }

            _currentFpsTicks = ToTicks(Core.GetCurrentTime() - 600_000); // -60ms
        }
        public void Subscribe(ISubscriber <long> s)
        {
            TimerSubscription parent = new TimerSubscription(s);

            s.OnSubscribe(parent);

            parent.SetFuture(scheduler.Schedule(parent.Run, delay));
        }
        public override void Subscribe(IFlowableSubscriber <long> subscriber)
        {
            var parent = new TimerSubscription(subscriber);

            subscriber.OnSubscribe(parent);

            parent.SetTask(executor.Schedule(parent.Run, delay));
        }
Esempio n. 5
0
 public AudioMixingQueue(NodeName name, PayloadPool <Frame> payloadPool, IStreamerBase streamer,
                         AudioMixingQueueSetup setup)
 {
     _name        = name;
     _payloadPool = payloadPool;
     _setup       = setup;
     OnChanged    = () => { Core.LogWarning($"Fake activation of {_name}"); };
     _timer       = streamer.Subscribe(100, OnTimer);
 }
Esempio n. 6
0
 public void ShutDown()
 {
     if (_timerSubscription != null)
     {
         _clientStreamer.UnsubscribeTimer(_timerSubscription);
         _timerSubscription = null;
         Reconnected();
     }
     _reader = null;
 }
Esempio n. 7
0
 public InputNode(NodeName name, Action inputOpened, IStreamerBase streamer)
 {
     _name             = name;
     _statisticKeeper  = new StatisticKeeper <StatisticDataOfInputOutput>(name);
     _inputOpened      = inputOpened;
     _streamer         = streamer;
     _inputThread      = new Thread(() => OnInputThread());
     _inputThread.Name = $"Streamer:{name} input thread";
     _observer         = streamer.Subscribe(1000, On1Second);
 }
        public InputBufferQueue(string name, IStreamerBase streamer, int maxPackets, DirectXContext dx, int width, int height)
        {
            _name       = name;
            _streamer   = streamer;
            _maxPackets = maxPackets;
            _dx         = dx;
            _width      = width;
            _height     = height;

            _timer = streamer.Subscribe(300, OnTimer);
        }
 public void Dispose()
 {
     _timer?.Unsubscribe();
     _timer = null;
     lock (_queueLock)
     {
         foreach (var p in _queue)
         {
             _streamer.PacketPool.Back(p);
         }
         _queue.Clear();
     }
 }
 public ResourceManager(IStreamerBase streamer)
 {
     _streamer = streamer;
     _timer5s  = streamer.Subscribe(5000, On5Seconds);
     _timer1s  = streamer.Subscribe(990, On1Seconds);
 }
        public OverloadController(IStreamerBase streamer)
        {
            _streamer = streamer;

            _timer = streamer.Subscribe(90, OnTimer);
        }