2 * $Id: SubPicProviderImpl.cpp 2585 2010-09-18 12:39:20Z xhmikosr $
5 * (C) 2006-2010 see AUTHORS
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Make; see the file COPYING. If not, write to
19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 * http://www.gnu.org/copyleft/gpl.html
25 #include "SubPicProviderImpl.h"
26 #include "../DSUtil/DSUtil.h"
29 // CSubPicProviderImpl
32 CSubPicProviderImpl::CSubPicProviderImpl(CCritSec
* pLock
)
33 : CUnknown(NAME("CSubPicProviderImpl"), NULL
)
38 CSubPicProviderImpl::~CSubPicProviderImpl()
42 STDMETHODIMP
CSubPicProviderImpl::NonDelegatingQueryInterface(REFIID riid
, void** ppv
)
47 __super::NonDelegatingQueryInterface(riid
, ppv
);
52 STDMETHODIMP
CSubPicProviderImpl::Lock()
54 return m_pLock
? m_pLock
->Lock(), S_OK
: E_FAIL
;
57 STDMETHODIMP
CSubPicProviderImpl::Unlock()
59 return m_pLock
? m_pLock
->Unlock(), S_OK
: E_FAIL
;
64 STDMETHODIMP_(VOID
) CSubPicProviderImpl::GetStartStop( POSITION pos
, double fps
, /*out*/REFERENCE_TIME
& start
, /*out*/REFERENCE_TIME
& stop
)
66 start
= GetStart(pos
, fps
);
67 stop
= GetStop(pos
, fps
);
70 STDMETHODIMP
CSubPicProviderImpl::RenderEx( SubPicDesc
& spd
, REFERENCE_TIME rt
, double fps
, CAtlList
<CRect
>& rectList
)
72 CRect cRect
= new CRect(0,0,0,0);
73 HRESULT hr
= Render(spd
, rt
, fps
, cRect
);
75 rectList
.AddTail(cRect
);
79 STDMETHODIMP_(bool) CSubPicProviderImpl::IsColorTypeSupported( int type
)
81 return type
==MSP_RGBA
;