2 * Implementation of MediaStream Filter
4 * Copyright 2008 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/debug.h"
31 #include "amstream_private.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(amstream
);
39 const IMediaStreamFilterVtbl
*lpVtbl
;
41 CRITICAL_SECTION csFilter
;
43 REFERENCE_TIME rtStreamStart
;
44 IReferenceClock
* pClock
;
45 FILTER_INFO filterInfo
;
46 } IMediaStreamFilterImpl
;
48 static const struct IMediaStreamFilterVtbl MediaStreamFilter_Vtbl
;
50 HRESULT
MediaStreamFilter_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
52 IMediaStreamFilterImpl
* object
;
54 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
57 return CLASS_E_NOAGGREGATION
;
59 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IMediaStreamFilterImpl
));
62 ERR("Out of memory\n");
66 object
->lpVtbl
= &MediaStreamFilter_Vtbl
;
74 /*** IUnknown methods ***/
76 static HRESULT WINAPI
MediaStreamFilterImpl_QueryInterface(IMediaStreamFilter
* iface
, REFIID riid
, LPVOID
* ppv
)
78 IMediaStreamFilterImpl
*This
= (IMediaStreamFilterImpl
*)iface
;
80 TRACE("(%p)->(%s, %p)\n", iface
, debugstr_guid(riid
), ppv
);
84 if (IsEqualIID(riid
, &IID_IUnknown
))
86 else if (IsEqualIID(riid
, &IID_IPersist
))
88 else if (IsEqualIID(riid
, &IID_IMediaFilter
))
90 else if (IsEqualIID(riid
, &IID_IBaseFilter
))
92 else if (IsEqualIID(riid
, &IID_IMediaStreamFilter
))
97 IUnknown_AddRef((IUnknown
*)(*ppv
));
101 return E_NOINTERFACE
;
104 static ULONG WINAPI
MediaStreamFilterImpl_AddRef(IMediaStreamFilter
* iface
)
106 IMediaStreamFilterImpl
*This
= (IMediaStreamFilterImpl
*)iface
;
107 ULONG refCount
= InterlockedIncrement(&This
->ref
);
109 TRACE("(%p)->() AddRef from %d\n", iface
, refCount
- 1);
114 static ULONG WINAPI
MediaStreamFilterImpl_Release(IMediaStreamFilter
* iface
)
116 IMediaStreamFilterImpl
*This
= (IMediaStreamFilterImpl
*)iface
;
117 ULONG refCount
= InterlockedDecrement(&This
->ref
);
119 TRACE("(%p)->() Release from %d\n", iface
, refCount
+ 1);
124 HeapFree(GetProcessHeap(), 0, This
);
130 /*** IPersist methods ***/
132 static HRESULT WINAPI
MediaStreamFilterImpl_GetClassID(IMediaStreamFilter
* iface
, CLSID
* pClsid
)
134 TRACE("(%p)->(%p)\n", iface
, pClsid
);
136 *pClsid
= CLSID_MediaStreamFilter
;
141 /*** IMediaFilter methods ***/
143 static HRESULT WINAPI
MediaStreamFilterImpl_Stop(IMediaStreamFilter
* iface
)
145 FIXME("(%p)->(): Stub!\n", iface
);
150 static HRESULT WINAPI
MediaStreamFilterImpl_Pause(IMediaStreamFilter
* iface
)
152 FIXME("(%p)->(): Stub!\n", iface
);
157 static HRESULT WINAPI
MediaStreamFilterImpl_Run(IMediaStreamFilter
* iface
, REFERENCE_TIME tStart
)
159 FIXME("(%p)->(%s): Stub!\n", iface
, wine_dbgstr_longlong(tStart
));
164 static HRESULT WINAPI
MediaStreamFilterImpl_GetState(IMediaStreamFilter
* iface
, DWORD dwMilliSecsTimeout
, FILTER_STATE
*pState
)
166 FIXME("(%p)->(%d,%p): Stub!\n", iface
, dwMilliSecsTimeout
, pState
);
171 static HRESULT WINAPI
MediaStreamFilterImpl_SetSyncSource(IMediaStreamFilter
* iface
, IReferenceClock
*pClock
)
173 TRACE("(%p)->(%p): Stub!\n", iface
, pClock
);
178 static HRESULT WINAPI
MediaStreamFilterImpl_GetSyncSource(IMediaStreamFilter
* iface
, IReferenceClock
**ppClock
)
180 FIXME("(%p)->(%p): Stub!\n", iface
, ppClock
);
185 /*** IBaseFilter methods ***/
187 static HRESULT WINAPI
MediaStreamFilterImpl_EnumPins(IMediaStreamFilter
* iface
, IEnumPins
**ppEnum
)
189 FIXME("(%p)->(%p): Stub!\n", iface
, ppEnum
);
194 static HRESULT WINAPI
MediaStreamFilterImpl_FindPin(IMediaStreamFilter
* iface
, LPCWSTR Id
, IPin
**ppPin
)
196 FIXME("(%p)->(%s,%p): Stub!\n", iface
, debugstr_w(Id
), ppPin
);
201 static HRESULT WINAPI
MediaStreamFilterImpl_QueryFilterInfo(IMediaStreamFilter
* iface
, FILTER_INFO
*pInfo
)
203 FIXME("(%p)->(%p): Stub!\n", iface
, pInfo
);
208 static HRESULT WINAPI
MediaStreamFilterImpl_JoinFilterGraph(IMediaStreamFilter
* iface
, IFilterGraph
*pGraph
, LPCWSTR pName
)
210 FIXME("(%p)->(%p, %s): Stub!\n", iface
, pGraph
, debugstr_w(pName
));
215 static HRESULT WINAPI
MediaStreamFilterImpl_QueryVendorInfo(IMediaStreamFilter
* iface
, LPWSTR
*pVendorInfo
)
217 FIXME("(%p)->(%p): Stub!\n", iface
, pVendorInfo
);
222 /*** IMediaStreamFilter methods ***/
224 static HRESULT WINAPI
MediaStreamFilterImpl_AddMediaStream(IMediaStreamFilter
* iface
, IAMMediaStream
*pAMMediaStream
)
226 FIXME("(%p)->(%p): Stub!\n", iface
, pAMMediaStream
);
231 static HRESULT WINAPI
MediaStreamFilterImpl_GetMediaStream(IMediaStreamFilter
* iface
, REFMSPID idPurpose
, IMediaStream
**ppMediaStream
)
233 FIXME("(%p)->(%s,%p): Stub!\n", iface
, debugstr_guid(idPurpose
), ppMediaStream
);
238 static HRESULT WINAPI
MediaStreamFilterImpl_EnumMediaStreams(IMediaStreamFilter
* iface
, LONG Index
, IMediaStream
**ppMediaStream
)
240 FIXME("(%p)->(%d,%p): Stub!\n", iface
, Index
, ppMediaStream
);
245 static HRESULT WINAPI
MediaStreamFilterImpl_SupportSeeking(IMediaStreamFilter
* iface
, BOOL bRenderer
)
247 FIXME("(%p)->(%d): Stub!\n", iface
, bRenderer
);
252 static HRESULT WINAPI
MediaStreamFilterImpl_ReferenceTimeToStreamTime(IMediaStreamFilter
* iface
, REFERENCE_TIME
*pTime
)
254 FIXME("(%p)->(%p): Stub!\n", iface
, pTime
);
259 static HRESULT WINAPI
MediaStreamFilterImpl_GetCurrentStreamTime(IMediaStreamFilter
* iface
, REFERENCE_TIME
*pCurrentStreamTime
)
261 FIXME("(%p)->(%p): Stub!\n", iface
, pCurrentStreamTime
);
266 static HRESULT WINAPI
MediaStreamFilterImpl_WaitUntil(IMediaStreamFilter
* iface
, REFERENCE_TIME WaitStreamTime
)
268 FIXME("(%p)->(%s): Stub!\n", iface
, wine_dbgstr_longlong(WaitStreamTime
));
273 static HRESULT WINAPI
MediaStreamFilterImpl_Flush(IMediaStreamFilter
* iface
, BOOL bCancelEOS
)
275 FIXME("(%p)->(%d): Stub!\n", iface
, bCancelEOS
);
280 static HRESULT WINAPI
MediaStreamFilterImpl_EndOfStream(IMediaStreamFilter
* iface
)
282 FIXME("(%p)->(): Stub!\n", iface
);
287 static const IMediaStreamFilterVtbl MediaStreamFilter_Vtbl
=
289 MediaStreamFilterImpl_QueryInterface
,
290 MediaStreamFilterImpl_AddRef
,
291 MediaStreamFilterImpl_Release
,
292 MediaStreamFilterImpl_GetClassID
,
293 MediaStreamFilterImpl_Stop
,
294 MediaStreamFilterImpl_Pause
,
295 MediaStreamFilterImpl_Run
,
296 MediaStreamFilterImpl_GetState
,
297 MediaStreamFilterImpl_SetSyncSource
,
298 MediaStreamFilterImpl_GetSyncSource
,
299 MediaStreamFilterImpl_EnumPins
,
300 MediaStreamFilterImpl_FindPin
,
301 MediaStreamFilterImpl_QueryFilterInfo
,
302 MediaStreamFilterImpl_JoinFilterGraph
,
303 MediaStreamFilterImpl_QueryVendorInfo
,
304 MediaStreamFilterImpl_AddMediaStream
,
305 MediaStreamFilterImpl_GetMediaStream
,
306 MediaStreamFilterImpl_EnumMediaStreams
,
307 MediaStreamFilterImpl_SupportSeeking
,
308 MediaStreamFilterImpl_ReferenceTimeToStreamTime
,
309 MediaStreamFilterImpl_GetCurrentStreamTime
,
310 MediaStreamFilterImpl_WaitUntil
,
311 MediaStreamFilterImpl_Flush
,
312 MediaStreamFilterImpl_EndOfStream