Increase ParseScript cache from 30 to 90 seconds
[xy_vsfilter.git] / src / subpic / SubPicAllocatorPresenterImpl.h
blobf2e788e6e5d822bf6fef2c7476b6ed53597e7aa1
1 /*
2 * $Id: SubPicAllocatorPresenterImpl.h 3618 2011-08-08 22:22:25Z underground78 $
4 * (C) 2003-2006 Gabest
5 * (C) 2006-2011 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 #pragma once
26 #include <atlbase.h>
27 #include <atlcoll.h>
28 #include "ISubPic.h"
29 #include "CoordGeom.h"
31 class CSubPicAllocatorPresenterImpl
32 : public CUnknown
33 , public CCritSec
34 , public ISubPicAllocatorPresenter2
36 protected:
37 HWND m_hWnd;
38 CSize m_spMaxSize; // TODO:
39 int m_spMaxQueued; // TODO:
40 REFERENCE_TIME m_rtSubtitleDelay;
42 CSize m_NativeVideoSize, m_AspectRatio;
43 CRect m_VideoRect, m_WindowRect;
45 REFERENCE_TIME m_rtNow;
46 double m_fps;
48 CComPtr<ISubPicProvider> m_SubPicProvider;
49 CComPtr<ISubPicAllocator> m_pAllocator;
50 CComPtr<ISubPicQueue> m_pSubPicQueue;
52 bool m_bDeviceResetRequested;
53 bool m_bPendingResetDevice;
54 void AlphaBltSubPic(CSize size, SubPicDesc* pTarget = NULL);
56 XForm m_xform;
57 void Transform(CRect r, Vector v[4]);
59 public:
60 CSubPicAllocatorPresenterImpl(HWND hWnd, HRESULT& hr, CString *_pError);
61 virtual ~CSubPicAllocatorPresenterImpl();
63 DECLARE_IUNKNOWN;
64 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
66 // ISubPicAllocatorPresenter
68 STDMETHODIMP CreateRenderer(IUnknown** ppRenderer) = 0;
70 STDMETHODIMP_(SIZE) GetVideoSize(bool fCorrectAR = true);
71 STDMETHODIMP_(SIZE) GetVisibleVideoSize() {
72 return m_NativeVideoSize;
74 STDMETHODIMP_(void) SetPosition(RECT w, RECT v);
75 STDMETHODIMP_(bool) Paint(bool fAll) = 0;
77 STDMETHODIMP_(void) SetTime(REFERENCE_TIME rtNow);
78 STDMETHODIMP_(void) SetSubtitleDelay(int delay_ms);
79 STDMETHODIMP_(int) GetSubtitleDelay();
80 STDMETHODIMP_(double) GetFPS();
82 STDMETHODIMP_(void) SetSubPicProvider(ISubPicProvider* pSubPicProvider);
83 STDMETHODIMP_(void) Invalidate(REFERENCE_TIME rtInvalidate = -1);
85 STDMETHODIMP GetDIB(BYTE* lpDib, DWORD* size) {
86 return E_NOTIMPL;
89 STDMETHODIMP_(bool) ResetDevice() {
90 return false;
92 STDMETHODIMP_(bool) DisplayChange() {
93 return false;
95 STDMETHODIMP SetVideoAngle(Vector v, bool fRepaint = true);
96 STDMETHODIMP SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget) {
97 return E_NOTIMPL;
99 STDMETHODIMP SetPixelShader2(LPCSTR pSrcData, LPCSTR pTarget, bool bScreenSpace) {
100 if (!bScreenSpace) {
101 return SetPixelShader(pSrcData, pTarget);
103 return E_NOTIMPL;