2 * Generic Implementation of IPin Interface
4 * Copyright 2003 Robert Shearman
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "quartz_private.h"
24 #include "wine/debug.h"
25 #include "wine/unicode.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(quartz
);
32 #define ALIGNDOWN(value,boundary) ((value)/(boundary)*(boundary))
33 #define ALIGNUP(value,boundary) (ALIGNDOWN((value)+(boundary)-1, (boundary)))
35 typedef HRESULT (*SendPinFunc
)( IPin
*to
, LPVOID arg
);
37 /** Helper function, there are a lot of places where the error code is inherited
38 * The following rules apply:
40 * Return the first received error code (E_NOTIMPL is ignored)
41 * If no errors occur: return the first received non-error-code that isn't S_OK
43 static HRESULT
updatehres( HRESULT original
, HRESULT
new )
45 if (FAILED( original
) || new == E_NOTIMPL
)
48 if (FAILED( new ) || original
== S_OK
)
54 /** Sends a message from a pin further to other, similar pins
55 * fnMiddle is called on each pin found further on the stream.
56 * fnEnd (can be NULL) is called when the message can't be sent any further (this is a renderer or source)
58 * If the pin given is an input pin, the message will be sent downstream to other input pins
59 * If the pin given is an output pin, the message will be sent upstream to other output pins
61 static HRESULT
SendFurther( IPin
*from
, SendPinFunc fnMiddle
, LPVOID arg
, SendPinFunc fnEnd
)
66 HRESULT hr_return
= S_OK
;
67 IEnumPins
*enumpins
= NULL
;
69 PIN_DIRECTION from_dir
;
71 IPin_QueryDirection( from
, &from_dir
);
73 hr
= IPin_QueryInternalConnections( from
, NULL
, &amount
);
74 if (hr
!= E_NOTIMPL
&& amount
)
75 FIXME("Use QueryInternalConnections!\n");
77 pin_info
.pFilter
= NULL
;
78 hr
= IPin_QueryPinInfo( from
, &pin_info
);
82 hr
= IBaseFilter_EnumPins( pin_info
.pFilter
, &enumpins
);
86 hr
= IEnumPins_Reset( enumpins
);
89 hr
= IEnumPins_Next( enumpins
, 1, &pin
, NULL
);
90 if (hr
== VFW_E_ENUM_OUT_OF_SYNC
)
92 hr
= IEnumPins_Reset( enumpins
);
99 IPin_QueryDirection( pin
, &dir
);
102 IPin
*connected
= NULL
;
105 IPin_ConnectedTo( pin
, &connected
);
110 hr_local
= fnMiddle( connected
, arg
);
111 hr_return
= updatehres( hr_return
, hr_local
);
112 IPin_Release(connected
);
129 hr_local
= fnEnd( from
, arg
);
130 hr_return
= updatehres( hr_return
, hr_local
);
135 IEnumPins_Release( enumpins
);
136 if (pin_info
.pFilter
)
137 IBaseFilter_Release( pin_info
.pFilter
);
141 static HRESULT
deliver_endofstream(IPin
* pin
, LPVOID unused
)
143 return IPin_EndOfStream( pin
);
146 static HRESULT
deliver_beginflush(IPin
* pin
, LPVOID unused
)
148 return IPin_BeginFlush( pin
);
151 static HRESULT
deliver_endflush(IPin
* pin
, LPVOID unused
)
153 return IPin_EndFlush( pin
);
156 typedef struct newsegmentargs
158 REFERENCE_TIME tStart
, tStop
;
162 static HRESULT
deliver_newsegment(IPin
*pin
, LPVOID data
)
164 newsegmentargs
*args
= data
;
165 return IPin_NewSegment(pin
, args
->tStart
, args
->tStop
, args
->rate
);
168 /*** PullPin implementation ***/
170 static HRESULT
PullPin_Init(const IPinVtbl
*PullPin_Vtbl
, const PIN_INFO
*info
,
171 SAMPLEPROC_PULL pSampleProc
, void *pUserData
, QUERYACCEPTPROC pQueryAccept
,
172 CLEANUPPROC pCleanUp
, REQUESTPROC pCustomRequest
, STOPPROCESSPROC pDone
,
173 LPCRITICAL_SECTION pCritSec
, PullPin
*pPinImpl
)
175 /* Common attributes */
176 pPinImpl
->pin
.IPin_iface
.lpVtbl
= PullPin_Vtbl
;
177 pPinImpl
->pin
.refCount
= 1;
178 pPinImpl
->pin
.pConnectedTo
= NULL
;
179 pPinImpl
->pin
.pCritSec
= pCritSec
;
180 /* avoid copying uninitialized data */
181 strcpyW(pPinImpl
->pin
.pinInfo
.achName
, info
->achName
);
182 pPinImpl
->pin
.pinInfo
.dir
= info
->dir
;
183 pPinImpl
->pin
.pinInfo
.pFilter
= info
->pFilter
;
184 ZeroMemory(&pPinImpl
->pin
.mtCurrent
, sizeof(AM_MEDIA_TYPE
));
186 /* Input pin attributes */
187 pPinImpl
->pUserData
= pUserData
;
188 pPinImpl
->fnQueryAccept
= pQueryAccept
;
189 pPinImpl
->fnSampleProc
= pSampleProc
;
190 pPinImpl
->fnCleanProc
= pCleanUp
;
191 pPinImpl
->fnDone
= pDone
;
192 pPinImpl
->fnPreConnect
= NULL
;
193 pPinImpl
->pAlloc
= NULL
;
194 pPinImpl
->prefAlloc
= NULL
;
195 pPinImpl
->pReader
= NULL
;
196 pPinImpl
->hThread
= NULL
;
197 pPinImpl
->hEventStateChanged
= CreateEventW(NULL
, TRUE
, TRUE
, NULL
);
198 pPinImpl
->thread_sleepy
= CreateEventW(NULL
, FALSE
, FALSE
, NULL
);
200 pPinImpl
->rtStart
= 0;
201 pPinImpl
->rtCurrent
= 0;
202 pPinImpl
->rtStop
= ((LONGLONG
)0x7fffffff << 32) | 0xffffffff;
203 pPinImpl
->dRate
= 1.0;
204 pPinImpl
->state
= Req_Die
;
205 pPinImpl
->fnCustomRequest
= pCustomRequest
;
206 pPinImpl
->stop_playback
= TRUE
;
208 InitializeCriticalSection(&pPinImpl
->thread_lock
);
209 pPinImpl
->thread_lock
.DebugInfo
->Spare
[0] = (DWORD_PTR
)( __FILE__
": PullPin.thread_lock");
214 HRESULT
PullPin_Construct(const IPinVtbl
*PullPin_Vtbl
, const PIN_INFO
* pPinInfo
,
215 SAMPLEPROC_PULL pSampleProc
, LPVOID pUserData
, QUERYACCEPTPROC pQueryAccept
,
216 CLEANUPPROC pCleanUp
, REQUESTPROC pCustomRequest
, STOPPROCESSPROC pDone
,
217 LPCRITICAL_SECTION pCritSec
, IPin
** ppPin
)
223 if (pPinInfo
->dir
!= PINDIR_INPUT
)
225 ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo
->dir
);
229 pPinImpl
= CoTaskMemAlloc(sizeof(*pPinImpl
));
232 return E_OUTOFMEMORY
;
234 if (SUCCEEDED(PullPin_Init(PullPin_Vtbl
, pPinInfo
, pSampleProc
, pUserData
, pQueryAccept
, pCleanUp
, pCustomRequest
, pDone
, pCritSec
, pPinImpl
)))
236 *ppPin
= &pPinImpl
->pin
.IPin_iface
;
240 CoTaskMemFree(pPinImpl
);
244 static HRESULT
PullPin_InitProcessing(PullPin
* This
);
246 HRESULT WINAPI
PullPin_ReceiveConnection(IPin
* iface
, IPin
* pReceivePin
, const AM_MEDIA_TYPE
* pmt
)
248 PIN_DIRECTION pindirReceive
;
250 PullPin
*This
= impl_PullPin_from_IPin(iface
);
252 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pReceivePin
, pmt
);
253 dump_AM_MEDIA_TYPE(pmt
);
255 EnterCriticalSection(This
->pin
.pCritSec
);
256 if (!This
->pin
.pConnectedTo
)
258 ALLOCATOR_PROPERTIES props
;
261 props
.cbBuffer
= 64 * 1024; /* 64 KB */
265 if (This
->fnQueryAccept(This
->pUserData
, pmt
) != S_OK
)
266 hr
= VFW_E_TYPE_NOT_ACCEPTED
; /* FIXME: shouldn't we just map common errors onto
267 * VFW_E_TYPE_NOT_ACCEPTED and pass the value on otherwise? */
271 IPin_QueryDirection(pReceivePin
, &pindirReceive
);
273 if (pindirReceive
!= PINDIR_OUTPUT
)
275 ERR("Can't connect from non-output pin\n");
276 hr
= VFW_E_INVALID_DIRECTION
;
280 This
->pReader
= NULL
;
282 This
->prefAlloc
= NULL
;
285 hr
= IPin_QueryInterface(pReceivePin
, &IID_IAsyncReader
, (LPVOID
*)&This
->pReader
);
288 if (SUCCEEDED(hr
) && This
->fnPreConnect
)
290 hr
= This
->fnPreConnect(iface
, pReceivePin
, &props
);
294 * Some custom filters (such as the one used by Fallout 3
295 * and Fallout: New Vegas) expect to be passed a non-NULL
296 * preferred allocator.
300 hr
= StdMemAllocator_create(NULL
, (LPVOID
*) &This
->prefAlloc
);
305 hr
= IAsyncReader_RequestAllocator(This
->pReader
, This
->prefAlloc
, &props
, &This
->pAlloc
);
310 CopyMediaType(&This
->pin
.mtCurrent
, pmt
);
311 This
->pin
.pConnectedTo
= pReceivePin
;
312 IPin_AddRef(pReceivePin
);
313 hr
= IMemAllocator_Commit(This
->pAlloc
);
317 hr
= PullPin_InitProcessing(This
);
322 IAsyncReader_Release(This
->pReader
);
323 This
->pReader
= NULL
;
325 IMemAllocator_Release(This
->prefAlloc
);
326 This
->prefAlloc
= NULL
;
328 IMemAllocator_Release(This
->pAlloc
);
333 hr
= VFW_E_ALREADY_CONNECTED
;
334 LeaveCriticalSection(This
->pin
.pCritSec
);
338 HRESULT WINAPI
PullPin_QueryInterface(IPin
* iface
, REFIID riid
, LPVOID
* ppv
)
340 PullPin
*This
= impl_PullPin_from_IPin(iface
);
342 TRACE("(%p/%p)->(%s, %p)\n", This
, iface
, qzdebugstr_guid(riid
), ppv
);
346 if (IsEqualIID(riid
, &IID_IUnknown
))
348 else if (IsEqualIID(riid
, &IID_IPin
))
350 else if (IsEqualIID(riid
, &IID_IMediaSeeking
) ||
351 IsEqualIID(riid
, &IID_IQualityControl
))
353 return IBaseFilter_QueryInterface(This
->pin
.pinInfo
.pFilter
, riid
, ppv
);
358 IUnknown_AddRef((IUnknown
*)(*ppv
));
362 FIXME("No interface for %s!\n", qzdebugstr_guid(riid
));
364 return E_NOINTERFACE
;
367 ULONG WINAPI
PullPin_Release(IPin
*iface
)
369 PullPin
*This
= impl_PullPin_from_IPin(iface
);
370 ULONG refCount
= InterlockedDecrement(&This
->pin
.refCount
);
372 TRACE("(%p)->() Release from %d\n", This
, refCount
+ 1);
376 WaitForSingleObject(This
->hEventStateChanged
, INFINITE
);
377 assert(!This
->hThread
);
380 IMemAllocator_Release(This
->prefAlloc
);
382 IMemAllocator_Release(This
->pAlloc
);
384 IAsyncReader_Release(This
->pReader
);
385 CloseHandle(This
->thread_sleepy
);
386 CloseHandle(This
->hEventStateChanged
);
387 This
->thread_lock
.DebugInfo
->Spare
[0] = 0;
388 DeleteCriticalSection(&This
->thread_lock
);
395 static void PullPin_Flush(PullPin
*This
)
397 IMediaSample
*pSample
;
398 TRACE("Flushing!\n");
402 /* Do not allow state to change while flushing */
403 EnterCriticalSection(This
->pin
.pCritSec
);
405 /* Flush outstanding samples */
406 IAsyncReader_BeginFlush(This
->pReader
);
413 IAsyncReader_WaitForNext(This
->pReader
, 0, &pSample
, &dwUser
);
418 assert(!IMediaSample_GetActualDataLength(pSample
));
420 IMediaSample_Release(pSample
);
423 IAsyncReader_EndFlush(This
->pReader
);
425 LeaveCriticalSection(This
->pin
.pCritSec
);
429 static void PullPin_Thread_Process(PullPin
*This
)
432 IMediaSample
* pSample
= NULL
;
433 ALLOCATOR_PROPERTIES allocProps
;
435 hr
= IMemAllocator_GetProperties(This
->pAlloc
, &allocProps
);
437 This
->cbAlign
= allocProps
.cbAlign
;
439 if (This
->rtCurrent
< This
->rtStart
)
440 This
->rtCurrent
= MEDIATIME_FROM_BYTES(ALIGNDOWN(BYTES_FROM_MEDIATIME(This
->rtStart
), This
->cbAlign
));
444 if (This
->rtCurrent
>= This
->rtStop
)
446 IPin_EndOfStream(&This
->pin
.IPin_iface
);
450 /* There is no sample in our buffer */
451 hr
= This
->fnCustomRequest(This
->pUserData
);
454 ERR("Request error: %x\n", hr
);
456 EnterCriticalSection(This
->pin
.pCritSec
);
457 SetEvent(This
->hEventStateChanged
);
458 LeaveCriticalSection(This
->pin
.pCritSec
);
465 TRACE("Process sample\n");
468 hr
= IAsyncReader_WaitForNext(This
->pReader
, 10000, &pSample
, &dwUser
);
470 /* Return an empty sample on error to the implementation in case it does custom parsing, so it knows it's gone */
473 hr
= This
->fnSampleProc(This
->pUserData
, pSample
, dwUser
);
477 if (hr
== VFW_E_TIMEOUT
)
480 WARN("Non-NULL sample returned with VFW_E_TIMEOUT.\n");
483 /* FIXME: Errors are not well handled yet! */
485 ERR("Processing error: %x\n", hr
);
490 IMediaSample_Release(pSample
);
493 } while (This
->rtCurrent
< This
->rtStop
&& hr
== S_OK
&& !This
->stop_playback
);
496 * Sample was rejected, and we are asked to terminate. When there is more than one buffer
497 * it is possible for a filter to have several queued samples, making it necessary to
498 * release all of these pending samples.
500 if (This
->stop_playback
|| FAILED(hr
))
507 IMediaSample_Release(pSample
);
509 IAsyncReader_WaitForNext(This
->pReader
, 0, &pSample
, &dwUser
);
513 /* Can't reset state to Sleepy here because that might race, instead PauseProcessing will do that for us
514 * Flush remaining samples
517 This
->fnDone(This
->pUserData
);
519 TRACE("End: %08x, %d\n", hr
, This
->stop_playback
);
522 static void PullPin_Thread_Pause(PullPin
*This
)
526 EnterCriticalSection(This
->pin
.pCritSec
);
527 This
->state
= Req_Sleepy
;
528 SetEvent(This
->hEventStateChanged
);
529 LeaveCriticalSection(This
->pin
.pCritSec
);
532 static void PullPin_Thread_Stop(PullPin
*This
)
534 TRACE("(%p)->()\n", This
);
536 EnterCriticalSection(This
->pin
.pCritSec
);
537 SetEvent(This
->hEventStateChanged
);
538 LeaveCriticalSection(This
->pin
.pCritSec
);
540 IBaseFilter_Release(This
->pin
.pinInfo
.pFilter
);
546 static DWORD WINAPI
PullPin_Thread_Main(LPVOID pv
)
549 CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
555 WaitForSingleObject(This
->thread_sleepy
, INFINITE
);
557 TRACE("State: %d\n", This
->state
);
561 case Req_Die
: PullPin_Thread_Stop(This
); break;
562 case Req_Run
: PullPin_Thread_Process(This
); break;
563 case Req_Pause
: PullPin_Thread_Pause(This
); break;
564 case Req_Sleepy
: ERR("Should not be signalled with SLEEPY!\n"); break;
565 default: ERR("Unknown state request: %d\n", This
->state
); break;
571 static HRESULT
PullPin_InitProcessing(PullPin
* This
)
575 TRACE("(%p)->()\n", This
);
577 /* if we are connected */
582 WaitForSingleObject(This
->hEventStateChanged
, INFINITE
);
583 EnterCriticalSection(This
->pin
.pCritSec
);
585 assert(!This
->hThread
);
586 assert(This
->state
== Req_Die
);
587 assert(This
->stop_playback
);
588 assert(WaitForSingleObject(This
->thread_sleepy
, 0) == WAIT_TIMEOUT
);
589 This
->state
= Req_Sleepy
;
591 /* AddRef the filter to make sure it and its pins will be around
592 * as long as the thread */
593 IBaseFilter_AddRef(This
->pin
.pinInfo
.pFilter
);
596 This
->hThread
= CreateThread(NULL
, 0, PullPin_Thread_Main
, This
, 0, &dwThreadId
);
599 hr
= HRESULT_FROM_WIN32(GetLastError());
600 IBaseFilter_Release(This
->pin
.pinInfo
.pFilter
);
605 SetEvent(This
->hEventStateChanged
);
606 /* If assert fails, that means a command was not processed before the thread previously terminated */
608 LeaveCriticalSection(This
->pin
.pCritSec
);
611 TRACE(" -- %x\n", hr
);
616 HRESULT
PullPin_StartProcessing(PullPin
* This
)
618 /* if we are connected */
619 TRACE("(%p)->()\n", This
);
622 assert(This
->hThread
);
624 PullPin_WaitForStateChange(This
, INFINITE
);
626 assert(This
->state
== Req_Sleepy
);
629 assert(WaitForSingleObject(This
->thread_sleepy
, 0) == WAIT_TIMEOUT
);
630 This
->state
= Req_Run
;
631 This
->stop_playback
= FALSE
;
632 ResetEvent(This
->hEventStateChanged
);
633 SetEvent(This
->thread_sleepy
);
639 HRESULT
PullPin_PauseProcessing(PullPin
* This
)
641 /* if we are connected */
642 TRACE("(%p)->()\n", This
);
645 assert(This
->hThread
);
647 PullPin_WaitForStateChange(This
, INFINITE
);
649 EnterCriticalSection(This
->pin
.pCritSec
);
651 assert(!This
->stop_playback
);
652 assert(This
->state
== Req_Run
|| This
->state
== Req_Sleepy
);
654 assert(WaitForSingleObject(This
->thread_sleepy
, 0) == WAIT_TIMEOUT
);
656 This
->state
= Req_Pause
;
657 This
->stop_playback
= TRUE
;
658 ResetEvent(This
->hEventStateChanged
);
659 SetEvent(This
->thread_sleepy
);
661 /* Release any outstanding samples */
664 IMediaSample
*pSample
;
670 IAsyncReader_WaitForNext(This
->pReader
, 0, &pSample
, &dwUser
);
672 IMediaSample_Release(pSample
);
676 LeaveCriticalSection(This
->pin
.pCritSec
);
682 static HRESULT
PullPin_StopProcessing(PullPin
* This
)
684 TRACE("(%p)->()\n", This
);
686 /* if we are alive */
687 assert(This
->hThread
);
689 PullPin_WaitForStateChange(This
, INFINITE
);
691 assert(This
->state
== Req_Pause
|| This
->state
== Req_Sleepy
);
693 This
->stop_playback
= TRUE
;
694 This
->state
= Req_Die
;
695 assert(WaitForSingleObject(This
->thread_sleepy
, 0) == WAIT_TIMEOUT
);
696 ResetEvent(This
->hEventStateChanged
);
697 SetEvent(This
->thread_sleepy
);
701 HRESULT
PullPin_WaitForStateChange(PullPin
* This
, DWORD dwMilliseconds
)
703 if (WaitForSingleObject(This
->hEventStateChanged
, dwMilliseconds
) == WAIT_TIMEOUT
)
708 HRESULT WINAPI
PullPin_QueryAccept(IPin
* iface
, const AM_MEDIA_TYPE
* pmt
)
710 PullPin
*This
= impl_PullPin_from_IPin(iface
);
712 TRACE("(%p/%p)->(%p)\n", This
, iface
, pmt
);
714 return (This
->fnQueryAccept(This
->pUserData
, pmt
) == S_OK
? S_OK
: S_FALSE
);
717 HRESULT WINAPI
PullPin_EndOfStream(IPin
* iface
)
719 PullPin
*This
= impl_PullPin_from_IPin(iface
);
720 HRESULT hr
= S_FALSE
;
722 TRACE("(%p)->()\n", iface
);
724 EnterCriticalSection(This
->pin
.pCritSec
);
725 hr
= SendFurther( iface
, deliver_endofstream
, NULL
, NULL
);
726 SetEvent(This
->hEventStateChanged
);
727 LeaveCriticalSection(This
->pin
.pCritSec
);
732 HRESULT WINAPI
PullPin_BeginFlush(IPin
* iface
)
734 PullPin
*This
= impl_PullPin_from_IPin(iface
);
735 TRACE("(%p)->()\n", This
);
737 EnterCriticalSection(This
->pin
.pCritSec
);
739 SendFurther( iface
, deliver_beginflush
, NULL
, NULL
);
741 LeaveCriticalSection(This
->pin
.pCritSec
);
743 EnterCriticalSection(&This
->thread_lock
);
746 IAsyncReader_BeginFlush(This
->pReader
);
747 PullPin_WaitForStateChange(This
, INFINITE
);
749 if (This
->hThread
&& This
->state
== Req_Run
)
751 PullPin_PauseProcessing(This
);
752 PullPin_WaitForStateChange(This
, INFINITE
);
755 LeaveCriticalSection(&This
->thread_lock
);
757 EnterCriticalSection(This
->pin
.pCritSec
);
759 This
->fnCleanProc(This
->pUserData
);
761 LeaveCriticalSection(This
->pin
.pCritSec
);
766 HRESULT WINAPI
PullPin_EndFlush(IPin
* iface
)
768 PullPin
*This
= impl_PullPin_from_IPin(iface
);
770 TRACE("(%p)->()\n", iface
);
772 /* Send further first: Else a race condition might terminate processing early */
773 EnterCriticalSection(This
->pin
.pCritSec
);
774 SendFurther( iface
, deliver_endflush
, NULL
, NULL
);
775 LeaveCriticalSection(This
->pin
.pCritSec
);
777 EnterCriticalSection(&This
->thread_lock
);
782 IAsyncReader_EndFlush(This
->pReader
);
784 IBaseFilter_GetState(This
->pin
.pinInfo
.pFilter
, INFINITE
, &state
);
786 if (state
!= State_Stopped
)
787 PullPin_StartProcessing(This
);
789 PullPin_WaitForStateChange(This
, INFINITE
);
791 LeaveCriticalSection(&This
->thread_lock
);
796 HRESULT WINAPI
PullPin_Disconnect(IPin
*iface
)
799 PullPin
*This
= impl_PullPin_from_IPin(iface
);
803 EnterCriticalSection(This
->pin
.pCritSec
);
805 if (FAILED(hr
= IMemAllocator_Decommit(This
->pAlloc
)))
806 ERR("Allocator decommit failed with error %x. Possible memory leak\n", hr
);
808 if (This
->pin
.pConnectedTo
)
810 IPin_Release(This
->pin
.pConnectedTo
);
811 This
->pin
.pConnectedTo
= NULL
;
812 PullPin_StopProcessing(This
);
814 FreeMediaType(&This
->pin
.mtCurrent
);
815 ZeroMemory(&This
->pin
.mtCurrent
, sizeof(This
->pin
.mtCurrent
));
821 LeaveCriticalSection(This
->pin
.pCritSec
);
823 WaitForSingleObject(This
->hThread
, INFINITE
);
824 CloseHandle(This
->hThread
);
825 This
->hThread
= NULL
;
830 HRESULT WINAPI
PullPin_NewSegment(IPin
* iface
, REFERENCE_TIME tStart
, REFERENCE_TIME tStop
, double dRate
)
833 FIXME("(%p)->(%s, %s, %g) stub\n", iface
, wine_dbgstr_longlong(tStart
), wine_dbgstr_longlong(tStop
), dRate
);
835 args
.tStart
= tStart
;
839 return SendFurther( iface
, deliver_newsegment
, &args
, NULL
);