Implement ResetDC and PHYSICALOFFSET[X|Y] devcaps.
[wine] / dlls / quartz / fgraph.h
1 /*
2  * Copyright (C) Hidenori TAKESHIMA
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef WINE_DSHOW_FGRAPH_H
20 #define WINE_DSHOW_FGRAPH_H
21
22 /*
23                 implements CLSID_FilterGraph.
24
25         - At least, the following interfaces should be implemented:
26
27         IUnknown
28                 + IPersist
29                 + IDispatch
30                 + IFilterGraph - IGraphBuilder - IFilterGraph2
31                 + IGraphVersion
32                 + IGraphConfig
33                 + IDispatch - IMediaControl
34                 + IPersist - IMediaFilter
35                 + IDispatch - IMediaEvent - IMediaEventEx
36                 + IMediaEventSink
37                 + IDispatch - IMediaPosition
38                 + IMediaSeeking
39                 + IDispatch - IBasicVideo (pass to a renderer)
40                 + IDispatch - IBasicAudio (pass to a renderer)
41                 + IDispatch - IVideoWindow  (pass to a renderer)
42         (following interfaces are not implemented)
43                 + IMarshal
44                 + IFilterMapper2
45                 FIXME - Are there any missing interfaces???
46  */
47
48 #include "iunk.h"
49 #include "complist.h"
50
51
52 typedef struct FG_IPersistImpl
53 {
54         ICOM_VFIELD(IPersist);
55 } FG_IPersistImpl;
56
57 typedef struct FG_IDispatchImpl
58 {
59         ICOM_VFIELD(IDispatch);
60 } FG_IDispatchImpl;
61
62 typedef struct FG_IFilterGraph2Impl
63 {
64         ICOM_VFIELD(IFilterGraph2);
65 } FG_IFilterGraph2Impl;
66
67 typedef struct FG_IGraphVersionImpl
68 {
69         ICOM_VFIELD(IGraphVersion);
70 } FG_IGraphVersionImpl;
71
72 typedef struct FG_IMediaControlImpl
73 {
74         ICOM_VFIELD(IMediaControl);
75 } FG_IMediaControlImpl;
76
77 typedef struct FG_IMediaFilterImpl
78 {
79         ICOM_VFIELD(IMediaFilter);
80 } FG_IMediaFilterImpl;
81
82 typedef struct FG_IMediaEventImpl
83 {
84         ICOM_VFIELD(IMediaEventEx);
85 } FG_IMediaEventImpl;
86
87 typedef struct FG_IMediaEventSinkImpl
88 {
89         ICOM_VFIELD(IMediaEventSink);
90 } FG_IMediaEventSinkImpl;
91
92 typedef struct FG_IMediaPositionImpl
93 {
94         ICOM_VFIELD(IMediaPosition);
95 } FG_IMediaPositionImpl;
96
97 typedef struct FG_IMediaSeekingImpl
98 {
99         ICOM_VFIELD(IMediaSeeking);
100 } FG_IMediaSeekingImpl;
101
102 typedef struct FG_IBasicVideoImpl
103 {
104         ICOM_VFIELD(IBasicVideo);
105 } FG_IBasicVideoImpl;
106
107 typedef struct FG_IBasicAudioImpl
108 {
109         ICOM_VFIELD(IBasicAudio);
110 } FG_IBasicAudioImpl;
111
112 typedef struct FG_IVideoWindowImpl
113 {
114         ICOM_VFIELD(IVideoWindow);
115 } FG_IVideoWindowImpl;
116
117
118 typedef struct FG_FilterData
119 {
120         IBaseFilter*    pFilter;
121         IMediaPosition* pPosition;
122         IMediaSeeking*  pSeeking;
123         WCHAR*  pwszName;
124         DWORD   cbName;
125 } FG_FilterData;
126
127 typedef struct FilterGraph_MEDIAEVENT   FilterGraph_MEDIAEVENT;
128
129 typedef struct CFilterGraph
130 {
131         QUARTZ_IUnkImpl unk;
132         FG_IPersistImpl persist;
133         FG_IDispatchImpl        disp;
134         FG_IFilterGraph2Impl    fgraph;
135         FG_IGraphVersionImpl    graphversion;
136         FG_IMediaControlImpl    mediacontrol;
137         FG_IMediaFilterImpl     mediafilter;
138         FG_IMediaEventImpl      mediaevent;
139         FG_IMediaEventSinkImpl  mediaeventsink;
140         FG_IMediaPositionImpl   mediaposition;
141         FG_IMediaSeekingImpl    mediaseeking;
142         FG_IBasicVideoImpl      basvid;
143         FG_IBasicAudioImpl      basaud;
144         FG_IVideoWindowImpl     vidwin;
145
146         /* IDispatch fields. */
147         /* IFilterGraph2 fields. */
148         CRITICAL_SECTION        m_csFilters;
149         DWORD   m_cActiveFilters;
150         FG_FilterData*          m_pActiveFilters;
151         /* IGraphVersion fields. */
152         LONG    m_lGraphVersion;
153         /* IMediaControl fields. */
154         /* IMediaFilter fields. */
155         CRITICAL_SECTION        m_csGraphState;
156         FILTER_STATE    m_stateGraph; /* must NOT accessed directly! */
157         CRITICAL_SECTION        m_csClock;
158         IReferenceClock*        m_pClock;
159         /* IMediaEvent fields. */
160         HANDLE  m_hMediaEvent;
161         CRITICAL_SECTION        m_csMediaEvents;
162         FilterGraph_MEDIAEVENT* m_pMediaEvents;
163         ULONG   m_cbMediaEventsPut;
164         ULONG   m_cbMediaEventsGet;
165         ULONG   m_cbMediaEventsMax;
166         HWND    m_hwndEventNotify;
167         long    m_lEventNotifyMsg;
168         LONG_PTR        m_lEventNotifyParam;
169         long    m_lEventNotifyFlags;
170         /* IMediaEventSink fields. */
171         /* IMediaPosition fields. */
172         /* IMediaSeeking fields. */
173         /* IBasicVideo fields. */
174         /* IBasicAudio fields. */
175         /* IVideoWindow fields. */
176 } CFilterGraph;
177
178 #define CFilterGraph_THIS(iface,member)         CFilterGraph*   This = ((CFilterGraph*)(((char*)iface)-offsetof(CFilterGraph,member)))
179 #define CFilterGraph_IPersist(th)               ((IPersist*)&((th)->persist))
180 #define CFilterGraph_IDispatch(th)              ((IDispatch*)&((th)->disp))
181 #define CFilterGraph_IFilterGraph2(th)          ((IFilterGraph2*)&((th)->fgraph))
182 #define CFilterGraph_IMediaControl(th)          ((IMediaControl*)&((th)->mediacontrol))
183 #define CFilterGraph_IMediaFilter(th)           ((IMediaFilter*)&((th)->mediafilter))
184 #define CFilterGraph_IMediaEventEx(th)          ((IMediaEventEx*)&((th)->mediaevent))
185 #define CFilterGraph_IMediaEventSink(th)                ((IMediaEventSink*)&((th)->mediaeventsink))
186
187 HRESULT QUARTZ_CreateFilterGraph(IUnknown* punkOuter,void** ppobj);
188
189 HRESULT CFilterGraph_InitIPersist( CFilterGraph* pfg );
190 void CFilterGraph_UninitIPersist( CFilterGraph* pfg );
191 HRESULT CFilterGraph_InitIDispatch( CFilterGraph* pfg );
192 void CFilterGraph_UninitIDispatch( CFilterGraph* pfg );
193 HRESULT CFilterGraph_InitIFilterGraph2( CFilterGraph* pfg );
194 void CFilterGraph_UninitIFilterGraph2( CFilterGraph* pfg );
195 HRESULT CFilterGraph_InitIGraphVersion( CFilterGraph* pfg );
196 void CFilterGraph_UninitIGraphVersion( CFilterGraph* pfg );
197 HRESULT CFilterGraph_InitIMediaControl( CFilterGraph* pfg );
198 void CFilterGraph_UninitIMediaControl( CFilterGraph* pfg );
199 HRESULT CFilterGraph_InitIMediaFilter( CFilterGraph* pfg );
200 void CFilterGraph_UninitIMediaFilter( CFilterGraph* pfg );
201 HRESULT CFilterGraph_InitIMediaEventEx( CFilterGraph* pfg );
202 void CFilterGraph_UninitIMediaEventEx( CFilterGraph* pfg );
203 HRESULT CFilterGraph_InitIMediaEventSink( CFilterGraph* pfg );
204 void CFilterGraph_UninitIMediaEventSink( CFilterGraph* pfg );
205 HRESULT CFilterGraph_InitIMediaPosition( CFilterGraph* pfg );
206 void CFilterGraph_UninitIMediaPosition( CFilterGraph* pfg );
207 HRESULT CFilterGraph_InitIMediaSeeking( CFilterGraph* pfg );
208 void CFilterGraph_UninitIMediaSeeking( CFilterGraph* pfg );
209 HRESULT CFilterGraph_InitIBasicVideo( CFilterGraph* pfg );
210 void CFilterGraph_UninitIBasicVideo( CFilterGraph* pfg );
211 HRESULT CFilterGraph_InitIBasicAudio( CFilterGraph* pfg );
212 void CFilterGraph_UninitIBasicAudio( CFilterGraph* pfg );
213 HRESULT CFilterGraph_InitIVideoWindow( CFilterGraph* pfg );
214 void CFilterGraph_UninitIVideoWindow( CFilterGraph* pfg );
215
216
217 #endif  /* WINE_DSHOW_FGRAPH_H */