kodi
VideoSyncGbm.h
1 /*
2  * Copyright (C) 2005-2021 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "guilib/DispResource.h"
12 #include "windowing/VideoSync.h"
13 
14 #include <atomic>
15 
16 class CWinSystemBase;
17 
19 {
20 public:
21  explicit CVideoSyncGbm(CVideoReferenceClock* clock);
22  CVideoSyncGbm() = delete;
23  ~CVideoSyncGbm() override = default;
24 
25  // CVideoSync overrides
26  bool Setup() override;
27  void Run(CEvent& stopEvent) override;
28  void Cleanup() override;
29  float GetFps() override;
30  void RefreshChanged() override;
31 
32  // IDispResource overrides
33  void OnResetDisplay() override;
34 
35 private:
36  int m_fd = -1;
37  uint32_t m_crtcId = 0;
38  uint64_t m_sequence = 0;
39  uint64_t m_offset = 0;
40  std::atomic<bool> m_abort{false};
41 
42  CWinSystemBase* m_winSystem;
43 };
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
Definition: VideoSyncGbm.h:18
Definition: WinSystem.h:49
Definition: DispResource.h:14
Definition: VideoReferenceClock.h:19
Definition: VideoSync.h:15