Merge branch 'bug_fix' into mru
[xy_vsfilter.git] / src / subpic / DX9SubPic.h
blob95f30055b54cb518343237e652945ba2113de5cf
1 /*
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)
8 * any later version.
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
22 #pragma once
24 #include "ISubPic.h"
26 // CDX9SubPic
28 class CDX9SubPic : public ISubPicImpl
30 CComPtr<IDirect3DSurface9> m_pSurface;
32 protected:
33 STDMETHODIMP_(void*) GetObject() const; // returns IDirect3DTexture9*
35 public:
36 CDX9SubPic(IDirect3DSurface9* pSurface);
38 // ISubPic
39 STDMETHODIMP GetDesc(SubPicDesc& spd) const;
40 STDMETHODIMP CopyTo(ISubPic* pSubPic);
41 STDMETHODIMP ClearDirtyRect(DWORD color);
42 STDMETHODIMP Lock(SubPicDesc& spd);
43 STDMETHODIMP Unlock(CAtlList<CRect>* dirtyRectList);
44 STDMETHODIMP SetDirtyRect(CAtlList<CRect>* dirtyRectList);
45 STDMETHODIMP AlphaBlt(const RECT* pSrc, const RECT* pDst, SubPicDesc* pTarget);
48 // CDX9SubPicAllocator
50 class CDX9SubPicAllocator : public ISubPicAllocatorImpl, public CCritSec
52 CComPtr<IDirect3DDevice9> m_pD3DDev;
53 CSize m_maxsize;
55 bool Alloc(bool fStatic, ISubPic** ppSubPic);
57 public:
58 CDX9SubPicAllocator(IDirect3DDevice9* pD3DDev, SIZE maxsize, bool fPow2Textures);
60 // ISubPicAllocator
61 STDMETHODIMP ChangeDevice(IUnknown* pDev);
64 [uuid("CD6D2AA5-20D3-4ebe-A8A9-34D3B00CC253")]
65 interface ISubRenderCallback : public IUnknown
67 // NULL means release current device, textures and other resources
68 STDMETHOD(SetDevice)(IDirect3DDevice9 *dev) = 0;
70 // destination video rectangle, will be inside (0, 0)-(width, height)
71 // width,height is the size of the entire output window
72 STDMETHOD(Render)(REFERENCE_TIME rtStart,
73 int left, int top, int bottom, int right,
74 int width, int height) = 0;
77 [uuid("E602585E-C05A-4828-AC69-AF92997F2E0C")]
78 interface ISubRenderCallback2 : public ISubRenderCallback
80 STDMETHOD(RenderEx)(REFERENCE_TIME rtStart, REFERENCE_TIME rtStop,
81 REFERENCE_TIME AvgTimePerFrame,
82 int left, int top, int right, int bottom,
83 int width, int height) = 0;
86 [uuid("9CC7F9F7-3ED1-493c-AF65-527EA1D9947F")]
87 interface ISubRender : public IUnknown
89 STDMETHOD(SetCallback)(ISubRenderCallback *cb) = 0;