Skip to content

Commit

Permalink
windows: adapt to move of videosync to windowing
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta authored and popcornmix committed Feb 14, 2017
1 parent 80f8cf4 commit 922e5b4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
6 changes: 4 additions & 2 deletions 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)

Expand Down
5 changes: 1 addition & 4 deletions xbmc/windowing/windows/VideoSyncD3D.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -155,4 +153,3 @@ std::string CVideoSyncD3D::GetErrorDescription(HRESULT hr)
return StringUtils::Format("%ls: %ls", error.c_str(), descr.c_str());
}

#endif
7 changes: 2 additions & 5 deletions xbmc/windowing/windows/VideoSyncD3D.h
Expand Up @@ -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<bool>& stop) override;
void Cleanup() override;
Expand All @@ -47,4 +45,3 @@ class CVideoSyncD3D : public CVideoSync, IDispResource
int64_t m_lastUpdateTime;
};

#endif
8 changes: 6 additions & 2 deletions xbmc/windowing/windows/WinSystemWin32.cpp
Expand Up @@ -31,8 +31,8 @@
#include "utils/log.h"
#include "utils/CharsetConverter.h"
#include "utils/SystemInfo.h"
#include "VideoSyncD3D.h"

#ifdef TARGET_WINDOWS
#include <tpcshrd.h>

CWinSystemWin32::CWinSystemWin32()
Expand Down Expand Up @@ -939,4 +939,8 @@ void CWinSystemWin32::SetForegroundWindowInternal(HWND hWnd)
}
}

#endif
std::unique_ptr<CVideoSync> CWinSystemWin32::GetVideoSync(void *clock)
{
std::unique_ptr<CVideoSync> pVSync(new CVideoSyncD3D(clock));
return pVSync;
}
3 changes: 3 additions & 0 deletions xbmc/windowing/windows/WinSystemWin32.h
Expand Up @@ -154,6 +154,9 @@ class CWinSystemWin32 : public CWinSystemBase
virtual bool Hide();
virtual bool Show(bool raise = true);

// videosync
virtual std::unique_ptr<CVideoSync> GetVideoSync(void *clock) override;

// CWinSystemWin32
HWND GetHwnd() { return m_hWnd; }
bool IsAlteringWindow() { return m_IsAlteringWindow; }
Expand Down

0 comments on commit 922e5b4

Please sign in to comment.