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
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-07-24 01:51:13 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-07-24 01:51:13 +0400
commit8dc8d014e72a1ca617213b3e8740029411bcaca8 (patch)
tree26fe8210bf2fb3719a185367c6838dcf46c595bf /src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
parent32e9734535b82449b4630f3dca02d8817817ccd4 (diff)
applied astyle formatting in VideoRenderers files
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@2149 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp')
-rw-r--r--src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp319
1 files changed, 160 insertions, 159 deletions
diff --git a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
index 26132f970..4169317fb 100644
--- a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
@@ -31,9 +31,10 @@ using namespace DSObjects;
interface __declspec(uuid("51FA8F61-1444-4597-996E-7495405753E6"))
-IMadVRFullscreen : public IUnknown
+IMadVRFullscreen :
+public IUnknown
{
- STDMETHOD(ActivateFullscreenMode)(void) = 0;
+ STDMETHOD(ActivateFullscreenMode)(void) = 0;
};
//
@@ -41,141 +42,141 @@ IMadVRFullscreen : public IUnknown
//
CmadVRAllocatorPresenter::CmadVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRESULT& hr, CString &_Error)
- : CSubPicAllocatorPresenterImpl(hWnd, hr, &_Error)
- , m_ScreenSize(0, 0)
+ : CSubPicAllocatorPresenterImpl(hWnd, hr, &_Error)
+ , m_ScreenSize(0, 0)
, m_bIsFullscreen(bFullscreen)
{
- if(FAILED(hr))
- {
- _Error += L"ISubPicAllocatorPresenterImpl failed\n";
- return;
- }
+ if(FAILED(hr))
+ {
+ _Error += L"ISubPicAllocatorPresenterImpl failed\n";
+ return;
+ }
- hr = S_OK;
+ hr = S_OK;
}
CmadVRAllocatorPresenter::~CmadVRAllocatorPresenter()
{
- if(m_pSRCB)
- {
- // nasty, but we have to let it know about our death somehow
- ((CSubRenderCallback*)(ISubRenderCallback*)m_pSRCB)->SetDXRAP(NULL);
- }
-
- // the order is important here
- m_pSubPicQueue = NULL;
- m_pAllocator = NULL;
- m_pDXR = NULL;
+ if(m_pSRCB)
+ {
+ // nasty, but we have to let it know about our death somehow
+ ((CSubRenderCallback*)(ISubRenderCallback*)m_pSRCB)->SetDXRAP(NULL);
+ }
+
+ // the order is important here
+ m_pSubPicQueue = NULL;
+ m_pAllocator = NULL;
+ m_pDXR = NULL;
}
STDMETHODIMP CmadVRAllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- /*
- if(riid == __uuidof(IVideoWindow))
- return GetInterface((IVideoWindow*)this, ppv);
- if(riid == __uuidof(IBasicVideo))
- return GetInterface((IBasicVideo*)this, ppv);
- if(riid == __uuidof(IBasicVideo2))
- return GetInterface((IBasicVideo2*)this, ppv);
- */
- /*
- if(riid == __uuidof(IVMRWindowlessControl))
- return GetInterface((IVMRWindowlessControl*)this, ppv);
- */
-
- if(riid != IID_IUnknown && m_pDXR)
- {
- if(SUCCEEDED(m_pDXR->QueryInterface(riid, ppv)))
- return S_OK;
- }
-
- return __super::NonDelegatingQueryInterface(riid, ppv);
+ /*
+ if(riid == __uuidof(IVideoWindow))
+ return GetInterface((IVideoWindow*)this, ppv);
+ if(riid == __uuidof(IBasicVideo))
+ return GetInterface((IBasicVideo*)this, ppv);
+ if(riid == __uuidof(IBasicVideo2))
+ return GetInterface((IBasicVideo2*)this, ppv);
+ */
+ /*
+ if(riid == __uuidof(IVMRWindowlessControl))
+ return GetInterface((IVMRWindowlessControl*)this, ppv);
+ */
+
+ if(riid != IID_IUnknown && m_pDXR)
+ {
+ if(SUCCEEDED(m_pDXR->QueryInterface(riid, ppv)))
+ return S_OK;
+ }
+
+ return __super::NonDelegatingQueryInterface(riid, ppv);
}
HRESULT CmadVRAllocatorPresenter::SetDevice(IDirect3DDevice9* pD3DDev)
{
- CheckPointer(pD3DDev, E_POINTER);
-
- CSize size;
- switch(GetRenderersSettings().nSPCMaxRes)
- {
- case 0:
- default:
- size = m_ScreenSize;
- break;
- case 1:
- size.SetSize(1024, 768);
- break;
- case 2:
- size.SetSize(800, 600);
- break;
- case 3:
- size.SetSize(640, 480);
- break;
- case 4:
- size.SetSize(512, 384);
- break;
- case 5:
- size.SetSize(384, 288);
- break;
- case 6:
- size.SetSize(2560, 1600);
- break;
- case 7:
- size.SetSize(1920, 1080);
- break;
- case 8:
- size.SetSize(1320, 900);
- break;
- case 9:
- size.SetSize(1280, 720);
- break;
- }
-
- if(m_pAllocator)
- {
- m_pAllocator->ChangeDevice(pD3DDev);
- }
- else
- {
- m_pAllocator = DNew CDX9SubPicAllocator(pD3DDev, size, GetRenderersSettings().fSPCPow2Tex);
- if(!m_pAllocator)
- return E_FAIL;
- }
-
- HRESULT hr = S_OK;
-
- m_pSubPicQueue = GetRenderersSettings().nSPCSize > 0
- ? (ISubPicQueue*)DNew CSubPicQueue(GetRenderersSettings().nSPCSize, !GetRenderersSettings().fSPCAllowAnimationWhenBuffering, m_pAllocator, &hr)
- : (ISubPicQueue*)DNew CSubPicQueueNoThread(m_pAllocator, &hr);
- if(!m_pSubPicQueue || FAILED(hr))
- return E_FAIL;
-
- if(m_SubPicProvider) m_pSubPicQueue->SetSubPicProvider(m_SubPicProvider);
-
- return S_OK;
+ CheckPointer(pD3DDev, E_POINTER);
+
+ CSize size;
+ switch(GetRenderersSettings().nSPCMaxRes)
+ {
+ case 0:
+ default:
+ size = m_ScreenSize;
+ break;
+ case 1:
+ size.SetSize(1024, 768);
+ break;
+ case 2:
+ size.SetSize(800, 600);
+ break;
+ case 3:
+ size.SetSize(640, 480);
+ break;
+ case 4:
+ size.SetSize(512, 384);
+ break;
+ case 5:
+ size.SetSize(384, 288);
+ break;
+ case 6:
+ size.SetSize(2560, 1600);
+ break;
+ case 7:
+ size.SetSize(1920, 1080);
+ break;
+ case 8:
+ size.SetSize(1320, 900);
+ break;
+ case 9:
+ size.SetSize(1280, 720);
+ break;
+ }
+
+ if(m_pAllocator)
+ {
+ m_pAllocator->ChangeDevice(pD3DDev);
+ }
+ else
+ {
+ m_pAllocator = DNew CDX9SubPicAllocator(pD3DDev, size, GetRenderersSettings().fSPCPow2Tex);
+ if(!m_pAllocator)
+ return E_FAIL;
+ }
+
+ HRESULT hr = S_OK;
+
+ m_pSubPicQueue = GetRenderersSettings().nSPCSize > 0
+ ? (ISubPicQueue*)DNew CSubPicQueue(GetRenderersSettings().nSPCSize, !GetRenderersSettings().fSPCAllowAnimationWhenBuffering, m_pAllocator, &hr)
+ : (ISubPicQueue*)DNew CSubPicQueueNoThread(m_pAllocator, &hr);
+ if(!m_pSubPicQueue || FAILED(hr))
+ return E_FAIL;
+
+ if(m_SubPicProvider) m_pSubPicQueue->SetSubPicProvider(m_SubPicProvider);
+
+ return S_OK;
}
HRESULT CmadVRAllocatorPresenter::Render(
- REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, REFERENCE_TIME atpf,
- int left, int top, int right, int bottom, int width, int height)
+ REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, REFERENCE_TIME atpf,
+ int left, int top, int right, int bottom, int width, int height)
{
- __super::SetPosition(CRect(0, 0, width, height), CRect(left, top, right, bottom)); // needed? should be already set by the player
- SetTime(rtStart);
- if(atpf > 0 && m_pSubPicQueue) m_pSubPicQueue->SetFPS(10000000.0 / atpf);
- AlphaBltSubPic(CSize(width, height));
- return S_OK;
+ __super::SetPosition(CRect(0, 0, width, height), CRect(left, top, right, bottom)); // needed? should be already set by the player
+ SetTime(rtStart);
+ if(atpf > 0 && m_pSubPicQueue) m_pSubPicQueue->SetFPS(10000000.0 / atpf);
+ AlphaBltSubPic(CSize(width, height));
+ return S_OK;
}
// ISubPicAllocatorPresenter
STDMETHODIMP CmadVRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
{
- CheckPointer(ppRenderer, E_POINTER);
+ CheckPointer(ppRenderer, E_POINTER);
- if(m_pDXR) return E_UNEXPECTED;
- m_pDXR.CoCreateInstance(CLSID_madVR, GetOwner());
- if(!m_pDXR) return E_FAIL;
+ if(m_pDXR) return E_UNEXPECTED;
+ m_pDXR.CoCreateInstance(CLSID_madVR, GetOwner());
+ if(!m_pDXR) return E_FAIL;
if (m_bIsFullscreen)
{
@@ -184,76 +185,76 @@ STDMETHODIMP CmadVRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
pVRF->ActivateFullscreenMode();
}
- CComQIPtr<ISubRender> pSR = m_pDXR;
- if(!pSR)
- {
- m_pDXR = NULL;
- return E_FAIL;
- }
+ CComQIPtr<ISubRender> pSR = m_pDXR;
+ if(!pSR)
+ {
+ m_pDXR = NULL;
+ return E_FAIL;
+ }
- m_pSRCB = DNew CSubRenderCallback(this);
- if(FAILED(pSR->SetCallback(m_pSRCB)))
- {
- m_pDXR = NULL;
- return E_FAIL;
- }
+ m_pSRCB = DNew CSubRenderCallback(this);
+ if(FAILED(pSR->SetCallback(m_pSRCB)))
+ {
+ m_pDXR = NULL;
+ return E_FAIL;
+ }
- (*ppRenderer = this)->AddRef();
+ (*ppRenderer = this)->AddRef();
- MONITORINFO mi;
- mi.cbSize = sizeof(MONITORINFO);
- if (GetMonitorInfo(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi))
- m_ScreenSize.SetSize(mi.rcMonitor.right-mi.rcMonitor.left, mi.rcMonitor.bottom-mi.rcMonitor.top);
+ MONITORINFO mi;
+ mi.cbSize = sizeof(MONITORINFO);
+ if (GetMonitorInfo(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi))
+ m_ScreenSize.SetSize(mi.rcMonitor.right-mi.rcMonitor.left, mi.rcMonitor.bottom-mi.rcMonitor.top);
- return S_OK;
+ return S_OK;
}
STDMETHODIMP_(void) CmadVRAllocatorPresenter::SetPosition(RECT w, RECT v)
{
- if(CComQIPtr<IBasicVideo> pBV = m_pDXR)
- {
- pBV->SetDefaultSourcePosition();
- pBV->SetDestinationPosition(v.left, v.top, v.right - v.left, v.bottom - v.top);
- }
-
- if(CComQIPtr<IVideoWindow> pVW = m_pDXR)
- {
- pVW->SetWindowPosition(w.left, w.top, w.right - w.left, w.bottom - w.top);
- }
+ if(CComQIPtr<IBasicVideo> pBV = m_pDXR)
+ {
+ pBV->SetDefaultSourcePosition();
+ pBV->SetDestinationPosition(v.left, v.top, v.right - v.left, v.bottom - v.top);
+ }
+
+ if(CComQIPtr<IVideoWindow> pVW = m_pDXR)
+ {
+ pVW->SetWindowPosition(w.left, w.top, w.right - w.left, w.bottom - w.top);
+ }
}
STDMETHODIMP_(SIZE) CmadVRAllocatorPresenter::GetVideoSize(bool fCorrectAR)
{
- SIZE size = {0, 0};
-
- if(!fCorrectAR)
- {
- if(CComQIPtr<IBasicVideo> pBV = m_pDXR)
- pBV->GetVideoSize(&size.cx, &size.cy);
- }
- else
- {
- if(CComQIPtr<IBasicVideo2> pBV2 = m_pDXR)
- pBV2->GetPreferredAspectRatio(&size.cx, &size.cy);
- }
-
- return size;
+ SIZE size = {0, 0};
+
+ if(!fCorrectAR)
+ {
+ if(CComQIPtr<IBasicVideo> pBV = m_pDXR)
+ pBV->GetVideoSize(&size.cx, &size.cy);
+ }
+ else
+ {
+ if(CComQIPtr<IBasicVideo2> pBV2 = m_pDXR)
+ pBV2->GetPreferredAspectRatio(&size.cx, &size.cy);
+ }
+
+ return size;
}
STDMETHODIMP_(bool) CmadVRAllocatorPresenter::Paint(bool fAll)
{
- return false; // TODO
+ return false; // TODO
}
STDMETHODIMP CmadVRAllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
{
- HRESULT hr = E_NOTIMPL;
- if(CComQIPtr<IBasicVideo> pBV = m_pDXR)
- hr = pBV->GetCurrentImage((long*)size, (long*)lpDib);
- return hr;
+ HRESULT hr = E_NOTIMPL;
+ if(CComQIPtr<IBasicVideo> pBV = m_pDXR)
+ hr = pBV->GetCurrentImage((long*)size, (long*)lpDib);
+ return hr;
}
STDMETHODIMP CmadVRAllocatorPresenter::SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget)
{
- return E_NOTIMPL; // TODO
+ return E_NOTIMPL; // TODO
}