1 /************************************************************************/
4 /************************************************************************/
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()
28 STDMETHODIMP
CSubPicProviderExWrapper::NonDelegatingQueryInterface( REFIID riid
, void** ppv
)
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
);
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
);
94 rectList
.AddTail(cRect
);
98 STDMETHODIMP_(bool) CSubPicProviderExWrapper::IsColorTypeSupported( int type
)
100 return type
==MSP_RGBA
;
103 STDMETHODIMP_(int) CSubPicProviderExWrapper::SetOutputColorType( int type
)