Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2015-09-26 00:56:37 +0300
committerKacper Michajłow <kasper93@gmail.com>2015-09-26 00:57:31 +0300
commita4c2dd1b92e79fb89c751696b243d4398e51fabe (patch)
tree3eefedf5967625e1c6bf5305468aeddcd5aa54a7 /src
parent15f765da23f0df7cdeca8dfd4851812e9cc7b065 (diff)
Revert "CmadVRAllocatorPresenter: Query interfaces once during initialization."
This reverts commit f4521328c210083cea848880c1f160df3093fef9.
Diffstat (limited to 'src')
-rw-r--r--src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp41
-rw-r--r--src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h15
2 files changed, 22 insertions, 34 deletions
diff --git a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
index e9eba490e..27305f0ed 100644
--- a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
@@ -168,25 +168,18 @@ STDMETHODIMP CmadVRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
m_ScreenSize.SetSize(mi.rcMonitor.right - mi.rcMonitor.left, mi.rcMonitor.bottom - mi.rcMonitor.top);
}
- m_pBV = m_pDXR;
- m_pBV2 = m_pDXR;
- m_pMVRC = m_pDXR;
- m_pMVREPS = m_pDXR;
- m_pMVRI = m_pDXR;
- m_pVW = m_pDXR;
-
return S_OK;
}
STDMETHODIMP_(void) CmadVRAllocatorPresenter::SetPosition(RECT w, RECT v)
{
- if (m_pBV) {
- m_pBV->SetDefaultSourcePosition();
- m_pBV->SetDestinationPosition(v.left, v.top, v.right - v.left, v.bottom - v.top);
+ if (CComQIPtr<IBasicVideo> pBV = m_pDXR) {
+ pBV->SetDefaultSourcePosition();
+ pBV->SetDestinationPosition(v.left, v.top, v.right - v.left, v.bottom - v.top);
}
- if (m_pVW) {
- m_pVW->SetWindowPosition(w.left, w.top, w.right - w.left, w.bottom - w.top);
+ if (CComQIPtr<IVideoWindow> pVW = m_pDXR) {
+ pVW->SetWindowPosition(w.left, w.top, w.right - w.left, w.bottom - w.top);
}
SetVideoSize(GetVideoSize(), GetVideoSize(true));
@@ -197,22 +190,22 @@ STDMETHODIMP_(SIZE) CmadVRAllocatorPresenter::GetVideoSize(bool bCorrectAR) cons
SIZE size = {0, 0};
if (!bCorrectAR) {
- if (m_pBV) {
- m_pBV->GetVideoSize(&size.cx, &size.cy);
+ if (CComQIPtr<IBasicVideo> pBV = m_pDXR) {
+ pBV->GetVideoSize(&size.cx, &size.cy);
}
} else {
- if (m_pBV2) {
- m_pBV2->GetPreferredAspectRatio(&size.cx, &size.cy);
+ if (CComQIPtr<IBasicVideo2> pBV2 = m_pDXR) {
+ pBV2->GetPreferredAspectRatio(&size.cx, &size.cy);
}
}
return size;
}
-STDMETHODIMP_(bool) CmadVRAllocatorPresenter::Paint(bool /*bAll*/)
+STDMETHODIMP_(bool) CmadVRAllocatorPresenter::Paint(bool bAll)
{
- if (m_pMVRC) {
- return SUCCEEDED(m_pMVRC->SendCommand("redraw"));
+ if (CComQIPtr<IMadVRCommand> pMVRC = m_pDXR) {
+ return SUCCEEDED(pMVRC->SendCommand("redraw"));
}
return false;
}
@@ -220,8 +213,8 @@ STDMETHODIMP_(bool) CmadVRAllocatorPresenter::Paint(bool /*bAll*/)
STDMETHODIMP CmadVRAllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
{
HRESULT hr = E_NOTIMPL;
- if (m_pBV) {
- hr = m_pBV->GetCurrentImage((long*)size, (long*)lpDib);
+ if (CComQIPtr<IBasicVideo> pBV = m_pDXR) {
+ hr = pBV->GetCurrentImage((long*)size, (long*)lpDib);
}
return hr;
}
@@ -234,11 +227,11 @@ STDMETHODIMP CmadVRAllocatorPresenter::SetPixelShader(LPCSTR pSrcData, LPCSTR pT
STDMETHODIMP CmadVRAllocatorPresenter::SetPixelShader2(LPCSTR pSrcData, LPCSTR pTarget, bool bScreenSpace)
{
HRESULT hr = E_NOTIMPL;
- if (m_pMVREPS) {
+ if (CComQIPtr<IMadVRExternalPixelShaders> pEPS = m_pDXR) {
if (!pSrcData && !pTarget) {
- hr = m_pMVREPS->ClearPixelShaders(bScreenSpace ? ShaderStage_PostScale : ShaderStage_PreScale);
+ hr = pEPS->ClearPixelShaders(bScreenSpace ? ShaderStage_PostScale : ShaderStage_PreScale);
} else {
- hr = m_pMVREPS->AddPixelShader(pSrcData, pTarget, bScreenSpace ? ShaderStage_PostScale : ShaderStage_PreScale, nullptr);
+ hr = pEPS->AddPixelShader(pSrcData, pTarget, bScreenSpace ? ShaderStage_PostScale : ShaderStage_PreScale, nullptr);
}
}
return hr;
diff --git a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
index c02cb61cb..dc821f813 100644
--- a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
+++ b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
@@ -74,13 +74,6 @@ namespace DSObjects
CComPtr<IUnknown> m_pDXR;
CComPtr<ISubRenderCallback2> m_pSRCB;
- CComQIPtr<IBasicVideo2> m_pBV2;
- CComQIPtr<IBasicVideo> m_pBV;
- CComQIPtr<IMadVRCommand> m_pMVRC;
- CComQIPtr<IMadVRExternalPixelShaders> m_pMVREPS;
- CComQIPtr<IMadVRInfo> m_pMVRI;
- CComQIPtr<IVideoWindow> m_pVW;
-
CSize m_ScreenSize;
bool m_bIsFullscreen;
@@ -107,9 +100,11 @@ namespace DSObjects
// ISubPicAllocatorPresenter2
STDMETHODIMP_(bool) IsRendering() {
- int playbackState;
- if (SUCCEEDED(m_pMVRI->GetInt("playbackState", &playbackState))) {
- return playbackState == State_Running;
+ if (CComQIPtr<IMadVRInfo> pMVRI = m_pDXR) {
+ int playbackState;
+ if (SUCCEEDED(pMVRI->GetInt("playbackState", &playbackState))) {
+ return playbackState == State_Running;
+ }
}
return false;
}