| 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 CWinSystemIOS; |
| 15 |
|
| 16 |
class CVideoSyncIos : public CVideoSync, IDispResource |
| 17 |
{ |
| 18 |
public: |
| 19 |
CVideoSyncIos(CVideoReferenceClock* clock, CWinSystemIOS& winSystem) |
| 20 |
: CVideoSync(clock), m_winSystem(winSystem) |
| 21 |
{ |
| 22 |
} |
| 23 |
|
| 24 |
// CVideoSync interface |
| 25 |
bool Setup() override; |
| 26 |
void Run(CEvent& stopEvent) override; |
| 27 |
void Cleanup() override; |
| 28 |
float GetFps() override; |
| 29 |
|
| 30 |
// IDispResource interface |
| 31 |
void OnResetDisplay() override; |
| 32 |
|
| 33 |
// used in the displaylink callback |
| 34 |
void IosVblankHandler(); |
| 35 |
|
| 36 |
private: |
| 37 |
// CVideoSyncDarwin interface |
| 38 |
virtual bool InitDisplayLink(); |
| 39 |
virtual void DeinitDisplayLink(); |
| 40 |
|
| 41 |
int64_t m_LastVBlankTime = 0; //timestamp of the last vblank, used for calculating how many vblanks happened |
| 42 |
CEvent m_abortEvent; |
| 43 |
CWinSystemIOS &m_winSystem; |
| 44 |
}; |
| 45 |
|