2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
26 #include "CoordGeom.h"
38 MSP_AYUV_PLANAR
, //AYUV in planar form
49 int w
, h
, bpp
, pitch
, pitchUV
;
53 RECT vidrect
; // video rectangle
57 w
= h
= bpp
= pitch
= pitchUV
= 0;
68 interface
__declspec(uuid("449E11F3-52D1-4a27-AA61-E2733AC92CC0"))
71 STDMETHOD_(void*, GetObject
) () const PURE
;
73 STDMETHOD_(REFERENCE_TIME
, GetStart
) () const PURE
;
74 STDMETHOD_(REFERENCE_TIME
, GetStop
) () const PURE
;
75 STDMETHOD_(void, SetStart
) (REFERENCE_TIME rtStart
) PURE
;
76 STDMETHOD_(void, SetStop
) (REFERENCE_TIME rtStop
) PURE
;
78 STDMETHOD (GetDesc
) (SubPicDesc
& spd
/*[out]*/) const PURE
;
79 STDMETHOD (CopyTo
) (ISubPic
* pSubPic
/*[in]*/) PURE
;
81 STDMETHOD (ClearDirtyRect
) (DWORD color
/*[in]*/) PURE
;
82 STDMETHOD (GetDirtyRect
) (RECT
* pDirtyRect
/*[out]*/) const PURE
;
83 STDMETHOD (SetDirtyRect
) (RECT
* pDirtyRect
/*[in]*/) PURE
;
85 STDMETHOD (GetMaxSize
) (SIZE
* pMaxSize
/*[out]*/) const PURE
;
86 STDMETHOD (SetSize
) (SIZE pSize
/*[in]*/, RECT vidrect
/*[in]*/) PURE
;
88 STDMETHOD (Lock
) (SubPicDesc
& spd
/*[out]*/) PURE
;
89 STDMETHOD (Unlock
) (RECT
* pDirtyRect
/*[in]*/) PURE
;
91 STDMETHOD (AlphaBlt
) (const RECT
* pSrc
, const RECT
* pDst
, SubPicDesc
* pTarget
= NULL
/*[in]*/) PURE
;
92 STDMETHOD (GetSourceAndDest
) (SIZE
* pSize
/*[in]*/, RECT
* pRcSource
/*[out]*/, RECT
* pRcDest
/*[out]*/) PURE
;
93 STDMETHOD (SetVirtualTextureSize
) (const SIZE pSize
, const POINT pTopLeft
) PURE
;
95 STDMETHOD_(REFERENCE_TIME
, GetSegmentStart
) () PURE
;
96 STDMETHOD_(REFERENCE_TIME
, GetSegmentStop
) () PURE
;
97 STDMETHOD_(void, SetSegmentStart
) (REFERENCE_TIME rtStart
) PURE
;
98 STDMETHOD_(void, SetSegmentStop
) (REFERENCE_TIME rtStop
) PURE
;
101 interface
__declspec(uuid("728B3CDC-B0B2-4DA8-8426-AEDE9C90674E"))
104 STDMETHOD (CopyTo
) (ISubPicEx
* pSubPicEx
/*[in]*/) PURE
;
106 STDMETHOD (GetDirtyRects
) (CAtlList
<const CRect
>& dirtyRectList
/*[out]*/) const PURE
;
107 STDMETHOD (SetDirtyRectEx
) (CAtlList
<CRect
>* dirtyRectList
/*[in]*/) PURE
;
109 STDMETHOD (Unlock
) (CAtlList
<CRect
>* dirtyRectList
/*[in]*/) PURE
;
116 interface
__declspec(uuid("CF7C3C23-6392-4a42-9E72-0736CFF793CB"))
119 STDMETHOD (SetCurSize
) (SIZE size
/*[in]*/) PURE
;
120 STDMETHOD (SetCurVidRect
) (RECT curvidrect
) PURE
;
122 STDMETHOD (GetStatic
) (ISubPic
** ppSubPic
/*[out]*/) PURE
;
123 STDMETHOD (AllocDynamic
) (ISubPic
** ppSubPic
/*[out]*/) PURE
;
125 STDMETHOD_(bool, IsDynamicWriteOnly
) () PURE
;
127 STDMETHOD (ChangeDevice
) (IUnknown
* pDev
) PURE
;
128 STDMETHOD (SetMaxTextureSize
) (SIZE MaxTextureSize
) PURE
;
131 interface
__declspec(uuid("379DD04B-F132-475E-9901-AB02FF4351A7"))
133 public ISubPicAllocator
{
134 STDMETHOD_(bool, IsSpdColorTypeSupported
) (int type
) PURE
;
135 STDMETHOD_(int, SetSpdColorType
) (int color_type
) PURE
;
137 STDMETHOD (GetStaticEx
) (ISubPicEx
** ppSubPic
/*[out]*/) PURE
;
138 STDMETHOD (AllocDynamicEx
) (ISubPicEx
** ppSubPic
/*[out]*/) PURE
;
145 interface
__declspec(uuid("D62B9A1A-879A-42db-AB04-88AA8F243CFD"))
148 STDMETHOD (Lock
) () PURE
;
149 STDMETHOD (Unlock
) () PURE
;
151 STDMETHOD_(POSITION
, GetStartPosition
) (REFERENCE_TIME rt
, double fps
) PURE
;
152 STDMETHOD_(POSITION
, GetNext
) (POSITION pos
) PURE
;
154 STDMETHOD_(REFERENCE_TIME
, GetStart
) (POSITION pos
, double fps
) PURE
;
155 STDMETHOD_(REFERENCE_TIME
, GetStop
) (POSITION pos
, double fps
) PURE
;
157 STDMETHOD_(bool, IsAnimated
) (POSITION pos
) PURE
;
159 STDMETHOD (Render
) (SubPicDesc
& spd
, REFERENCE_TIME rt
, double fps
, RECT
& bbox
) PURE
;
160 STDMETHOD (GetTextureSize
) (POSITION pos
, SIZE
& MaxTextureSize
, SIZE
& VirtualSize
, POINT
& VirtualTopLeft
) PURE
;
163 interface
__declspec(uuid("F8B6C39E-4188-41E0-9CCF-79579C376A40"))
165 public ISubPicProvider
{
166 STDMETHOD_(VOID
, GetStartStop
) (POSITION pos
, double fps
, /*out*/REFERENCE_TIME
& start
, /*out*/REFERENCE_TIME
& stop
) PURE
;
167 STDMETHOD (RenderEx
) (SubPicDesc
& spd
, REFERENCE_TIME rt
, double fps
, CAtlList
<CRect
>& rectList
) PURE
;
169 STDMETHOD_(bool, IsColorTypeSupported
) (int type
) PURE
;
176 interface
__declspec(uuid("C8334466-CD1E-4ad1-9D2D-8EE8519BD180"))
179 STDMETHOD (SetSubPicProvider
) (ISubPicProvider
* pSubPicProvider
/*[in]*/) PURE
;
180 STDMETHOD (GetSubPicProvider
) (ISubPicProvider
** pSubPicProvider
/*[out]*/) PURE
;
182 STDMETHOD (SetFPS
) (double fps
/*[in]*/) PURE
;
183 STDMETHOD (SetTime
) (REFERENCE_TIME rtNow
/*[in]*/) PURE
;
185 STDMETHOD (Invalidate
) (REFERENCE_TIME rtInvalidate
= -1) PURE
;
186 STDMETHOD_(bool, LookupSubPic
) (REFERENCE_TIME rtNow
/*[in]*/, ISubPic
** ppSubPic
/*[out]*/) PURE
;
188 STDMETHOD (GetStats
) (int& nSubPics
, REFERENCE_TIME
& rtNow
, REFERENCE_TIME
& rtStart
, REFERENCE_TIME
& rtStop
/*[out]*/) PURE
;
189 STDMETHOD (GetStats
) (int nSubPic
/*[in]*/, REFERENCE_TIME
& rtStart
, REFERENCE_TIME
& rtStop
/*[out]*/) PURE
;
193 // ISubPicAllocatorPresenter
196 interface
__declspec(uuid("CF75B1F0-535C-4074-8869-B15F177F944E"))
197 ISubPicAllocatorPresenter
:
199 STDMETHOD (CreateRenderer
) (IUnknown
** ppRenderer
) PURE
;
201 STDMETHOD_(SIZE
, GetVideoSize
) (bool fCorrectAR
= true) PURE
;
202 STDMETHOD_(void, SetPosition
) (RECT w
, RECT v
) PURE
;
203 STDMETHOD_(bool, Paint
) (bool fAll
) PURE
;
205 STDMETHOD_(void, SetTime
) (REFERENCE_TIME rtNow
) PURE
;
206 STDMETHOD_(void, SetSubtitleDelay
) (int delay_ms
) PURE
;
207 STDMETHOD_(int, GetSubtitleDelay
) () PURE
;
208 STDMETHOD_(double, GetFPS
) () PURE
;
210 STDMETHOD_(void, SetSubPicProvider
) (ISubPicProvider
* pSubPicProvider
) PURE
;
211 STDMETHOD_(void, Invalidate
) (REFERENCE_TIME rtInvalidate
= -1) PURE
;
213 STDMETHOD (GetDIB
) (BYTE
* lpDib
, DWORD
* size
) PURE
;
215 STDMETHOD (SetVideoAngle
) (Vector v
, bool fRepaint
= true) PURE
;
216 STDMETHOD (SetPixelShader
) (LPCSTR pSrcData
, LPCSTR pTarget
) PURE
;
218 STDMETHOD_(bool, ResetDevice
) () PURE
;
220 STDMETHOD_(bool, DisplayChange
) () PURE
;
223 interface
__declspec(uuid("767AEBA8-A084-488a-89C8-F6B74E53A90F"))
224 ISubPicAllocatorPresenter2
:
225 public ISubPicAllocatorPresenter
{
226 STDMETHOD (SetPixelShader2
) (LPCSTR pSrcData
, LPCSTR pTarget
, bool bScreenSpace
) PURE
;
227 STDMETHOD_(SIZE
, GetVisibleVideoSize
) () PURE
;
235 interface
__declspec(uuid("DE11E2FB-02D3-45e4-A174-6B7CE2783BDB"))
238 STDMETHOD_(int, GetStreamCount
) () PURE
;
239 STDMETHOD (GetStreamInfo
) (int i
, WCHAR
** ppName
, LCID
* pLCID
) PURE
;
240 STDMETHOD_(int, GetStream
) () PURE
;
241 STDMETHOD (SetStream
) (int iStream
) PURE
;
242 STDMETHOD (Reload
) () PURE
;
244 // TODO: get rid of IPersist to identify type and use only
245 // interface functions to modify the settings of the substream