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 (pass to a renderer)
40 + IDispatch - IBasicAudio (pass to a renderer)
41 + IDispatch - IVideoWindow (pass to a renderer)
42 (following interfaces are not implemented)
45 FIXME - Are there any missing interfaces???
52 typedef struct FG_IPersistImpl
54 ICOM_VFIELD(IPersist);
57 typedef struct FG_IDispatchImpl
59 ICOM_VFIELD(IDispatch);
62 typedef struct FG_IFilterGraph2Impl
64 ICOM_VFIELD(IFilterGraph2);
65 } FG_IFilterGraph2Impl;
67 typedef struct FG_IGraphVersionImpl
69 ICOM_VFIELD(IGraphVersion);
70 } FG_IGraphVersionImpl;
72 typedef struct FG_IMediaControlImpl
74 ICOM_VFIELD(IMediaControl);
75 } FG_IMediaControlImpl;
77 typedef struct FG_IMediaFilterImpl
79 ICOM_VFIELD(IMediaFilter);
80 } FG_IMediaFilterImpl;
82 typedef struct FG_IMediaEventImpl
84 ICOM_VFIELD(IMediaEventEx);
87 typedef struct FG_IMediaEventSinkImpl
89 ICOM_VFIELD(IMediaEventSink);
90 } FG_IMediaEventSinkImpl;
92 typedef struct FG_IMediaPositionImpl
94 ICOM_VFIELD(IMediaPosition);
95 } FG_IMediaPositionImpl;
97 typedef struct FG_IMediaSeekingImpl
99 ICOM_VFIELD(IMediaSeeking);
100 } FG_IMediaSeekingImpl;
102 typedef struct FG_IBasicVideoImpl
104 ICOM_VFIELD(IBasicVideo);
105 } FG_IBasicVideoImpl;
107 typedef struct FG_IBasicAudioImpl
109 ICOM_VFIELD(IBasicAudio);
110 } FG_IBasicAudioImpl;
112 typedef struct FG_IVideoWindowImpl
114 ICOM_VFIELD(IVideoWindow);
115 } FG_IVideoWindowImpl;
118 typedef struct FG_FilterData
120 IBaseFilter* pFilter;
121 IMediaPosition* pPosition;
122 IMediaSeeking* pSeeking;
127 typedef struct FilterGraph_MEDIAEVENT FilterGraph_MEDIAEVENT;
129 typedef struct CFilterGraph
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;
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. */
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))
187 HRESULT QUARTZ_CreateFilterGraph(IUnknown* punkOuter,void** ppobj);
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 );
217 #endif /* WINE_DSHOW_FGRAPH_H */