diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2011-04-12 10:44:25 +0400 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2011-04-12 10:44:25 +0400 |
commit | ce7ef0079cb7d7b72eba066165e78e95033ab176 (patch) | |
tree | 53c9720e0ba3ee4f7aa34266b4d3f7da912ba244 /src/filters/renderer/VideoRenderers | |
parent | a1868552d2a5dc5dd3a20f00cdb60eeef44b9fe1 (diff) |
Fix: Better synchronization video after resolution change(EVR Custom);
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3023 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/renderer/VideoRenderers')
8 files changed, 59 insertions, 0 deletions
diff --git a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp index c3fed705f..eba9dea5b 100644 --- a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp +++ b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp @@ -442,6 +442,11 @@ STDMETHODIMP_(bool) CDX7AllocatorPresenter::ResetDevice() return true;
}
+STDMETHODIMP_(bool) CDX7AllocatorPresenter::DisplayChange()
+{
+ return true;
+}
+
STDMETHODIMP CDX7AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
{
CheckPointer(size, E_POINTER);
diff --git a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h index a98438695..f84a7d11b 100644 --- a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h +++ b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h @@ -60,6 +60,7 @@ namespace DSObjects STDMETHODIMP_(bool) Paint(bool fAll);
STDMETHODIMP GetDIB(BYTE* lpDib, DWORD* size);
STDMETHODIMP_(bool) ResetDevice();
+ STDMETHODIMP_(bool) DisplayChange();
};
}
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp index 27263f5cb..237ac6b52 100644 --- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp +++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp @@ -1871,6 +1871,12 @@ STDMETHODIMP_(bool) CDX9AllocatorPresenter::ResetDevice() return true;
}
+STDMETHODIMP_(bool) CDX9AllocatorPresenter::DisplayChange()
+{
+ SendResetRequest();
+ return true;
+}
+
void CDX9AllocatorPresenter::DrawText(const RECT &rc, const CString &strText, int _Priority)
{
if (_Priority < 1) {
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h index 1f5840e6e..7925b25aa 100644 --- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h +++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h @@ -293,5 +293,6 @@ namespace DSObjects STDMETHODIMP SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget);
STDMETHODIMP SetPixelShader2(LPCSTR pSrcData, LPCSTR pTarget, bool bScreenSpace);
STDMETHODIMP_(bool) ResetDevice();
+ STDMETHODIMP_(bool) DisplayChange();
};
}
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp index e6b2d805d..e16c53c3f 100644 --- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp +++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp @@ -1863,6 +1863,45 @@ STDMETHODIMP_(bool) CEVRAllocatorPresenter::ResetDevice() return bResult;
}
+STDMETHODIMP_(bool) CEVRAllocatorPresenter::DisplayChange()
+{
+ CAutoLock lock(this);
+ CAutoLock lock2(&m_ImageProcessingLock);
+ CAutoLock cRenderLock(&m_RenderLock);
+
+ m_DetectedFrameRate = 0.0;
+ m_DetectedFrameTime = 0.0;
+ m_DetectedFrameTimeStdDev = 0.0;
+ m_DetectedLock = false;
+ ZeroMemory(m_DetectedFrameTimeHistory, sizeof(m_DetectedFrameTimeHistory));
+ ZeroMemory(m_DetectedFrameTimeHistoryHistory, sizeof(m_DetectedFrameTimeHistoryHistory));
+ m_DetectedFrameTimePos = 0;
+ ZeroMemory(&m_VMR9AlphaBitmap, sizeof(m_VMR9AlphaBitmap));
+
+ ZeroMemory(m_ldDetectedRefreshRateList, sizeof(m_ldDetectedRefreshRateList));
+ ZeroMemory(m_ldDetectedScanlineRateList, sizeof(m_ldDetectedScanlineRateList));
+ m_DetectedRefreshRatePos = 0;
+ m_DetectedRefreshTimePrim = 0;
+ m_DetectedScanlineTime = 0;
+ m_DetectedScanlineTimePrim = 0;
+ m_DetectedRefreshRate = 0;
+
+ memset (m_pllJitter, 0, sizeof(m_pllJitter));
+ memset (m_pllSyncOffset, 0, sizeof(m_pllSyncOffset));
+ m_nNextJitter = 0;
+ m_nNextSyncOffset = 0;
+ m_llLastPerf = 0;
+ m_fAvrFps = 0.0;
+ m_fJitterStdDev = 0.0;
+ m_fSyncOffsetStdDev = 0.0;
+ m_fSyncOffsetAvr = 0.0;
+ m_bSyncStatsAvailable = false;
+
+ bool bResult = __super::DisplayChange();
+
+ return bResult;
+}
+
void CEVRAllocatorPresenter::RenderThread()
{
HANDLE hEvts[] = { m_hEvtQuit, m_hEvtFlush};
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h index 56d67639c..28efe83c8 100644 --- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h +++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h @@ -74,6 +74,7 @@ namespace DSObjects STDMETHODIMP GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight);
STDMETHODIMP InitializeDevice(IMFMediaType* pMediaType);
STDMETHODIMP_(bool) ResetDevice();
+ STDMETHODIMP_(bool) DisplayChange();
// IMFClockStateSink
STDMETHODIMP OnClockStart(/* [in] */ MFTIME hnsSystemTime, /* [in] */ LONGLONG llClockStartOffset);
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp index d2c725308..b772fd8b7 100644 --- a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp +++ b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp @@ -1904,6 +1904,11 @@ STDMETHODIMP_(bool) CBaseAP::ResetDevice() return true;
}
+STDMETHODIMP_(bool) CBaseAP::DisplayChange()
+{
+ return true;
+}
+
void CBaseAP::DrawText(const RECT &rc, const CString &strText, int _Priority)
{
if (_Priority < 1) {
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.h b/src/filters/renderer/VideoRenderers/SyncRenderer.h index 8e9f87c79..60b7a8d19 100644 --- a/src/filters/renderer/VideoRenderers/SyncRenderer.h +++ b/src/filters/renderer/VideoRenderers/SyncRenderer.h @@ -337,6 +337,7 @@ namespace GothSync STDMETHODIMP SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget);
STDMETHODIMP SetPixelShader2(LPCSTR pSrcData, LPCSTR pTarget, bool bScreenSpace);
STDMETHODIMP_(bool) ResetDevice();
+ STDMETHODIMP_(bool) DisplayChange();
};
class CSyncAP:
|