2 * $Id: SubPicAllocatorPresenterImpl.h 3618 2011-08-08 22:22:25Z underground78 $
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)
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
29 #include "CoordGeom.h"
31 class CSubPicAllocatorPresenterImpl
34 , public ISubPicAllocatorPresenter2
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
;
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
);
57 void Transform(CRect r
, Vector v
[4]);
60 CSubPicAllocatorPresenterImpl(HWND hWnd
, HRESULT
& hr
, CString
*_pError
);
61 virtual ~CSubPicAllocatorPresenterImpl();
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
) {
89 STDMETHODIMP_(bool) ResetDevice() {
92 STDMETHODIMP_(bool) DisplayChange() {
95 STDMETHODIMP
SetVideoAngle(Vector v
, bool fRepaint
= true);
96 STDMETHODIMP
SetPixelShader(LPCSTR pSrcData
, LPCSTR pTarget
) {
99 STDMETHODIMP
SetPixelShader2(LPCSTR pSrcData
, LPCSTR pTarget
, bool bScreenSpace
) {
101 return SetPixelShader(pSrcData
, pTarget
);