xbmc
VideoSyncTVos.h
1 /*
2  * Copyright (C) 2015-2018 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 class CWinSystemTVOS;
15 
17 {
18 public:
19  CVideoSyncTVos(void* clock, CWinSystemTVOS& winSystem) : CVideoSync(clock), m_winSystem(winSystem)
20  {
21  }
22 
23  // CVideoSync interface
24  bool Setup(PUPDATECLOCK func) override;
25  void Run(CEvent& stopEvent) override;
26  void Cleanup() override;
27  float GetFps() override;
28 
29  // IDispResource interface
30  void OnResetDisplay() override;
31 
32  // used in the displaylink callback
33  void TVosVblankHandler();
34 
35 private:
36  // CVideoSyncDarwin interface
37  virtual bool InitDisplayLink();
38  virtual void DeinitDisplayLink();
39 
40  //timestamp of the last vblank, used for calculating how many vblanks happened
41  int64_t m_LastVBlankTime = 0;
42  CEvent m_abortEvent;
43  CWinSystemTVOS& m_winSystem;
44 };
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
Definition: VideoSyncTVos.h:16
Definition: DispResource.h:14
Definition: VideoSync.h:16
Definition: WinSystemTVOS.h:27