25#include "wine/unicode.h"
65 TRACE(
"(%p/%p)->(%p, %p)\n",
This, renderer, pReceivePin, pmt);
72 hr = renderer->
pFuncsTable->pfnCompleteConnect(renderer, pReceivePin);
204 IPin_AddRef(&
This->pInputPin->pin.IPin_iface);
205 return &
This->pInputPin->pin.IPin_iface;
216 return This->pFuncsTable->pfnCheckMediaType(
This, pmt);
249 This->pFuncsTable = pBaseFuncsTable;
253 piInput.pFilter = &
This->filter.IBaseFilter_iface;
262 &
This->pInputPin->pin.IPin_iface, &
This->pPosition);
267 This->csRenderLock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": BaseRenderer.csRenderLock");
285 return IUnknown_QueryInterface(
This->pPosition,
riid,
ppv);
288 *
ppv = &
This->qcimpl->IQualityControl_iface;
305 if (
SUCCEEDED(IPin_ConnectedTo(&
This->pInputPin->pin.IPin_iface, &pConnectedTo)))
307 IPin_Disconnect(pConnectedTo);
308 IPin_Release(pConnectedTo);
310 IPin_Disconnect(&
This->pInputPin->pin.IPin_iface);
311 IPin_Release(&
This->pInputPin->pin.IPin_iface);
314 IUnknown_Release(
This->pPosition);
316 This->csRenderLock.DebugInfo->Spare[0] = 0;
337 if (
This->pInputPin->end_of_stream ||
This->pInputPin->flushing)
340 if (
This->filter.state == State_Stopped)
343 if (IMediaSample_GetMediaType(pSample, &pmt) ==
S_OK)
351 This->pMediaSample = pSample;
352 IMediaSample_AddRef(pSample);
354 if (
This->pFuncsTable->pfnPrepareReceive)
355 hr =
This->pFuncsTable->pfnPrepareReceive(
This, pSample);
364 if (
This->pFuncsTable->pfnPrepareRender)
365 This->pFuncsTable->pfnPrepareRender(
This);
368 if (
This->filter.state == State_Paused )
370 if (
This->pFuncsTable->pfnOnReceiveFirstSample)
371 This->pFuncsTable->pfnOnReceiveFirstSample(
This, pSample);
381 if (
This->pFuncsTable->pfnShouldDrawSampleNow)
382 hr =
This->pFuncsTable->pfnShouldDrawSampleNow(
This, pSample, &
start, &stop);
388 if (
This->pFuncsTable->pfnOnWaitStart)
389 This->pFuncsTable->pfnOnWaitStart(
This);
395 if (
This->pFuncsTable->pfnOnWaitEnd)
396 This->pFuncsTable->pfnOnWaitEnd(
This);
409 hr =
This->pFuncsTable->pfnDoRenderSample(
This, pSample);
432 *ppPin = &
This->pInputPin->pin.IPin_iface;
449 if (
This->pFuncsTable->pfnOnStopStreaming)
450 This->pFuncsTable->pfnOnStopStreaming(
This);
451 This->filter.state = State_Stopped;
468 This->filter.rtStreamStart = tStart;
469 if (
This->filter.state == State_Running)
475 if (
This->pInputPin->pin.pConnectedTo)
479 else if (
This->filter.filterInfo.pGraph)
482 hr = IFilterGraph_QueryInterface(
This->filter.filterInfo.pGraph, &IID_IMediaEventSink, (
LPVOID*)&pEventSink);
486 IMediaEventSink_Release(pEventSink);
493 if (
This->pFuncsTable->pfnOnStartStreaming)
494 This->pFuncsTable->pfnOnStartStreaming(
This);
495 if (
This->filter.state == State_Stopped)
498 This->filter.state = State_Running;
514 if (
This->filter.state != State_Paused)
516 if (
This->filter.state == State_Stopped)
518 if (
This->pInputPin->pin.pConnectedTo)
522 else if (
This->pFuncsTable->pfnOnStopStreaming)
523 This->pFuncsTable->pfnOnStopStreaming(
This);
525 if (
This->filter.state == State_Stopped)
528 This->filter.state = State_Paused;
555 TRACE(
"(%p)->(%d, %p)\n",
This, dwMilliSecsTimeout, pState);
573 TRACE(
"(%p)\n", iface);
581 IMediaEventSink_Release(pEventSink);
592 TRACE(
"(%p)\n", iface);
601 TRACE(
"(%p)\n", iface);
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
#define IsEqualIID(riid1, riid2)
void QualityControlRender_EndRender(QualityControlImpl *This)
void QualityControlRender_BeginRender(QualityControlImpl *This)
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface)
void QualityControlRender_Start(QualityControlImpl *This, REFERENCE_TIME tStart)
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
void QualityControlImpl_Destroy(QualityControlImpl *This)
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface)
void QualityControlRender_DoQOS(QualityControlImpl *priv)
HRESULT QualityControlRender_WaitFor(QualityControlImpl *This, IMediaSample *sample, HANDLE ev)
HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv)
void QualityControlRender_SetClock(QualityControlImpl *This, IReferenceClock *clock)
HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify)
static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin *iface)
HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
static IPin *WINAPI BaseRenderer_GetPin(BaseFilter *iface, int pos)
HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer *iface)
static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter *iface)
static LONG WINAPI BaseRenderer_GetPinCount(BaseFilter *iface)
HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter *iface)
static const IPinVtbl BaseRenderer_InputPin_Vtbl
static const WCHAR wcsAltInputPinName[]
HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
static BaseRenderer * impl_from_IBaseFilter(IBaseFilter *iface)
static HRESULT WINAPI BaseRenderer_Input_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter *iface)
static HRESULT WINAPI BaseRenderer_Receive(BaseInputPin *pin, IMediaSample *pSample)
HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample *pSample)
HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface)
static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin *iface)
static BaseInputPin * impl_BaseInputPin_from_IPin(IPin *iface)
static const BaseFilterFuncTable RendererBaseFilterFuncTable
HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer *iface)
static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin *iface)
static BaseRenderer * impl_from_BaseFilter(BaseFilter *iface)
static const BaseInputPinFuncTable input_BaseInputFuncTable
HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
static HRESULT WINAPI BaseRenderer_InputPin_Disconnect(IPin *iface)
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
static const IQualityControlVtbl Renderer_QualityControl_Vtbl
HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable *pBaseFuncsTable)
HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer *iface)
static const WCHAR wcsInputPinName[]
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin *iface)
HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface)
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
ULONG WINAPI BaseInputPinImpl_Release(IPin *iface)
HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
HRESULT WINAPI BasePinImpl_ConnectedTo(IPin *iface, IPin **ppPin)
HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
HRESULT WINAPI RendererPosPassThru_EOS(IUnknown *iface)
HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, LPWSTR *Id)
HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO *pPinInfo, const BaseInputPinFuncTable *pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin **ppPin)
HRESULT WINAPI CreatePosPassThru(IUnknown *pUnkOuter, BOOL bRenderer, IPin *pPin, IUnknown **ppPassThru)
HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *pInfo)
HRESULT WINAPI BaseFilter_Destroy(BaseFilter *This)
HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin *iface)
LONG WINAPI BasePinImpl_GetMediaTypeVersion(BasePin *This)
HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt)
HRESULT WINAPI BasePinImpl_Disconnect(IPin *iface)
HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *pPinDir)
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start)
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pConnector, const AM_MEDIA_TYPE *pmt)
HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin *iface)
HRESULT WINAPI BaseFilter_Init(BaseFilter *This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable *pBaseFuncsTable)
ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
REFERENCE_TIME rtStreamStart
CRITICAL_SECTION csFilter
CRITICAL_SECTION csRenderLock
struct QualityControlImpl * qcimpl
const struct BaseRendererFuncTable * pFuncsTable
IMediaSample * pMediaSample
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_E_WRONG_STATE
#define VFW_S_STATE_INTERMEDIATE
#define VFW_E_SAMPLE_REJECTED
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)