diff --git a/xbmc/windowing/windows/CMakeLists.txt b/xbmc/windowing/windows/CMakeLists.txt index 4a1f1b3b5b948..76c5293f0bbbb 100644 --- a/xbmc/windowing/windows/CMakeLists.txt +++ b/xbmc/windowing/windows/CMakeLists.txt @@ -1,8 +1,10 @@ -set(SOURCES WinEventsWin32.cpp +set(SOURCES VideoSyncD3D.cpp + WinEventsWin32.cpp WinSystemWin32.cpp WinSystemWin32DX.cpp) -set(HEADERS WinEventsWin32.h +set(HEADERS VideoSyncD3D.h + WinEventsWin32.h WinSystemWin32.h WinSystemWin32DX.h) diff --git a/xbmc/windowing/windows/VideoSyncD3D.cpp b/xbmc/windowing/windows/VideoSyncD3D.cpp index e48b91e121a21..3d9462723bc8c 100644 --- a/xbmc/windowing/windows/VideoSyncD3D.cpp +++ b/xbmc/windowing/windows/VideoSyncD3D.cpp @@ -20,13 +20,11 @@ #include "system.h" -#if defined(TARGET_WINDOWS) - #include "utils/log.h" #include "Utils/TimeUtils.h" #include "Utils/MathUtils.h" #include "windowing\WindowingFactory.h" -#include "video/videosync/VideoSyncD3D.h" +#include "VideoSyncD3D.h" #include "guilib/GraphicContext.h" #include "platform/win32/dxerr.h" #include "utils/StringUtils.h" @@ -155,4 +153,3 @@ std::string CVideoSyncD3D::GetErrorDescription(HRESULT hr) return StringUtils::Format("%ls: %ls", error.c_str(), descr.c_str()); } -#endif diff --git a/xbmc/windowing/windows/VideoSyncD3D.h b/xbmc/windowing/windows/VideoSyncD3D.h index 486b6206f668f..64a28cdc3e3f5 100644 --- a/xbmc/windowing/windows/VideoSyncD3D.h +++ b/xbmc/windowing/windows/VideoSyncD3D.h @@ -19,16 +19,14 @@ * */ -#if defined(TARGET_WINDOWS) - -#include "video/videosync/VideoSync.h" +#include "windowing/VideoSync.h" #include "guilib/DispResource.h" #include "threads/Event.h" class CVideoSyncD3D : public CVideoSync, IDispResource { public: - CVideoSyncD3D(CVideoReferenceClock *clock) : CVideoSync(clock) {}; + CVideoSyncD3D(void *clock) : CVideoSync(clock) {}; bool Setup(PUPDATECLOCK func) override; void Run(std::atomic& stop) override; void Cleanup() override; @@ -47,4 +45,3 @@ class CVideoSyncD3D : public CVideoSync, IDispResource int64_t m_lastUpdateTime; }; -#endif diff --git a/xbmc/windowing/windows/WinSystemWin32.cpp b/xbmc/windowing/windows/WinSystemWin32.cpp index 1e7edb23376c1..6989179933b7e 100644 --- a/xbmc/windowing/windows/WinSystemWin32.cpp +++ b/xbmc/windowing/windows/WinSystemWin32.cpp @@ -31,8 +31,8 @@ #include "utils/log.h" #include "utils/CharsetConverter.h" #include "utils/SystemInfo.h" +#include "VideoSyncD3D.h" -#ifdef TARGET_WINDOWS #include CWinSystemWin32::CWinSystemWin32() @@ -939,4 +939,8 @@ void CWinSystemWin32::SetForegroundWindowInternal(HWND hWnd) } } -#endif +std::unique_ptr CWinSystemWin32::GetVideoSync(void *clock) +{ + std::unique_ptr pVSync(new CVideoSyncD3D(clock)); + return pVSync; +} diff --git a/xbmc/windowing/windows/WinSystemWin32.h b/xbmc/windowing/windows/WinSystemWin32.h index d5aebef1a48f3..dc522809ec55d 100644 --- a/xbmc/windowing/windows/WinSystemWin32.h +++ b/xbmc/windowing/windows/WinSystemWin32.h @@ -154,6 +154,9 @@ class CWinSystemWin32 : public CWinSystemBase virtual bool Hide(); virtual bool Show(bool raise = true); + // videosync + virtual std::unique_ptr GetVideoSync(void *clock) override; + // CWinSystemWin32 HWND GetHwnd() { return m_hWnd; } bool IsAlteringWindow() { return m_IsAlteringWindow; }