2 * Copyright (C) Hidenori TAKESHIMA
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.
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.
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
19 #ifndef WINE_DSHOW_FGRAPH_H
20 #define WINE_DSHOW_FGRAPH_H
23 implements CLSID_FilterGraph.
25 - At least, the following interfaces should be implemented:
30 + IFilterGraph - IGraphBuilder - IFilterGraph2
33 + IDispatch - IMediaControl
34 + IPersist - IMediaFilter
35 + IDispatch - IMediaEvent - IMediaEventEx
37 + IDispatch - IMediaPosition
39 + IDispatch - IBasicVideo[2] (pass to a renderer)
40 + IDispatch - IBasicAudio (pass to a renderer)
41 + IDispatch - IVideoWindow (pass to a renderer)
42 + IDispatch - IAMStats
43 (following interfaces are not implemented)
45 + IFilterMapper2 - IFilterMapper3
46 FIXME - Are there any missing interfaces???
53 typedef struct FG_IPersistImpl
55 ICOM_VFIELD(IPersist);
58 typedef struct FG_IDispatchImpl
60 ICOM_VFIELD(IDispatch);
63 typedef struct FG_IFilterGraph2Impl
65 ICOM_VFIELD(IFilterGraph2);
66 } FG_IFilterGraph2Impl;
68 typedef struct FG_IGraphVersionImpl
70 ICOM_VFIELD(IGraphVersion);
71 } FG_IGraphVersionImpl;
73 typedef struct FG_IGraphConfigImpl
75 ICOM_VFIELD(IGraphConfig);
76 } FG_IGraphConfigImpl;
78 typedef struct FG_IMediaControlImpl
80 ICOM_VFIELD(IMediaControl);
81 } FG_IMediaControlImpl;
83 typedef struct FG_IMediaFilterImpl
85 ICOM_VFIELD(IMediaFilter);
86 } FG_IMediaFilterImpl;
88 typedef struct FG_IMediaEventImpl
90 ICOM_VFIELD(IMediaEventEx);
93 typedef struct FG_IMediaEventSinkImpl
95 ICOM_VFIELD(IMediaEventSink);
96 } FG_IMediaEventSinkImpl;
98 typedef struct FG_IMediaPositionImpl
100 ICOM_VFIELD(IMediaPosition);
101 } FG_IMediaPositionImpl;
103 typedef struct FG_IMediaSeekingImpl
105 ICOM_VFIELD(IMediaSeeking);
106 } FG_IMediaSeekingImpl;
108 typedef struct FG_IBasicVideoImpl
110 ICOM_VFIELD(IBasicVideo2);
111 } FG_IBasicVideoImpl;
113 typedef struct FG_IBasicAudioImpl
115 ICOM_VFIELD(IBasicAudio);
116 } FG_IBasicAudioImpl;
118 typedef struct FG_IVideoWindowImpl
120 ICOM_VFIELD(IVideoWindow);
121 } FG_IVideoWindowImpl;
123 typedef struct FG_IAMStatsImpl
125 ICOM_VFIELD(IAMStats);
129 typedef struct FG_FilterData
131 IBaseFilter* pFilter;
132 IMediaPosition* pPosition;
133 IMediaSeeking* pSeeking;
138 typedef struct FilterGraph_MEDIAEVENT FilterGraph_MEDIAEVENT;
140 typedef struct CFilterGraph
143 FG_IPersistImpl persist;
144 FG_IDispatchImpl disp;
145 FG_IFilterGraph2Impl fgraph;
146 FG_IGraphVersionImpl graphversion;
147 FG_IGraphConfigImpl grphconf;
148 FG_IMediaControlImpl mediacontrol;
149 FG_IMediaFilterImpl mediafilter;
150 FG_IMediaEventImpl mediaevent;
151 FG_IMediaEventSinkImpl mediaeventsink;
152 FG_IMediaPositionImpl mediaposition;
153 FG_IMediaSeekingImpl mediaseeking;
154 FG_IBasicVideoImpl basvid;
155 FG_IBasicAudioImpl basaud;
156 FG_IVideoWindowImpl vidwin;
157 FG_IAMStatsImpl amstats;
159 /* IDispatch fields. */
160 /* IFilterGraph2 fields. */
161 CRITICAL_SECTION m_csFilters;
162 DWORD m_cActiveFilters;
163 FG_FilterData* m_pActiveFilters;
164 /* IGraphVersion fields. */
165 LONG m_lGraphVersion;
166 /* IMediaControl fields. */
167 /* IMediaFilter fields. */
168 CRITICAL_SECTION m_csGraphState;
169 FILTER_STATE m_stateGraph; /* must NOT accessed directly! */
170 CRITICAL_SECTION m_csClock;
171 IReferenceClock* m_pClock;
172 /* IMediaEvent fields. */
173 HANDLE m_hMediaEvent;
174 CRITICAL_SECTION m_csMediaEvents;
175 FilterGraph_MEDIAEVENT* m_pMediaEvents;
176 ULONG m_cbMediaEventsPut;
177 ULONG m_cbMediaEventsGet;
178 ULONG m_cbMediaEventsMax;
179 HWND m_hwndEventNotify;
180 long m_lEventNotifyMsg;
181 LONG_PTR m_lEventNotifyParam;
182 long m_lEventNotifyFlags;
183 /* IMediaEventSink fields. */
184 /* IMediaPosition fields. */
185 /* IMediaSeeking fields. */
186 /* IBasicVideo2 fields. */
187 /* IBasicAudio fields. */
188 /* IVideoWindow fields. */
189 /* IAMStats fields. */
192 #define CFilterGraph_THIS(iface,member) CFilterGraph* This = ((CFilterGraph*)(((char*)iface)-offsetof(CFilterGraph,member)))
193 #define CFilterGraph_IPersist(th) ((IPersist*)&((th)->persist))
194 #define CFilterGraph_IDispatch(th) ((IDispatch*)&((th)->disp))
195 #define CFilterGraph_IFilterGraph2(th) ((IFilterGraph2*)&((th)->fgraph))
196 #define CFilterGraph_IMediaControl(th) ((IMediaControl*)&((th)->mediacontrol))
197 #define CFilterGraph_IMediaFilter(th) ((IMediaFilter*)&((th)->mediafilter))
198 #define CFilterGraph_IMediaEventEx(th) ((IMediaEventEx*)&((th)->mediaevent))
199 #define CFilterGraph_IMediaEventSink(th) ((IMediaEventSink*)&((th)->mediaeventsink))
201 HRESULT QUARTZ_CreateFilterGraph(IUnknown* punkOuter,void** ppobj);
203 HRESULT CFilterGraph_InitIPersist( CFilterGraph* pfg );
204 void CFilterGraph_UninitIPersist( CFilterGraph* pfg );
205 HRESULT CFilterGraph_InitIDispatch( CFilterGraph* pfg );
206 void CFilterGraph_UninitIDispatch( CFilterGraph* pfg );
207 HRESULT CFilterGraph_InitIFilterGraph2( CFilterGraph* pfg );
208 void CFilterGraph_UninitIFilterGraph2( CFilterGraph* pfg );
209 HRESULT CFilterGraph_InitIGraphVersion( CFilterGraph* pfg );
210 void CFilterGraph_UninitIGraphVersion( CFilterGraph* pfg );
211 HRESULT CFilterGraph_InitIGraphConfig( CFilterGraph* pfg );
212 void CFilterGraph_UninitIGraphConfig( CFilterGraph* pfg );
213 HRESULT CFilterGraph_InitIMediaControl( CFilterGraph* pfg );
214 void CFilterGraph_UninitIMediaControl( CFilterGraph* pfg );
215 HRESULT CFilterGraph_InitIMediaFilter( CFilterGraph* pfg );
216 void CFilterGraph_UninitIMediaFilter( CFilterGraph* pfg );
217 HRESULT CFilterGraph_InitIMediaEventEx( CFilterGraph* pfg );
218 void CFilterGraph_UninitIMediaEventEx( CFilterGraph* pfg );
219 HRESULT CFilterGraph_InitIMediaEventSink( CFilterGraph* pfg );
220 void CFilterGraph_UninitIMediaEventSink( CFilterGraph* pfg );
221 HRESULT CFilterGraph_InitIMediaPosition( CFilterGraph* pfg );
222 void CFilterGraph_UninitIMediaPosition( CFilterGraph* pfg );
223 HRESULT CFilterGraph_InitIMediaSeeking( CFilterGraph* pfg );
224 void CFilterGraph_UninitIMediaSeeking( CFilterGraph* pfg );
225 HRESULT CFilterGraph_InitIBasicVideo2( CFilterGraph* pfg );
226 void CFilterGraph_UninitIBasicVideo2( CFilterGraph* pfg );
227 HRESULT CFilterGraph_InitIBasicAudio( CFilterGraph* pfg );
228 void CFilterGraph_UninitIBasicAudio( CFilterGraph* pfg );
229 HRESULT CFilterGraph_InitIVideoWindow( CFilterGraph* pfg );
230 void CFilterGraph_UninitIVideoWindow( CFilterGraph* pfg );
231 HRESULT CFilterGraph_InitIAMStats( CFilterGraph* pfg );
232 void CFilterGraph_UninitIAMStats( CFilterGraph* pfg );
235 #endif /* WINE_DSHOW_FGRAPH_H */