2 * Filter Seeking and Control Interfaces
4 * Copyright 2003 Robert Shearman
5 * Copyright 2012 Aric Stewart, CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 /* FIXME: critical sections */
28 #include "wine/debug.h"
29 #include "wine/strmbase.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
35 static const IMediaSeekingVtbl IMediaSeekingPassThru_Vtbl;
36 static const IMediaPositionVtbl IMediaPositionPassThru_Vtbl;
38 typedef struct PassThruImpl {
39 IUnknown IUnknown_inner;
40 ISeekingPassThru ISeekingPassThru_iface;
41 IMediaSeeking IMediaSeeking_iface;
42 IMediaPosition IMediaPosition_iface;
50 CRITICAL_SECTION time_cs;
52 REFERENCE_TIME time_earliest;
55 static inline PassThruImpl *impl_from_IUnknown_inner(IUnknown *iface)
57 return CONTAINING_RECORD(iface, PassThruImpl, IUnknown_inner);
60 static inline PassThruImpl *impl_from_ISeekingPassThru(ISeekingPassThru *iface)
62 return CONTAINING_RECORD(iface, PassThruImpl, ISeekingPassThru_iface);
65 static inline PassThruImpl *impl_from_IMediaSeeking(IMediaSeeking *iface)
67 return CONTAINING_RECORD(iface, PassThruImpl, IMediaSeeking_iface);
70 static inline PassThruImpl *impl_from_IMediaPosition(IMediaPosition *iface)
72 return CONTAINING_RECORD(iface, PassThruImpl, IMediaPosition_iface);
75 static HRESULT WINAPI SeekInner_QueryInterface(IUnknown * iface,
78 PassThruImpl *This = impl_from_IUnknown_inner(iface);
79 TRACE("(%p)->(%s (%p), %p)\n", This, debugstr_guid(riid), riid, ppvObj);
81 if (This->bAggregatable)
82 This->bUnkOuterValid = TRUE;
84 if (IsEqualGUID(&IID_IUnknown, riid))
86 *ppvObj = &(This->IUnknown_inner);
87 TRACE(" returning IUnknown interface (%p)\n", *ppvObj);
88 } else if (IsEqualGUID(&IID_ISeekingPassThru, riid)) {
89 *ppvObj = &(This->ISeekingPassThru_iface);
90 TRACE(" returning ISeekingPassThru interface (%p)\n", *ppvObj);
91 } else if (IsEqualGUID(&IID_IMediaSeeking, riid)) {
92 *ppvObj = &(This->IMediaSeeking_iface);
93 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj);
94 } else if (IsEqualGUID(&IID_IMediaPosition, riid)) {
95 *ppvObj = &(This->IMediaPosition_iface);
96 TRACE(" returning IMediaPosition interface (%p)\n", *ppvObj);
99 FIXME("unknown interface %s\n", debugstr_guid(riid));
100 return E_NOINTERFACE;
103 IUnknown_AddRef((IUnknown *)(*ppvObj));
107 static ULONG WINAPI SeekInner_AddRef(IUnknown * iface) {
108 PassThruImpl *This = impl_from_IUnknown_inner(iface);
109 ULONG ref = InterlockedIncrement(&This->ref);
111 TRACE("(%p)->(): new ref = %d\n", This, ref);
116 static ULONG WINAPI SeekInner_Release(IUnknown * iface) {
117 PassThruImpl *This = impl_from_IUnknown_inner(iface);
118 ULONG ref = InterlockedDecrement(&This->ref);
120 TRACE("(%p)->(): new ref = %d\n", This, ref);
124 This->time_cs.DebugInfo->Spare[0] = 0;
125 DeleteCriticalSection(&This->time_cs);
131 static const IUnknownVtbl IInner_VTable =
133 SeekInner_QueryInterface,
138 /* Generic functions for aggregation */
139 static HRESULT SeekOuter_QueryInterface(PassThruImpl *This, REFIID riid, LPVOID *ppv)
141 if (This->bAggregatable)
142 This->bUnkOuterValid = TRUE;
146 if (This->bAggregatable)
147 return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
149 if (IsEqualIID(riid, &IID_IUnknown))
153 IUnknown_AddRef((IUnknown *)&(This->IUnknown_inner));
154 hr = IUnknown_QueryInterface((IUnknown *)&(This->IUnknown_inner), riid, ppv);
155 IUnknown_Release((IUnknown *)&(This->IUnknown_inner));
156 This->bAggregatable = TRUE;
161 return E_NOINTERFACE;
164 return IUnknown_QueryInterface((IUnknown *)&(This->IUnknown_inner), riid, ppv);
167 static ULONG SeekOuter_AddRef(PassThruImpl *This)
169 if (This->outer_unk && This->bUnkOuterValid)
170 return IUnknown_AddRef(This->outer_unk);
171 return IUnknown_AddRef((IUnknown *)&(This->IUnknown_inner));
174 static ULONG SeekOuter_Release(PassThruImpl *This)
176 if (This->outer_unk && This->bUnkOuterValid)
177 return IUnknown_Release(This->outer_unk);
178 return IUnknown_Release((IUnknown *)&(This->IUnknown_inner));
181 static HRESULT WINAPI SeekingPassThru_QueryInterface(ISeekingPassThru *iface, REFIID riid, LPVOID *ppvObj)
183 PassThruImpl *This = impl_from_ISeekingPassThru(iface);
185 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
187 return SeekOuter_QueryInterface(This, riid, ppvObj);
190 static ULONG WINAPI SeekingPassThru_AddRef(ISeekingPassThru *iface)
192 PassThruImpl *This = impl_from_ISeekingPassThru(iface);
194 TRACE("(%p/%p)->()\n", This, iface);
196 return SeekOuter_AddRef(This);
199 static ULONG WINAPI SeekingPassThru_Release(ISeekingPassThru *iface)
201 PassThruImpl *This = impl_from_ISeekingPassThru(iface);
203 TRACE("(%p/%p)->()\n", This, iface);
205 return SeekOuter_Release(This);
208 static HRESULT WINAPI SeekingPassThru_Init(ISeekingPassThru *iface, BOOL renderer, IPin *pin)
210 PassThruImpl *This = impl_from_ISeekingPassThru(iface);
212 TRACE("(%p/%p)->(%d, %p)\n", This, iface, renderer, pin);
215 FIXME("Re-initializing?\n");
217 This->renderer = renderer;
223 static const ISeekingPassThruVtbl ISeekingPassThru_Vtbl =
225 SeekingPassThru_QueryInterface,
226 SeekingPassThru_AddRef,
227 SeekingPassThru_Release,
231 HRESULT WINAPI CreatePosPassThru(IUnknown* pUnkOuter, BOOL bRenderer, IPin *pPin, IUnknown **ppPassThru)
234 ISeekingPassThru *passthru;
236 hr = CoCreateInstance(&CLSID_SeekingPassThru, pUnkOuter, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppPassThru);
238 IUnknown_QueryInterface(*ppPassThru, &IID_ISeekingPassThru, (void**)&passthru);
239 hr = ISeekingPassThru_Init(passthru, bRenderer, pPin);
240 ISeekingPassThru_Release(passthru);
245 HRESULT WINAPI PosPassThru_Construct(IUnknown *pUnkOuter, LPVOID *ppPassThru)
249 TRACE("(%p,%p)\n", pUnkOuter, ppPassThru);
251 *ppPassThru = fimpl = CoTaskMemAlloc(sizeof(*fimpl));
253 return E_OUTOFMEMORY;
255 fimpl->outer_unk = pUnkOuter;
256 fimpl->bUnkOuterValid = FALSE;
257 fimpl->bAggregatable = FALSE;
258 fimpl->IUnknown_inner.lpVtbl = &IInner_VTable;
259 fimpl->ISeekingPassThru_iface.lpVtbl = &ISeekingPassThru_Vtbl;
260 fimpl->IMediaSeeking_iface.lpVtbl = &IMediaSeekingPassThru_Vtbl;
261 fimpl->IMediaPosition_iface.lpVtbl = &IMediaPositionPassThru_Vtbl;
264 fimpl->timevalid = 0;
265 InitializeCriticalSection(&fimpl->time_cs);
266 fimpl->time_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PassThruImpl.time_cs");
270 static HRESULT WINAPI MediaSeekingPassThru_QueryInterface(IMediaSeeking *iface, REFIID riid, LPVOID *ppvObj)
272 PassThruImpl *This = impl_from_IMediaSeeking(iface);
274 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
276 return SeekOuter_QueryInterface(This, riid, ppvObj);
279 static ULONG WINAPI MediaSeekingPassThru_AddRef(IMediaSeeking *iface)
281 PassThruImpl *This = impl_from_IMediaSeeking(iface);
283 TRACE("(%p/%p)->()\n", iface, This);
285 return SeekOuter_AddRef(This);
288 static ULONG WINAPI MediaSeekingPassThru_Release(IMediaSeeking *iface)
290 PassThruImpl *This = impl_from_IMediaSeeking(iface);
292 TRACE("(%p/%p)->()\n", iface, This);
294 return SeekOuter_Release(This);
297 static HRESULT get_connected(PassThruImpl *This, REFIID riid, LPVOID *ppvObj) {
301 hr = IPin_ConnectedTo(This->pin, &pin);
303 return VFW_E_NOT_CONNECTED;
304 hr = IPin_QueryInterface(pin, riid, ppvObj);
311 static HRESULT WINAPI MediaSeekingPassThru_GetCapabilities(IMediaSeeking * iface, DWORD * pCapabilities)
313 PassThruImpl *This = impl_from_IMediaSeeking(iface);
316 TRACE("(%p/%p)->(%p)\n", iface, This, pCapabilities);
317 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
319 hr = IMediaSeeking_GetCapabilities(seek, pCapabilities);
320 IMediaSeeking_Release(seek);
327 static HRESULT WINAPI MediaSeekingPassThru_CheckCapabilities(IMediaSeeking * iface, DWORD * pCapabilities)
329 PassThruImpl *This = impl_from_IMediaSeeking(iface);
332 TRACE("(%p/%p)->(%p)\n", iface, This, pCapabilities);
333 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
335 hr = IMediaSeeking_CheckCapabilities(seek, pCapabilities);
336 IMediaSeeking_Release(seek);
343 static HRESULT WINAPI MediaSeekingPassThru_IsFormatSupported(IMediaSeeking * iface, const GUID * pFormat)
345 PassThruImpl *This = impl_from_IMediaSeeking(iface);
348 TRACE("(%p/%p)->(%s)\n", iface, This, debugstr_guid(pFormat));
349 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
351 hr = IMediaSeeking_IsFormatSupported(seek, pFormat);
352 IMediaSeeking_Release(seek);
359 static HRESULT WINAPI MediaSeekingPassThru_QueryPreferredFormat(IMediaSeeking * iface, GUID * pFormat)
361 PassThruImpl *This = impl_from_IMediaSeeking(iface);
364 TRACE("(%p/%p)->(%p)\n", iface, This, pFormat);
365 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
367 hr = IMediaSeeking_QueryPreferredFormat(seek, pFormat);
368 IMediaSeeking_Release(seek);
375 static HRESULT WINAPI MediaSeekingPassThru_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat)
377 PassThruImpl *This = impl_from_IMediaSeeking(iface);
380 TRACE("(%p/%p)->(%p)\n", iface, This, pFormat);
381 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
383 hr = IMediaSeeking_GetTimeFormat(seek, pFormat);
384 IMediaSeeking_Release(seek);
391 static HRESULT WINAPI MediaSeekingPassThru_IsUsingTimeFormat(IMediaSeeking * iface, const GUID * pFormat)
393 PassThruImpl *This = impl_from_IMediaSeeking(iface);
396 TRACE("(%p/%p)->(%s)\n", iface, This, debugstr_guid(pFormat));
397 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
399 hr = IMediaSeeking_IsUsingTimeFormat(seek, pFormat);
400 IMediaSeeking_Release(seek);
407 static HRESULT WINAPI MediaSeekingPassThru_SetTimeFormat(IMediaSeeking * iface, const GUID * pFormat)
409 PassThruImpl *This = impl_from_IMediaSeeking(iface);
412 TRACE("(%p/%p)->(%s)\n", iface, This, debugstr_guid(pFormat));
413 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
415 hr = IMediaSeeking_SetTimeFormat(seek, pFormat);
416 IMediaSeeking_Release(seek);
423 static HRESULT WINAPI MediaSeekingPassThru_GetDuration(IMediaSeeking * iface, LONGLONG * pDuration)
425 PassThruImpl *This = impl_from_IMediaSeeking(iface);
428 TRACE("(%p/%p)->(%p)\n", iface, This, pDuration);
429 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
431 hr = IMediaSeeking_GetDuration(seek, pDuration);
432 IMediaSeeking_Release(seek);
439 static HRESULT WINAPI MediaSeekingPassThru_GetStopPosition(IMediaSeeking * iface, LONGLONG * pStop)
441 PassThruImpl *This = impl_from_IMediaSeeking(iface);
444 TRACE("(%p/%p)->(%p)\n", iface, This, pStop);
445 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
447 hr = IMediaSeeking_GetStopPosition(seek, pStop);
448 IMediaSeeking_Release(seek);
455 static HRESULT WINAPI MediaSeekingPassThru_GetCurrentPosition(IMediaSeeking * iface, LONGLONG * pCurrent)
457 PassThruImpl *This = impl_from_IMediaSeeking(iface);
460 TRACE("(%p/%p)->(%p)\n", iface, This, pCurrent);
463 EnterCriticalSection(&This->time_cs);
465 *pCurrent = This->time_earliest;
468 LeaveCriticalSection(&This->time_cs);
470 hr = IMediaSeeking_ConvertTimeFormat(iface, pCurrent, NULL, *pCurrent, &TIME_FORMAT_MEDIA_TIME);
473 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
475 hr = IMediaSeeking_GetCurrentPosition(seek, pCurrent);
476 IMediaSeeking_Release(seek);
483 static HRESULT WINAPI MediaSeekingPassThru_ConvertTimeFormat(IMediaSeeking * iface, LONGLONG * pTarget, const GUID * pTargetFormat, LONGLONG Source, const GUID * pSourceFormat)
485 PassThruImpl *This = impl_from_IMediaSeeking(iface);
488 TRACE("(%p/%p)->(%p,%s,%x%08x,%s)\n", iface, This, pTarget, debugstr_guid(pTargetFormat), (DWORD)(Source>>32), (DWORD)Source, debugstr_guid(pSourceFormat));
489 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
491 hr = IMediaSeeking_ConvertTimeFormat(seek, pTarget, pTargetFormat, Source, pSourceFormat);
492 IMediaSeeking_Release(seek);
499 static HRESULT WINAPI MediaSeekingPassThru_SetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, DWORD dwCurrentFlags, LONGLONG * pStop, DWORD dwStopFlags)
501 PassThruImpl *This = impl_from_IMediaSeeking(iface);
504 TRACE("(%p/%p)->(%p,%x,%p,%x)\n", iface, This, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
505 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
507 hr = IMediaSeeking_SetPositions(seek, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
508 IMediaSeeking_Release(seek);
509 } else if (hr == VFW_E_NOT_CONNECTED)
514 static HRESULT WINAPI MediaSeekingPassThru_GetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, LONGLONG * pStop)
516 PassThruImpl *This = impl_from_IMediaSeeking(iface);
519 TRACE("(%p/%p)->(%p, %p)\n", iface, This, pCurrent, pStop);
520 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
522 hr = IMediaSeeking_GetPositions(seek, pCurrent, pStop);
523 IMediaSeeking_Release(seek);
530 static HRESULT WINAPI MediaSeekingPassThru_GetAvailable(IMediaSeeking * iface, LONGLONG * pEarliest, LONGLONG * pLatest)
532 PassThruImpl *This = impl_from_IMediaSeeking(iface);
535 TRACE("(%p/%p)->(%p,%p)\n", iface, This, pEarliest, pLatest);
536 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
538 hr = IMediaSeeking_GetAvailable(seek, pEarliest, pLatest);
539 IMediaSeeking_Release(seek);
546 static HRESULT WINAPI MediaSeekingPassThru_SetRate(IMediaSeeking * iface, double dRate)
548 PassThruImpl *This = impl_from_IMediaSeeking(iface);
551 TRACE("(%p/%p)->(%e)\n", iface, This, dRate);
552 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
554 hr = IMediaSeeking_SetRate(seek, dRate);
555 IMediaSeeking_Release(seek);
562 static HRESULT WINAPI MediaSeekingPassThru_GetRate(IMediaSeeking * iface, double * dRate)
564 PassThruImpl *This = impl_from_IMediaSeeking(iface);
567 TRACE("(%p/%p)->(%p)\n", iface, This, dRate);
568 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
570 hr = IMediaSeeking_GetRate(seek, dRate);
571 IMediaSeeking_Release(seek);
578 static HRESULT WINAPI MediaSeekingPassThru_GetPreroll(IMediaSeeking * iface, LONGLONG * pPreroll)
580 PassThruImpl *This = impl_from_IMediaSeeking(iface);
583 TRACE("(%p)\n", pPreroll);
584 hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek);
586 hr = IMediaSeeking_GetPreroll(seek, pPreroll);
587 IMediaSeeking_Release(seek);
594 HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start)
596 PassThruImpl *This = impl_from_IUnknown_inner(iface);
597 EnterCriticalSection(&This->time_cs);
598 This->time_earliest = start;
600 LeaveCriticalSection(&This->time_cs);
604 HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface)
606 PassThruImpl *This = impl_from_IUnknown_inner(iface);
607 EnterCriticalSection(&This->time_cs);
609 LeaveCriticalSection(&This->time_cs);
613 HRESULT WINAPI RendererPosPassThru_EOS(IUnknown *iface)
615 PassThruImpl *This = impl_from_IUnknown_inner(iface);
618 hr = IMediaSeeking_GetStopPosition(&This->IMediaSeeking_iface, &time);
619 EnterCriticalSection(&This->time_cs);
622 This->time_earliest = time;
625 LeaveCriticalSection(&This->time_cs);
629 static const IMediaSeekingVtbl IMediaSeekingPassThru_Vtbl =
631 MediaSeekingPassThru_QueryInterface,
632 MediaSeekingPassThru_AddRef,
633 MediaSeekingPassThru_Release,
634 MediaSeekingPassThru_GetCapabilities,
635 MediaSeekingPassThru_CheckCapabilities,
636 MediaSeekingPassThru_IsFormatSupported,
637 MediaSeekingPassThru_QueryPreferredFormat,
638 MediaSeekingPassThru_GetTimeFormat,
639 MediaSeekingPassThru_IsUsingTimeFormat,
640 MediaSeekingPassThru_SetTimeFormat,
641 MediaSeekingPassThru_GetDuration,
642 MediaSeekingPassThru_GetStopPosition,
643 MediaSeekingPassThru_GetCurrentPosition,
644 MediaSeekingPassThru_ConvertTimeFormat,
645 MediaSeekingPassThru_SetPositions,
646 MediaSeekingPassThru_GetPositions,
647 MediaSeekingPassThru_GetAvailable,
648 MediaSeekingPassThru_SetRate,
649 MediaSeekingPassThru_GetRate,
650 MediaSeekingPassThru_GetPreroll
653 static HRESULT WINAPI MediaPositionPassThru_QueryInterface(IMediaPosition *iface, REFIID riid, LPVOID *ppvObj)
655 PassThruImpl *This = impl_from_IMediaPosition(iface);
657 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
659 return SeekOuter_QueryInterface(This, riid, ppvObj);
662 static ULONG WINAPI MediaPositionPassThru_AddRef(IMediaPosition *iface)
664 PassThruImpl *This = impl_from_IMediaPosition(iface);
666 TRACE("(%p/%p)->()\n", iface, This);
668 return SeekOuter_AddRef(This);
671 static ULONG WINAPI MediaPositionPassThru_Release(IMediaPosition *iface)
673 PassThruImpl *This = impl_from_IMediaPosition(iface);
675 TRACE("(%p/%p)->()\n", iface, This);
677 return SeekOuter_Release(This);
680 static HRESULT WINAPI MediaPositionPassThru_GetTypeInfoCount(IMediaPosition *iface, UINT*pctinfo)
682 PassThruImpl *This = impl_from_IMediaPosition(iface);
684 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
690 static HRESULT WINAPI MediaPositionPassThru_GetTypeInfo(IMediaPosition *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo)
692 PassThruImpl *This = impl_from_IMediaPosition(iface);
694 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
699 static HRESULT WINAPI MediaPositionPassThru_GetIDsOfNames(IMediaPosition *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId)
701 PassThruImpl *This = impl_from_IMediaPosition(iface);
703 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
708 static HRESULT WINAPI MediaPositionPassThru_Invoke(IMediaPosition *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr)
710 PassThruImpl *This = impl_from_IMediaPosition(iface);
711 FIXME("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
716 static HRESULT WINAPI MediaPositionPassThru_get_Duration(IMediaPosition *iface, REFTIME *plength)
718 PassThruImpl *This = impl_from_IMediaPosition(iface);
722 TRACE("(%p)\n", plength);
724 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
726 hr = IMediaPosition_get_Duration(pos, plength);
727 IMediaPosition_Release(pos);
734 static HRESULT WINAPI MediaPositionPassThru_put_CurrentPosition(IMediaPosition *iface, REFTIME llTime)
736 PassThruImpl *This = impl_from_IMediaPosition(iface);
740 TRACE("(%s)\n", wine_dbgstr_longlong(llTime));
742 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
744 hr = IMediaPosition_put_CurrentPosition(pos, llTime);
745 IMediaPosition_Release(pos);
752 static HRESULT WINAPI MediaPositionPassThru_get_CurrentPosition(IMediaPosition *iface, REFTIME *pllTime)
754 PassThruImpl *This = impl_from_IMediaPosition(iface);
758 TRACE("(%p)\n", pllTime);
760 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
762 hr = IMediaPosition_get_CurrentPosition(pos, pllTime);
763 IMediaPosition_Release(pos);
770 static HRESULT WINAPI MediaPositionPassThru_get_StopTime(IMediaPosition *iface, REFTIME *pllTime)
772 PassThruImpl *This = impl_from_IMediaPosition(iface);
776 TRACE("(%p)\n", pllTime);
778 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
780 hr = IMediaPosition_get_StopTime(pos, pllTime);
781 IMediaPosition_Release(pos);
788 static HRESULT WINAPI MediaPositionPassThru_put_StopTime(IMediaPosition *iface, REFTIME llTime)
790 PassThruImpl *This = impl_from_IMediaPosition(iface);
794 TRACE("(%s)\n", wine_dbgstr_longlong(llTime));
796 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
798 hr = IMediaPosition_put_StopTime(pos, llTime);
799 IMediaPosition_Release(pos);
806 static HRESULT WINAPI MediaPositionPassThru_get_PrerollTime(IMediaPosition *iface, REFTIME *pllTime)
808 PassThruImpl *This = impl_from_IMediaPosition(iface);
812 TRACE("(%p)\n", pllTime);
814 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
816 hr = IMediaPosition_get_PrerollTime(pos, pllTime);
817 IMediaPosition_Release(pos);
824 static HRESULT WINAPI MediaPositionPassThru_put_PrerollTime(IMediaPosition *iface, REFTIME llTime)
826 PassThruImpl *This = impl_from_IMediaPosition(iface);
830 TRACE("(%s)\n", wine_dbgstr_longlong(llTime));
832 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
834 hr = IMediaPosition_put_PrerollTime(pos, llTime);
835 IMediaPosition_Release(pos);
842 static HRESULT WINAPI MediaPositionPassThru_put_Rate(IMediaPosition *iface, double dRate)
844 PassThruImpl *This = impl_from_IMediaPosition(iface);
848 TRACE("(%f)\n", dRate);
850 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
852 hr = IMediaPosition_put_Rate(pos, dRate);
853 IMediaPosition_Release(pos);
860 static HRESULT WINAPI MediaPositionPassThru_get_Rate(IMediaPosition *iface, double *pdRate)
862 PassThruImpl *This = impl_from_IMediaPosition(iface);
866 TRACE("(%p)\n", pdRate);
868 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
870 hr = IMediaPosition_get_Rate(pos, pdRate);
871 IMediaPosition_Release(pos);
878 static HRESULT WINAPI MediaPositionPassThru_CanSeekForward(IMediaPosition *iface, LONG *pCanSeekForward)
880 PassThruImpl *This = impl_from_IMediaPosition(iface);
884 TRACE("(%p)\n", pCanSeekForward);
886 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
888 hr = IMediaPosition_CanSeekForward(pos, pCanSeekForward);
889 IMediaPosition_Release(pos);
896 static HRESULT WINAPI MediaPositionPassThru_CanSeekBackward(IMediaPosition *iface, LONG *pCanSeekBackward)
898 PassThruImpl *This = impl_from_IMediaPosition(iface);
902 TRACE("(%p)\n", pCanSeekBackward);
904 hr = get_connected(This, &IID_IMediaPosition, (LPVOID*)&pos);
906 hr = IMediaPosition_CanSeekBackward(pos, pCanSeekBackward);
907 IMediaPosition_Release(pos);
914 static const IMediaPositionVtbl IMediaPositionPassThru_Vtbl =
916 MediaPositionPassThru_QueryInterface,
917 MediaPositionPassThru_AddRef,
918 MediaPositionPassThru_Release,
919 MediaPositionPassThru_GetTypeInfoCount,
920 MediaPositionPassThru_GetTypeInfo,
921 MediaPositionPassThru_GetIDsOfNames,
922 MediaPositionPassThru_Invoke,
923 MediaPositionPassThru_get_Duration,
924 MediaPositionPassThru_put_CurrentPosition,
925 MediaPositionPassThru_get_CurrentPosition,
926 MediaPositionPassThru_get_StopTime,
927 MediaPositionPassThru_put_StopTime,
928 MediaPositionPassThru_get_PrerollTime,
929 MediaPositionPassThru_put_PrerollTime,
930 MediaPositionPassThru_put_Rate,
931 MediaPositionPassThru_get_Rate,
932 MediaPositionPassThru_CanSeekForward,
933 MediaPositionPassThru_CanSeekBackward