Merged some C sources.
[wine/multimedia.git] / dlls / quartz / fmap2.c
blob315d2317404e016a9e85605551d29e32e08bc137
1 /*
2 * Implementation of CLSID_FilterMapper2.
4 * FIXME - stub.
6 * hidenori@a2.ctktv.ne.jp
7 */
9 #include "config.h"
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"
23 #include "debugtools.h"
24 DEFAULT_DEBUG_CHANNEL(quartz);
26 #include "quartz_private.h"
27 #include "fmap2.h"
28 #include "regsvr.h"
31 /***************************************************************************
33 * new/delete for CLSID_FilterMapper2
37 /* can I use offsetof safely? - FIXME? */
38 static QUARTZ_IFEntry IFEntries[] =
40 { &IID_IFilterMapper2, offsetof(CFilterMapper2,fmap3)-offsetof(CFilterMapper2,unk) },
41 { &IID_IFilterMapper3, offsetof(CFilterMapper2,fmap3)-offsetof(CFilterMapper2,unk) },
45 static void QUARTZ_DestroyFilterMapper2(IUnknown* punk)
47 CFilterMapper2_THIS(punk,unk);
49 CFilterMapper2_UninitIFilterMapper3( This );
52 HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj)
54 CFilterMapper2* pfm;
55 HRESULT hr;
57 TRACE("(%p,%p)\n",punkOuter,ppobj);
59 pfm = (CFilterMapper2*)QUARTZ_AllocObj( sizeof(CFilterMapper2) );
60 if ( pfm == NULL )
61 return E_OUTOFMEMORY;
63 QUARTZ_IUnkInit( &pfm->unk, punkOuter );
64 hr = CFilterMapper2_InitIFilterMapper3( pfm );
65 if ( FAILED(hr) )
67 QUARTZ_FreeObj( pfm );
68 return hr;
71 pfm->unk.pEntries = IFEntries;
72 pfm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
73 pfm->unk.pOnFinalRelease = QUARTZ_DestroyFilterMapper2;
75 *ppobj = (void*)(&pfm->unk);
77 return S_OK;
80 /***************************************************************************
82 * CLSID_FilterMapper2::IFilterMapper3
87 static HRESULT WINAPI
88 IFilterMapper3_fnQueryInterface(IFilterMapper3* iface,REFIID riid,void** ppobj)
90 CFilterMapper2_THIS(iface,fmap3);
92 TRACE("(%p)->()\n",This);
94 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
97 static ULONG WINAPI
98 IFilterMapper3_fnAddRef(IFilterMapper3* iface)
100 CFilterMapper2_THIS(iface,fmap3);
102 TRACE("(%p)->()\n",This);
104 return IUnknown_AddRef(This->unk.punkControl);
107 static ULONG WINAPI
108 IFilterMapper3_fnRelease(IFilterMapper3* iface)
110 CFilterMapper2_THIS(iface,fmap3);
112 TRACE("(%p)->()\n",This);
114 return IUnknown_Release(This->unk.punkControl);
117 static HRESULT WINAPI
118 IFilterMapper3_fnCreateCategory(IFilterMapper3* iface,REFCLSID rclsidCategory,DWORD dwMerit,LPCWSTR lpwszDesc)
120 CFilterMapper2_THIS(iface,fmap3);
122 FIXME("(%p)->(%s,%lu,%s) stub!\n",This,
123 debugstr_guid(rclsidCategory),
124 (unsigned long)dwMerit,debugstr_w(lpwszDesc));
126 return E_NOTIMPL;
130 static HRESULT WINAPI
131 IFilterMapper3_fnUnregisterFilter(IFilterMapper3* iface,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,REFCLSID rclsidFilter)
133 CFilterMapper2_THIS(iface,fmap3);
135 FIXME("(%p)->(%s,%s,%s) stub!\n",This,
136 debugstr_guid(pclsidCategory),
137 debugstr_w(lpwszInst),
138 debugstr_guid(rclsidFilter));
140 if ( pclsidCategory == NULL )
141 pclsidCategory = &CLSID_LegacyAmFilterCategory;
143 /* FIXME */
144 return QUARTZ_RegisterAMovieFilter(
145 pclsidCategory,
146 rclsidFilter,
147 NULL, 0,
148 NULL, lpwszInst, FALSE );
152 static HRESULT WINAPI
153 IFilterMapper3_fnRegisterFilter(IFilterMapper3* iface,REFCLSID rclsidFilter,LPCWSTR lpName,IMoniker** ppMoniker,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,const REGFILTER2* pRF2)
155 CFilterMapper2_THIS(iface,fmap3);
157 FIXME( "(%p)->(%s,%s,%p,%s,%s,%p) stub!\n",This,
158 debugstr_guid(rclsidFilter),debugstr_w(lpName),
159 ppMoniker,debugstr_guid(pclsidCategory),
160 debugstr_w(lpwszInst),pRF2 );
162 if ( lpName == NULL || pRF2 == NULL )
163 return E_POINTER;
165 if ( ppMoniker != NULL )
167 FIXME( "ppMoniker != NULL - not implemented!\n" );
168 return E_NOTIMPL;
171 if ( pclsidCategory == NULL )
172 pclsidCategory = &CLSID_LegacyAmFilterCategory;
174 /* FIXME!! - all members in REGFILTER2 are ignored ! */
176 return QUARTZ_RegisterAMovieFilter(
177 pclsidCategory,
178 rclsidFilter,
179 NULL, 0,
180 lpName, lpwszInst, TRUE );
184 static HRESULT WINAPI
185 IFilterMapper3_fnEnumMatchingFilters(IFilterMapper3* iface,IEnumMoniker** ppMoniker,DWORD dwFlags,BOOL bExactMatch,DWORD dwMerit,BOOL bInputNeeded,DWORD cInputTypes,const GUID* pguidInputTypes,const REGPINMEDIUM* pPinMediumIn,const CLSID* pPinCategoryIn,BOOL bRender,BOOL bOutputNeeded,DWORD cOutputTypes,const GUID* pguidOutputTypes,const REGPINMEDIUM* pPinMediumOut,const CLSID* pPinCategoryOut)
187 CFilterMapper2_THIS(iface,fmap3);
189 FIXME("(%p)->() stub!\n",This);
191 return E_NOTIMPL;
194 static HRESULT WINAPI
195 IFilterMapper3_fnGetICreateDevEnum(IFilterMapper3* iface,ICreateDevEnum** ppDevEnum)
197 CFilterMapper2_THIS(iface,fmap3);
199 /* undocumented */
200 FIXME("(%p)->() stub!\n",This);
202 return E_NOTIMPL;
208 static ICOM_VTABLE(IFilterMapper3) ifmap3 =
210 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
211 /* IUnknown fields */
212 IFilterMapper3_fnQueryInterface,
213 IFilterMapper3_fnAddRef,
214 IFilterMapper3_fnRelease,
215 /* IFilterMapper2 fields */
216 IFilterMapper3_fnCreateCategory,
217 IFilterMapper3_fnUnregisterFilter,
218 IFilterMapper3_fnRegisterFilter,
219 IFilterMapper3_fnEnumMatchingFilters,
220 /* IFilterMapper3 fields */
221 IFilterMapper3_fnGetICreateDevEnum,
225 HRESULT CFilterMapper2_InitIFilterMapper3( CFilterMapper2* pfm )
227 TRACE("(%p)\n",pfm);
228 ICOM_VTBL(&pfm->fmap3) = &ifmap3;
230 return NOERROR;
233 void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2* pfm )
235 TRACE("(%p)\n",pfm);