2 * Implementation of CLSID_CaptureGraphBuilder[2].
4 * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
38 #include "quartz_private.h"
42 /***************************************************************************
44 * CCaptureGraph::ICaptureGraphBuilder
49 ICaptureGraphBuilder_fnQueryInterface(ICaptureGraphBuilder* iface,REFIID riid,void** ppobj)
51 CCaptureGraph_THIS(iface,capgraph1);
53 TRACE("(%p)->()\n",This);
55 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
59 ICaptureGraphBuilder_fnAddRef(ICaptureGraphBuilder* iface)
61 CCaptureGraph_THIS(iface,capgraph1);
63 TRACE("(%p)->()\n",This);
65 return IUnknown_AddRef(This->unk.punkControl);
69 ICaptureGraphBuilder_fnRelease(ICaptureGraphBuilder* iface)
71 CCaptureGraph_THIS(iface,capgraph1);
73 TRACE("(%p)->()\n",This);
75 return IUnknown_Release(This->unk.punkControl);
80 ICaptureGraphBuilder_fnSetFiltergraph(ICaptureGraphBuilder* iface,IGraphBuilder* pgb)
82 CCaptureGraph_THIS(iface,capgraph1);
84 FIXME("(%p)->()\n",This);
90 ICaptureGraphBuilder_fnGetFiltergraph(ICaptureGraphBuilder* iface,IGraphBuilder** ppgb)
92 CCaptureGraph_THIS(iface,capgraph1);
94 FIXME("(%p)->()\n",This);
100 ICaptureGraphBuilder_fnSetOutputFileName(ICaptureGraphBuilder* iface,const GUID* pguidType,LPCOLESTR pName,IBaseFilter** ppFilter,IFileSinkFilter** ppSink)
102 CCaptureGraph_THIS(iface,capgraph1);
104 FIXME("(%p)->() stub!\n",This);
109 static HRESULT WINAPI
110 ICaptureGraphBuilder_fnFindInterface(ICaptureGraphBuilder* iface,const GUID* pguidCat,IBaseFilter* pFilter,REFIID riid,void** ppvobj)
112 CCaptureGraph_THIS(iface,capgraph1);
114 FIXME("(%p)->() stub!\n",This);
119 static HRESULT WINAPI
120 ICaptureGraphBuilder_fnRenderStream(ICaptureGraphBuilder* iface,const GUID* pguidCat,IUnknown* pSource,IBaseFilter* pCompressor,IBaseFilter* pRenderer)
122 CCaptureGraph_THIS(iface,capgraph1);
124 FIXME("(%p)->() stub!\n",This);
129 static HRESULT WINAPI
130 ICaptureGraphBuilder_fnControlStream(ICaptureGraphBuilder* iface,const GUID* pguidCat,IBaseFilter* pFilter,REFERENCE_TIME* prtStart,REFERENCE_TIME* prtStop,WORD wStartCookie,WORD wStopCookie)
132 CCaptureGraph_THIS(iface,capgraph1);
134 FIXME("(%p)->() stub!\n",This);
139 static HRESULT WINAPI
140 ICaptureGraphBuilder_fnAllocCapFile(ICaptureGraphBuilder* iface,LPCOLESTR pName,DWORDLONG llSize)
142 CCaptureGraph_THIS(iface,capgraph1);
144 FIXME("(%p)->()\n",This);
149 static HRESULT WINAPI
150 ICaptureGraphBuilder_fnCopyCaptureFile(ICaptureGraphBuilder* iface,LPOLESTR pOrgName,LPOLESTR pNewName,int fAllowEscAbort,IAMCopyCaptureFileProgress* pCallback)
152 CCaptureGraph_THIS(iface,capgraph1);
154 FIXME("(%p)->()\n",This);
159 static ICOM_VTABLE(ICaptureGraphBuilder) icapgraph1 =
161 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
162 /* IUnknown fields */
163 ICaptureGraphBuilder_fnQueryInterface,
164 ICaptureGraphBuilder_fnAddRef,
165 ICaptureGraphBuilder_fnRelease,
166 /* ICaptureGraphBuilder fields */
167 ICaptureGraphBuilder_fnSetFiltergraph,
168 ICaptureGraphBuilder_fnGetFiltergraph,
169 ICaptureGraphBuilder_fnSetOutputFileName,
170 ICaptureGraphBuilder_fnFindInterface,
171 ICaptureGraphBuilder_fnRenderStream,
172 ICaptureGraphBuilder_fnControlStream,
173 ICaptureGraphBuilder_fnAllocCapFile,
174 ICaptureGraphBuilder_fnCopyCaptureFile,
178 static HRESULT CCaptureGraph_InitICaptureGraphBuilder( CCaptureGraph* This )
180 TRACE("(%p)\n",This);
181 ICOM_VTBL(&This->capgraph1) = &icapgraph1;
186 static void CCaptureGraph_UninitICaptureGraphBuilder( CCaptureGraph* This )
188 TRACE("(%p)\n",This);
192 /***************************************************************************
194 * new/delete for CCaptureGraph
198 /* can I use offsetof safely? - FIXME? */
199 static QUARTZ_IFEntry IFEntries[] =
201 { &IID_ICaptureGraphBuilder, offsetof(CCaptureGraph,capgraph1)-offsetof(CCaptureGraph,unk) },
204 static void QUARTZ_DestroyCaptureGraph(IUnknown* punk)
206 CCaptureGraph_THIS(punk,unk);
208 TRACE( "(%p)\n", This );
210 CCaptureGraph_UninitICaptureGraphBuilder(This);
213 HRESULT QUARTZ_CreateCaptureGraph(IUnknown* punkOuter,void** ppobj)
218 TRACE("(%p,%p)\n",punkOuter,ppobj);
220 pcg = (CCaptureGraph*)QUARTZ_AllocObj( sizeof(CCaptureGraph) );
222 return E_OUTOFMEMORY;
224 QUARTZ_IUnkInit( &pcg->unk, punkOuter );
227 hr = CCaptureGraph_InitICaptureGraphBuilder(pcg);
235 pcg->unk.pEntries = IFEntries;
236 pcg->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
237 pcg->unk.pOnFinalRelease = QUARTZ_DestroyCaptureGraph;
239 *ppobj = (void*)(&pcg->unk);