Merge pull request #26312 from garbear/update-controllers
[xbmc.git] / xbmc / windowing / X11 / VideoSyncGLX.h
blobb03d331c9290e4608c86dc5fccb3d80bfd02b999
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "guilib/DispResource.h"
12 #include "threads/Event.h"
13 #include "windowing/VideoSync.h"
15 #include <GL/glx.h>
16 #include <X11/X.h>
17 #include <X11/Xlib.h>
19 #include "system_gl.h"
23 namespace KODI
25 namespace WINDOWING
27 namespace X11
30 class CWinSystemX11GLContext;
32 class CVideoSyncGLX : public CVideoSync, IDispResource
34 public:
35 explicit CVideoSyncGLX(CVideoReferenceClock* clock, CWinSystemX11GLContext& winSystem)
36 : CVideoSync(clock), m_winSystem(winSystem)
39 bool Setup() override;
40 void Run(CEvent& stopEvent) override;
41 void Cleanup() override;
42 float GetFps() override;
43 void OnLostDisplay() override;
44 void OnResetDisplay() override;
46 private:
47 int (*m_glXWaitVideoSyncSGI) (int, int, unsigned int*);
48 int (*m_glXGetVideoSyncSGI) (unsigned int*);
50 static Display* m_Dpy;
51 CWinSystemX11GLContext &m_winSystem;
52 XVisualInfo *m_vInfo;
53 Window m_Window;
54 GLXContext m_Context;
55 volatile bool m_displayLost;
56 volatile bool m_displayReset;
57 CEvent m_lostEvent;