Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Revert "Merge remote-tracking branch 'local/shader_media_status' into…
Browse files Browse the repository at this point in the history
… shader_media_presenter"

This reverts commit 2e10a2f, reversing
changes made to 38c98cd.
  • Loading branch information
on-situ-repos committed Mar 4, 2016
1 parent 2e10a2f commit 9d4af7d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 94 deletions.
19 changes: 0 additions & 19 deletions src/SubPic/ISubPic.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,25 +209,6 @@ public ISubPicAllocatorPresenter {
STDMETHOD(SetIsRendering)(bool bIsRendering) PURE;
};

//
// IMediaStatusPresenter
//
interface __declspec(uuid("AB8FC39A-FBA7-4A36-B265-8A3592581870"))
IMediaStatusPresenter :
public IUnknown {
STDMETHOD(GetMediaTimes)(LONGLONG* pPosition, LONGLONG* pDuration) const PURE;
};

//
// ISubPicMediaPresenter
//
interface __declspec(uuid("EAC6251D-471B-498D-9E33-750761D69FAA"))
ISubPicMediaPresenter :
public IUnknown {
STDMETHOD(GetMediaStatusPresenter)(IMediaStatusPresenter** pObj) PURE;
STDMETHOD(SetMediaStatusPresenter)(IMediaStatusPresenter* pObj) PURE;
};

//
// ISubStream
//
Expand Down
1 change: 0 additions & 1 deletion src/SubPic/SubPicAllocatorPresenterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ STDMETHODIMP CSubPicAllocatorPresenterImpl::NonDelegatingQueryInterface(REFIID r
return
QI(ISubPicAllocatorPresenter)
QI(ISubPicAllocatorPresenter2)
QI(ISubPicMediaPresenter)
QI(ISubRenderOptions)
QI(ISubRenderConsumer)
QI(ISubRenderConsumer2)
Expand Down
15 changes: 0 additions & 15 deletions src/SubPic/SubPicAllocatorPresenterImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class CSubPicAllocatorPresenterImpl
, public CCritSec
, public ISubPicAllocatorPresenter2
, public ISubRenderConsumer2
, public ISubPicMediaPresenter
{
private:
CCritSec m_csSubPicProvider;
Expand Down Expand Up @@ -61,8 +60,6 @@ class CSubPicAllocatorPresenterImpl
bool m_bDeviceResetRequested;
bool m_bPendingResetDevice;

CComPtr<IMediaStatusPresenter> pMediaStatus;

enum SubtitleTextureLimit {
STATIC, VIDEO, DESKTOP
};
Expand Down Expand Up @@ -155,16 +152,4 @@ class CSubPicAllocatorPresenterImpl
// ISubRenderConsumer2

STDMETHODIMP Clear(REFERENCE_TIME clearNewerThan = 0);

// IPresenterMediaAccessor

STDMETHODIMP GetMediaStatusPresenter(IMediaStatusPresenter** pObj) {
*pObj = pMediaStatus;
return S_OK;
}

STDMETHODIMP SetMediaStatusPresenter(IMediaStatusPresenter* pObj) {
pMediaStatus = pObj;
return S_OK;
}
};
26 changes: 5 additions & 21 deletions src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,28 +390,20 @@ HRESULT CDX9RenderingEngine::RenderVideoDrawPath(IDirect3DSurface9* pRenderTarge
start = stop; // reset after 10 min (ps float has its limits in both range and accuracy)
}

LONGLONG lCurrentPosition = 0;
LONGLONG lDuration = 0;
CComPtr<IMediaStatusPresenter> pInfos;
if (SUCCEEDED(GetMediaStatusPresenter(&pInfos))) {
pInfos->GetMediaTimes(&lCurrentPosition, &lDuration);
}
const float clTickToSeconds = 1.0f / 10000000.0f;

#if 1
D3DSURFACE_DESC desc;
m_pVideoTexture[m_nCurSurface]->GetLevelDesc(0, &desc);

float fConstData[][4] = {
{ (float)desc.Width, (float)desc.Height, (float)(counter++), (float)diff / CLOCKS_PER_SEC },
{ 1.0f / desc.Width, 1.0f / desc.Height, clTickToSeconds* (float)lCurrentPosition, clTickToSeconds* (float)lDuration },
{(float)desc.Width, (float)desc.Height, (float)(counter++), (float)diff / CLOCKS_PER_SEC},
{1.0f / desc.Width, 1.0f / desc.Height, 0, 0},
};
#else
CSize VideoSize = GetVisibleVideoSize();
float fConstData[][4] = {
{ (float)VideoSize.cx, (float)VideoSize.cy, (float)(counter++), (float)diff / CLOCKS_PER_SEC },
{ 1.0f / VideoSize.cx, 1.0f / VideoSize.cy, clTickToSeconds* (float)lCurrentPosition, clTickToSeconds* (float)lDuration },
{(float)VideoSize.cx, (float)VideoSize.cy, (float)(counter++), (float)diff / CLOCKS_PER_SEC},
{1.0f / VideoSize.cx, 1.0f / VideoSize.cy, 0, 0},
};
#endif

Expand Down Expand Up @@ -485,17 +477,9 @@ HRESULT CDX9RenderingEngine::RenderVideoDrawPath(IDirect3DSurface9* pRenderTarge
start = stop; // reset after 10 min (ps float has its limits in both range and accuracy)
}

LONGLONG lCurrentPosition = 0;
LONGLONG lDuration = 0;
CComPtr<IMediaStatusPresenter> pInfos;
if (SUCCEEDED(GetMediaStatusPresenter(&pInfos))) {
pInfos->GetMediaTimes(&lCurrentPosition, &lDuration);
}
const float clTickToSeconds = 1.0f / 10000000.0f;

float fConstData[][4] = {
{(float)m_TemporaryScreenSpaceTextureSize.cx, (float)m_TemporaryScreenSpaceTextureSize.cy, (float)(counter++), (float)diff / CLOCKS_PER_SEC},
{ 1.0f / m_TemporaryScreenSpaceTextureSize.cx, 1.0f / m_TemporaryScreenSpaceTextureSize.cy, clTickToSeconds* (float)lCurrentPosition, clTickToSeconds* (float)lDuration },
{1.0f / m_TemporaryScreenSpaceTextureSize.cx, 1.0f / m_TemporaryScreenSpaceTextureSize.cy, 0, 0},
};

hr = m_pD3DDev->SetPixelShaderConstantF(0, (float*)fConstData, _countof(fConstData));
Expand Down
26 changes: 0 additions & 26 deletions src/mpc-hc/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,6 @@ CMainFrame::CMainFrame()
, m_dLastVideoScaleFactor(0)
, m_bExtOnTop(false)
, m_bIsBDPlay(false)
, m_lastDuration(-1)
, m_lastNow(-1)
{
// Don't let CFrameWnd handle automatically the state of the menu items.
// This means that menu items without handlers won't be automatically
Expand Down Expand Up @@ -1839,9 +1837,6 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent)
m_Lcd.SetMediaRange(0, rtDur);
m_Lcd.SetMediaPos(rtNow);

m_lastDuration = rtDur;
m_lastNow = rtNow;

if (m_pCAP) {
if (g_bExternalSubtitleTime) {
m_pCAP->SetTime(rtNow);
Expand Down Expand Up @@ -11709,19 +11704,6 @@ int CMainFrame::SetupSubtitleStreams()
return selected;
}

// IMediaStatusPresenter
HRESULT CMainFrame::GetMediaTimes(LONGLONG* pPosition, LONGLONG* pDuration) const
{
if (m_pMS == nullptr) {
return E_FAIL;
}

*pPosition = m_lastNow;
*pDuration = m_lastDuration;

return S_OK;
}

bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD)
{
ASSERT(GetLoadState() == MLS::LOADING);
Expand Down Expand Up @@ -11799,14 +11781,6 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD)
m_pMVRSR = m_pCAP;
pMVTO = m_pCAP;

if (m_pCAP2 != nullptr) {
CComPtr<ISubPicMediaPresenter> pMediaSeeking;
HRESULT hr2 = m_pCAP2.QueryInterface<ISubPicMediaPresenter>(&pMediaSeeking);
if (SUCCEEDED(hr2)) {
pMediaSeeking->SetMediaStatusPresenter(this);
}
}

if (s.fShowOSD || s.fShowDebugInfo) { // Force OSD on when the debug switch is used
if (pVMB) {
m_OSD.Start(m_pVideoWnd, pVMB, IsD3DFullScreenMode());
Expand Down
13 changes: 1 addition & 12 deletions src/mpc-hc/MainFrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ interface IMadVRSubclassReplacement;
interface IMadVRInfo;
interface ISubClock;

class CMainFrame : public CFrameWnd, public CDropClient, public IMediaStatusPresenter
class CMainFrame : public CFrameWnd, public CDropClient
{
public:

Expand Down Expand Up @@ -407,10 +407,6 @@ class CMainFrame : public CFrameWnd, public CDropClient, public IMediaStatusPres
void OnDropFiles(CAtlList<CString>& slFiles, DROPEFFECT dropEffect) override;
DROPEFFECT OnDropAccept(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) override;

// IMediaStatusPresenter
REFERENCE_TIME m_lastDuration;
REFERENCE_TIME m_lastNow;

public:
void StartWebServer(int nPort);
void StopWebServer();
Expand All @@ -421,13 +417,6 @@ class CMainFrame : public CFrameWnd, public CDropClient, public IMediaStatusPres
bool IsMuted() { return m_wndToolBar.GetVolume() == -10000; }
int GetVolume() { return m_wndToolBar.m_volctrl.GetPos(); }

// IMediaStatusPresenter
STDMETHODIMP GetMediaTimes(LONGLONG* pPosition, LONGLONG* pDuration) const;

HRESULT STDMETHODCALLTYPE QueryInterface(const IID&, void**) { return E_FAIL; }
ULONG STDMETHODCALLTYPE AddRef() { return 1; }
ULONG STDMETHODCALLTYPE Release() { return 1; }

public:
CMainFrame();
DECLARE_DYNAMIC(CMainFrame)
Expand Down

0 comments on commit 9d4af7d

Please sign in to comment.