Increase ParseScript cache from 30 to 90 seconds
[xy_vsfilter.git] / src / subpic / SubPicProviderImpl.cpp
blob65bd76a3b75f3bc57865c4f303b760729c1d8035
1 /*
2 * $Id: SubPicProviderImpl.cpp 2585 2010-09-18 12:39:20Z xhmikosr $
4 * (C) 2003-2006 Gabest
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)
10 * any later version.
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
24 #include "stdafx.h"
25 #include "SubPicProviderImpl.h"
26 #include "../DSUtil/DSUtil.h"
29 // CSubPicProviderImpl
32 CSubPicProviderImpl::CSubPicProviderImpl(CCritSec* pLock)
33 : CUnknown(NAME("CSubPicProviderImpl"), NULL)
34 , m_pLock(pLock)
38 CSubPicProviderImpl::~CSubPicProviderImpl()
42 STDMETHODIMP CSubPicProviderImpl::NonDelegatingQueryInterface(REFIID riid, void** ppv)
44 return
45 QI(ISubPicProvider)
46 QI(ISubPicProviderEx)
47 __super::NonDelegatingQueryInterface(riid, ppv);
50 // ISubPicProvider
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;
62 // ISubPicProviderEx
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);
74 if(SUCCEEDED(hr))
75 rectList.AddTail(cRect);
76 return hr;
79 STDMETHODIMP_(bool) CSubPicProviderImpl::IsColorTypeSupported( int type )
81 return type==MSP_RGBA;