source: trunk/src/quartz/fmap.c@ 8266

Last change on this file since 8266 was 6952, checked in by sandervl, 24 years ago

Wine 20011004 resync

File size: 5.5 KB
Line 
1/*
2 * Implementation of CLSID_FilterMapper.
3 *
4 * FIXME - stub.
5 *
6 * hidenori@a2.ctktv.ne.jp
7 */
8
9#include "config.h"
10
11#include "windef.h"
12#include "winbase.h"
13#include "wingdi.h"
14#include "winuser.h"
15#include "winreg.h"
16#include "winerror.h"
17#include "wine/obj_base.h"
18#include "wine/obj_oleaut.h"
19#include "strmif.h"
20#include "control.h"
21#include "uuids.h"
22
23#include "debugtools.h"
24DEFAULT_DEBUG_CHANNEL(quartz);
25
26#include "quartz_private.h"
27#include "fmap.h"
28#include "regsvr.h"
29
30
31/***************************************************************************
32 *
33 * new/delete for CLSID_FilterMapper
34 *
35 */
36
37/* can I use offsetof safely? - FIXME? */
38static QUARTZ_IFEntry IFEntries[] =
39{
40 { &IID_IFilterMapper, offsetof(CFilterMapper,fmap)-offsetof(CFilterMapper,unk) },
41};
42
43
44static void QUARTZ_DestroyFilterMapper(IUnknown* punk)
45{
46 CFilterMapper_THIS(punk,unk);
47
48 CFilterMapper_UninitIFilterMapper( This );
49}
50
51HRESULT QUARTZ_CreateFilterMapper(IUnknown* punkOuter,void** ppobj)
52{
53 CFilterMapper* pfm;
54 HRESULT hr;
55
56 TRACE("(%p,%p)\n",punkOuter,ppobj);
57
58 pfm = (CFilterMapper*)QUARTZ_AllocObj( sizeof(CFilterMapper) );
59 if ( pfm == NULL )
60 return E_OUTOFMEMORY;
61
62 QUARTZ_IUnkInit( &pfm->unk, punkOuter );
63 hr = CFilterMapper_InitIFilterMapper( pfm );
64 if ( FAILED(hr) )
65 {
66 QUARTZ_FreeObj( pfm );
67 return hr;
68 }
69
70 pfm->unk.pEntries = IFEntries;
71 pfm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
72 pfm->unk.pOnFinalRelease = QUARTZ_DestroyFilterMapper;
73
74 *ppobj = (void*)(&pfm->unk);
75
76 return S_OK;
77}
78
79/***************************************************************************
80 *
81 * CLSID_FilterMapper::IFilterMapper
82 *
83 */
84
85static HRESULT WINAPI
86IFilterMapper_fnQueryInterface(IFilterMapper* iface,REFIID riid,void** ppobj)
87{
88 CFilterMapper_THIS(iface,fmap);
89
90 TRACE("(%p)->()\n",This);
91
92 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
93}
94
95static ULONG WINAPI
96IFilterMapper_fnAddRef(IFilterMapper* iface)
97{
98 CFilterMapper_THIS(iface,fmap);
99
100 TRACE("(%p)->()\n",This);
101
102 return IUnknown_AddRef(This->unk.punkControl);
103}
104
105static ULONG WINAPI
106IFilterMapper_fnRelease(IFilterMapper* iface)
107{
108 CFilterMapper_THIS(iface,fmap);
109
110 TRACE("(%p)->()\n",This);
111
112 return IUnknown_Release(This->unk.punkControl);
113}
114
115
116static HRESULT WINAPI
117IFilterMapper_fnRegisterFilter(IFilterMapper* iface,CLSID clsid,LPCWSTR lpwszName,DWORD dwMerit)
118{
119 CFilterMapper_THIS(iface,fmap);
120
121 FIXME("(%p)->(%s,%s,%08lx)\n",This,
122 debugstr_guid(&clsid),debugstr_w(lpwszName),dwMerit);
123
124 /* FIXME */
125 /* FIXME - handle dwMerit! */
126 return QUARTZ_RegisterAMovieFilter(
127 &CLSID_LegacyAmFilterCategory,
128 &clsid,
129 NULL, 0,
130 lpwszName, NULL, TRUE );
131}
132
133static HRESULT WINAPI
134IFilterMapper_fnRegisterFilterInstance(IFilterMapper* iface,CLSID clsid,LPCWSTR lpwszName,CLSID* pclsidMedia)
135{
136 CFilterMapper_THIS(iface,fmap);
137 HRESULT hr;
138
139 FIXME("(%p)->()\n",This);
140
141 if ( pclsidMedia == NULL )
142 return E_POINTER;
143 hr = CoCreateGuid(pclsidMedia);
144 if ( FAILED(hr) )
145 return hr;
146
147 /* FIXME */
148 /* this doesn't work. */
149 /* return IFilterMapper_RegisterFilter(iface,
150 *pclsidMedia,lpwszName,0x60000000); */
151
152 return E_NOTIMPL;
153}
154
155static HRESULT WINAPI
156IFilterMapper_fnRegisterPin(IFilterMapper* iface,CLSID clsidFilter,LPCWSTR lpwszName,BOOL bRendered,BOOL bOutput,BOOL bZero,BOOL bMany,CLSID clsidReserved,LPCWSTR lpwszReserved)
157{
158 CFilterMapper_THIS(iface,fmap);
159
160 FIXME("(%p)->() stub!\n",This);
161
162 return E_NOTIMPL;
163}
164
165static HRESULT WINAPI
166IFilterMapper_fnRegisterPinType(IFilterMapper* iface,CLSID clsidFilter,LPCWSTR lpwszName,CLSID clsidMajorType,CLSID clsidSubType)
167{
168 CFilterMapper_THIS(iface,fmap);
169
170 FIXME("(%p)->() stub!\n",This);
171
172 return E_NOTIMPL;
173}
174
175static HRESULT WINAPI
176IFilterMapper_fnUnregisterFilter(IFilterMapper* iface,CLSID clsidFilter)
177{
178 CFilterMapper_THIS(iface,fmap);
179
180 FIXME("(%p)->(%s)\n",This,debugstr_guid(&clsidFilter));
181
182 /* FIXME */
183 return QUARTZ_RegisterAMovieFilter(
184 &CLSID_LegacyAmFilterCategory,
185 &clsidFilter,
186 NULL, 0, NULL, NULL, FALSE );
187}
188
189static HRESULT WINAPI
190IFilterMapper_fnUnregisterFilterInstance(IFilterMapper* iface,CLSID clsidMedia)
191{
192 CFilterMapper_THIS(iface,fmap);
193
194 FIXME("(%p)->(%s)\n",This,debugstr_guid(&clsidMedia));
195
196 /* FIXME */
197 /* this doesn't work. */
198 /* return IFilterMapper_UnregisterFilter(iface,clsidMedia); */
199
200 return E_NOTIMPL;
201}
202
203static HRESULT WINAPI
204IFilterMapper_fnUnregisterPin(IFilterMapper* iface,CLSID clsidPin,LPCWSTR lpwszName)
205{
206 CFilterMapper_THIS(iface,fmap);
207
208 FIXME("(%p)->(%s,%s) stub!\n",This,
209 debugstr_guid(&clsidPin),debugstr_w(lpwszName));
210
211 return E_NOTIMPL;
212}
213
214static HRESULT WINAPI
215IFilterMapper_fnEnumMatchingFilters(IFilterMapper* iface,IEnumRegFilters** ppobj,DWORD dwMerit,BOOL bInputNeeded,CLSID clsInMajorType,CLSID clsidSubType,BOOL bRender,BOOL bOutputNeeded,CLSID clsOutMajorType,CLSID clsOutSubType)
216{
217 CFilterMapper_THIS(iface,fmap);
218
219 FIXME("(%p)->() stub!\n",This);
220
221 return E_NOTIMPL;
222}
223
224
225
226static ICOM_VTABLE(IFilterMapper) ifmap =
227{
228 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
229 /* IUnknown fields */
230 IFilterMapper_fnQueryInterface,
231 IFilterMapper_fnAddRef,
232 IFilterMapper_fnRelease,
233 /* IFilterMapper fields */
234 IFilterMapper_fnRegisterFilter,
235 IFilterMapper_fnRegisterFilterInstance,
236 IFilterMapper_fnRegisterPin,
237 IFilterMapper_fnRegisterPinType,
238 IFilterMapper_fnUnregisterFilter,
239 IFilterMapper_fnUnregisterFilterInstance,
240 IFilterMapper_fnUnregisterPin,
241 IFilterMapper_fnEnumMatchingFilters,
242};
243
244
245HRESULT CFilterMapper_InitIFilterMapper( CFilterMapper* pfm )
246{
247 TRACE("(%p)\n",pfm);
248 ICOM_VTBL(&pfm->fmap) = &ifmap;
249
250 return NOERROR;
251}
252
253void CFilterMapper_UninitIFilterMapper( CFilterMapper* pfm )
254{
255 TRACE("(%p)\n",pfm);
256}
Note: See TracBrowser for help on using the repository browser.