Example #1
0
        public void Process()
        {
            if (!_isVmr9Initialized)
            {
                return;
            }
            if (!GUIGraphicsContext.Vmr9Active)
            {
                return;
            }
            if (g_Player.Playing && g_Player.IsDVD && g_Player.IsDVDMenu)
            {
                GUIGraphicsContext.Vmr9FPS = 0f;
                currentVmr9State           = Vmr9PlayState.Playing;
                _scene.DrawVideo           = true;
                _repaintTimer = DateTime.Now;
                return;
            }

            TimeSpan ts     = DateTime.Now - _repaintTimer;
            int      frames = FrameCounter;

            if (ts.TotalMilliseconds >= 1750 ||
                (currentVmr9State == Vmr9PlayState.Repaint && FrameCounter > 0) ||
                g_Player.Paused) // in paused state frames aren't rendered so we need "force" the GUI drawing here
            {
                _repaintTimer = DateTime.Now;
                GUIGraphicsContext.Vmr9FPS = ((float)(frames * 1000)) / ((float)ts.TotalMilliseconds);
                //Log.Info("VMR9Helper:frames:{0} fps:{1} time:{2}", frames, GUIGraphicsContext.Vmr9FPS,ts.TotalMilliseconds);
                FrameCounter = 0;

                if (_threadId == Thread.CurrentThread.ManagedThreadId)
                {
                    if (_qualityInterface != null)
                    {
                        VideoRendererStatistics.Update(_qualityInterface);
                    }
                    else
                    {
                        Log.Debug("_qualityInterface is null!");
                    }
                }
            }

            if (currentVmr9State == Vmr9PlayState.Repaint && frames > 0)
            {
                Log.Debug("VMR9: Repainting -> Playing, Frames: {0}", frames);
                GUIGraphicsContext.Vmr9FPS = 50f;
                currentVmr9State           = Vmr9PlayState.Playing;
                _scene.DrawVideo           = true;
                _repaintTimer = DateTime.Now;
            }
            else if (currentVmr9State == Vmr9PlayState.Playing && GUIGraphicsContext.Vmr9FPS < 2f)
            {
                Log.Debug("VMR9Helper: Playing -> Repainting, Frames {0}", frames);
                GUIGraphicsContext.Vmr9FPS = 0f;
                currentVmr9State           = Vmr9PlayState.Repaint;
                _scene.DrawVideo           = false;
            }
        }
Example #2
0
        public void Process()
        {
            if (!vmr7intialized)
            {
                return;
            }
            if (GUIGraphicsContext.Vmr9Active)
            {
                return;
            }
            TimeSpan ts = DateTime.Now - repaintTimer;

            if (ts.TotalMilliseconds > 1000)
            {
                repaintTimer = DateTime.Now;
                VideoRendererStatistics.Update(quality);
            }
        }