Support unrar64.dll
[xy_vsfilter.git] / src / subpic / SubPicProviderExWrapper.cpp
blob1da5dead02b9403beb7db98f2d63c67f54cda030
1 /************************************************************************/
2 /* author: xy */
3 /* date: 20111013 */
4 /************************************************************************/
6 #include "stdafx.h"
7 #include "SubPicProviderExWrapper.h"
8 #include "../DSUtil/DSUtil.h"
10 CSubPicProviderExWrapper* CSubPicProviderExWrapper::GetSubPicProviderExWrapper(ISubPicProvider* const inner_provider)
12 return new CSubPicProviderExWrapper(inner_provider);
15 CSubPicProviderExWrapper::CSubPicProviderExWrapper(ISubPicProvider* const inner_provider)
16 : CUnknown(NAME("CSubPicProviderExWrapper"), NULL),
17 _inner_provider(inner_provider)
21 CSubPicProviderExWrapper::~CSubPicProviderExWrapper()
26 // ISubPicProvider
28 STDMETHODIMP CSubPicProviderExWrapper::NonDelegatingQueryInterface( REFIID riid, void** ppv )
30 return
31 QI(ISubPicProvider)
32 QI(ISubPicProviderEx)
33 __super::NonDelegatingQueryInterface(riid, ppv);
36 STDMETHODIMP CSubPicProviderExWrapper::Lock()
38 return _inner_provider->Lock();
41 STDMETHODIMP CSubPicProviderExWrapper::Unlock()
43 return _inner_provider->Unlock();
46 STDMETHODIMP_(POSITION) CSubPicProviderExWrapper::GetStartPosition( REFERENCE_TIME rt, double fps )
48 return _inner_provider->GetStartPosition(rt, fps);
51 STDMETHODIMP_(POSITION) CSubPicProviderExWrapper::GetNext( POSITION pos )
53 return _inner_provider->GetNext(pos);
56 STDMETHODIMP_(REFERENCE_TIME) CSubPicProviderExWrapper::GetStart( POSITION pos, double fps )
58 return _inner_provider->GetStart(pos, fps);
61 STDMETHODIMP_(REFERENCE_TIME) CSubPicProviderExWrapper::GetStop( POSITION pos, double fps )
63 return _inner_provider->GetStop(pos, fps);
66 STDMETHODIMP_(bool) CSubPicProviderExWrapper::IsAnimated( POSITION pos )
68 return _inner_provider->IsAnimated(pos);
71 STDMETHODIMP CSubPicProviderExWrapper::Render( SubPicDesc& spd, REFERENCE_TIME rt, double fps, RECT& bbox )
73 return _inner_provider->Render( spd, rt, fps, bbox );
76 STDMETHODIMP CSubPicProviderExWrapper::GetTextureSize( POSITION pos, SIZE& MaxTextureSize, SIZE& VirtualSize, POINT& VirtualTopLeft )
78 return _inner_provider->GetTextureSize( pos, MaxTextureSize, VirtualSize, VirtualTopLeft );
81 // ISubPicProviderEx
83 STDMETHODIMP_(VOID) CSubPicProviderExWrapper::GetStartStop( POSITION pos, double fps, /*out*/REFERENCE_TIME& start, /*out*/REFERENCE_TIME& stop )
85 start = _inner_provider->GetStart(pos, fps);
86 stop = _inner_provider->GetStop(pos, fps);
89 STDMETHODIMP CSubPicProviderExWrapper::RenderEx( SubPicDesc& spd, REFERENCE_TIME rt, double fps, CAtlList<CRect>& rectList )
91 CRect cRect = new CRect(0,0,0,0);
92 HRESULT hr = Render(spd, rt, fps, cRect);
93 if(SUCCEEDED(hr))
94 rectList.AddTail(cRect);
95 return hr;
98 STDMETHODIMP_(bool) CSubPicProviderExWrapper::IsColorTypeSupported( int type )
100 return type==MSP_RGBA;
103 STDMETHODIMP_(int) CSubPicProviderExWrapper::SetOutputColorType( int type )
105 (type);
106 return MSP_RGBA;