ReactOS 0.4.15-dev-8131-g4988de4
renderer.c File Reference
#include "dshow.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/strmbase.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "strmbase_private.h"
Include dependency graph for renderer.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (strmbase)
 
static BaseInputPinimpl_BaseInputPin_from_IPin (IPin *iface)
 
static BaseRendererimpl_from_IBaseFilter (IBaseFilter *iface)
 
static BaseRendererimpl_from_BaseFilter (BaseFilter *iface)
 
static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection (IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
 
static HRESULT WINAPI BaseRenderer_InputPin_Disconnect (IPin *iface)
 
static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream (IPin *iface)
 
static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush (IPin *iface)
 
static HRESULT WINAPI BaseRenderer_InputPin_EndFlush (IPin *iface)
 
static IPin *WINAPI BaseRenderer_GetPin (BaseFilter *iface, int pos)
 
static LONG WINAPI BaseRenderer_GetPinCount (BaseFilter *iface)
 
static HRESULT WINAPI BaseRenderer_Input_CheckMediaType (BasePin *pin, const AM_MEDIA_TYPE *pmt)
 
static HRESULT WINAPI BaseRenderer_Receive (BaseInputPin *pin, IMediaSample *pSample)
 
HRESULT WINAPI BaseRenderer_Init (BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable *pBaseFuncsTable)
 
HRESULT WINAPI BaseRendererImpl_QueryInterface (IBaseFilter *iface, REFIID riid, LPVOID *ppv)
 
ULONG WINAPI BaseRendererImpl_Release (IBaseFilter *iface)
 
HRESULT WINAPI BaseRendererImpl_Receive (BaseRenderer *This, IMediaSample *pSample)
 
HRESULT WINAPI BaseRendererImpl_FindPin (IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
 
HRESULT WINAPI BaseRendererImpl_Stop (IBaseFilter *iface)
 
HRESULT WINAPI BaseRendererImpl_Run (IBaseFilter *iface, REFERENCE_TIME tStart)
 
HRESULT WINAPI BaseRendererImpl_Pause (IBaseFilter *iface)
 
HRESULT WINAPI BaseRendererImpl_SetSyncSource (IBaseFilter *iface, IReferenceClock *clock)
 
HRESULT WINAPI BaseRendererImpl_GetState (IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
 
HRESULT WINAPI BaseRendererImpl_EndOfStream (BaseRenderer *iface)
 
HRESULT WINAPI BaseRendererImpl_BeginFlush (BaseRenderer *iface)
 
HRESULT WINAPI BaseRendererImpl_EndFlush (BaseRenderer *iface)
 
HRESULT WINAPI BaseRendererImpl_ClearPendingSample (BaseRenderer *iface)
 

Variables

static const WCHAR wcsInputPinName [] = {'i','n','p','u','t',' ','p','i','n',0}
 
static const WCHAR wcsAltInputPinName [] = {'I','n',0}
 
static const IQualityControlVtbl Renderer_QualityControl_Vtbl
 
static const IPinVtbl BaseRenderer_InputPin_Vtbl
 
static const BaseFilterFuncTable RendererBaseFilterFuncTable
 
static const BaseInputPinFuncTable input_BaseInputFuncTable
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file renderer.c.

Function Documentation

◆ BaseRenderer_GetPin()

static IPin *WINAPI BaseRenderer_GetPin ( BaseFilter iface,
int  pos 
)
static

Definition at line 197 of file renderer.c.

198{
200
201 if (pos >= 1 || pos < 0)
202 return NULL;
203
204 IPin_AddRef(&This->pInputPin->pin.IPin_iface);
205 return &This->pInputPin->pin.IPin_iface;
206}
#define NULL
Definition: types.h:112
static BaseRenderer * impl_from_BaseFilter(BaseFilter *iface)
Definition: renderer.c:46

◆ BaseRenderer_GetPinCount()

static LONG WINAPI BaseRenderer_GetPinCount ( BaseFilter iface)
static

Definition at line 208 of file renderer.c.

209{
210 return 1;
211}

◆ BaseRenderer_Init()

HRESULT WINAPI BaseRenderer_Init ( BaseRenderer This,
const IBaseFilterVtbl *  Vtbl,
IUnknown pUnkOuter,
const CLSID pClsid,
DWORD_PTR  DebugInfo,
const BaseRendererFuncTable pBaseFuncsTable 
)

Definition at line 241 of file renderer.c.

243{
244 PIN_INFO piInput;
245 HRESULT hr;
246
247 BaseFilter_Init(&This->filter, Vtbl, pClsid, DebugInfo, &RendererBaseFilterFuncTable);
248
249 This->pFuncsTable = pBaseFuncsTable;
250
251 /* construct input pin */
252 piInput.dir = PINDIR_INPUT;
253 piInput.pFilter = &This->filter.IBaseFilter_iface;
254 lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
255
257 &input_BaseInputFuncTable, &This->filter.csFilter, NULL, (IPin **)&This->pInputPin);
258
259 if (SUCCEEDED(hr))
260 {
261 hr = CreatePosPassThru(pUnkOuter ? pUnkOuter: (IUnknown *)&This->filter.IBaseFilter_iface, TRUE,
262 &This->pInputPin->pin.IPin_iface, &This->pPosition);
263 if (FAILED(hr))
264 return hr;
265
266 InitializeCriticalSection(&This->csRenderLock);
267 This->csRenderLock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": BaseRenderer.csRenderLock");
268 This->evComplete = CreateEventW(NULL, TRUE, TRUE, NULL);
269 This->ThreadSignal = CreateEventW(NULL, TRUE, TRUE, NULL);
270 This->RenderEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
271 This->pMediaSample = NULL;
272
273 QualityControlImpl_Create(&This->pInputPin->pin.IPin_iface, &This->filter.IBaseFilter_iface, &This->qcimpl);
274 This->qcimpl->IQualityControl_iface.lpVtbl = &Renderer_QualityControl_Vtbl;
275 }
276
277 return hr;
278}
@ PINDIR_INPUT
Definition: axcore.idl:41
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpynW
Definition: compat.h:738
Definition: axcore.idl:92
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv)
static const IPinVtbl BaseRenderer_InputPin_Vtbl
Definition: renderer.c:175
static const BaseFilterFuncTable RendererBaseFilterFuncTable
Definition: renderer.c:225
static const BaseInputPinFuncTable input_BaseInputFuncTable
Definition: renderer.c:230
static const IQualityControlVtbl Renderer_QualityControl_Vtbl
Definition: renderer.c:51
static const WCHAR wcsInputPinName[]
Definition: renderer.c:33
HRESULT hr
Definition: shlfolder.c:183
HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO *pPinInfo, const BaseInputPinFuncTable *pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin **ppPin)
Definition: pin.c:1189
HRESULT WINAPI CreatePosPassThru(IUnknown *pUnkOuter, BOOL bRenderer, IPin *pPin, IUnknown **ppPassThru)
Definition: pospass.c:233
HRESULT WINAPI BaseFilter_Init(BaseFilter *This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable *pBaseFuncsTable)
Definition: filter.c:196
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define DWORD_PTR
Definition: treelist.c:76

Referenced by DSoundRender_create(), NullRenderer_create(), VideoRenderer_create(), and vmr_create().

◆ BaseRenderer_Input_CheckMediaType()

static HRESULT WINAPI BaseRenderer_Input_CheckMediaType ( BasePin pin,
const AM_MEDIA_TYPE pmt 
)
static

Definition at line 213 of file renderer.c.

214{
215 BaseRenderer *This = impl_from_IBaseFilter(pin->pinInfo.pFilter);
216 return This->pFuncsTable->pfnCheckMediaType(This, pmt);
217}
static BaseRenderer * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: renderer.c:41
Definition: regsvr.c:104

◆ BaseRenderer_InputPin_BeginFlush()

static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush ( IPin iface)
static

Definition at line 125 of file renderer.c.

126{
128 BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
129 HRESULT hr;
130
131 TRACE("(%p/%p)->()\n", This, iface);
132
135 EnterCriticalSection(This->pin.pCritSec);
137 if (SUCCEEDED(hr))
138 {
139 if (pFilter->pFuncsTable->pfnBeginFlush)
140 hr = pFilter->pFuncsTable->pfnBeginFlush(pFilter);
141 else
143 }
144 LeaveCriticalSection(This->pin.pCritSec);
147 return hr;
148}
static BaseInputPin * impl_BaseInputPin_from_IPin(IPin *iface)
Definition: renderer.c:36
HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer *iface)
Definition: renderer.c:590
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin *iface)
Definition: pin.c:968
CRITICAL_SECTION csFilter
Definition: strmbase.h:165
CRITICAL_SECTION csRenderLock
Definition: strmbase.h:584
BaseFilter filter
Definition: strmbase.h:580
const struct BaseRendererFuncTable * pFuncsTable
Definition: strmbase.h:593
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

◆ BaseRenderer_InputPin_Disconnect()

static HRESULT WINAPI BaseRenderer_InputPin_Disconnect ( IPin iface)
static

Definition at line 79 of file renderer.c.

80{
82 BaseRenderer *renderer = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
83 HRESULT hr;
84
85 TRACE("(%p/%p)\n", This, renderer);
86
87 EnterCriticalSection(This->pin.pCritSec);
89 if (SUCCEEDED(hr))
90 {
91 if (renderer->pFuncsTable->pfnBreakConnect)
92 hr = renderer->pFuncsTable->pfnBreakConnect(renderer);
93 }
95 LeaveCriticalSection(This->pin.pCritSec);
96
97 return hr;
98}
HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface)
Definition: renderer.c:609
HRESULT WINAPI BasePinImpl_Disconnect(IPin *iface)
Definition: pin.c:197

◆ BaseRenderer_InputPin_EndFlush()

static HRESULT WINAPI BaseRenderer_InputPin_EndFlush ( IPin iface)
static

Definition at line 150 of file renderer.c.

151{
153 BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
154 HRESULT hr;
155
156 TRACE("(%p/%p)->()\n", This, pFilter);
157
160 EnterCriticalSection(This->pin.pCritSec);
162 if (SUCCEEDED(hr))
163 {
164 if (pFilter->pFuncsTable->pfnEndFlush)
165 hr = pFilter->pFuncsTable->pfnEndFlush(pFilter);
166 else
167 hr = BaseRendererImpl_EndFlush(pFilter);
168 }
169 LeaveCriticalSection(This->pin.pCritSec);
172 return hr;
173}
HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer *iface)
Definition: renderer.c:599
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin *iface)
Definition: pin.c:988

◆ BaseRenderer_InputPin_EndOfStream()

static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream ( IPin iface)
static

Definition at line 100 of file renderer.c.

101{
102 HRESULT hr;
104 BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
105
106 TRACE("(%p/%p)->()\n", This, pFilter);
107
111 EnterCriticalSection(This->pin.pCritSec);
112 if (SUCCEEDED(hr))
113 {
114 if (pFilter->pFuncsTable->pfnEndOfStream)
115 hr = pFilter->pFuncsTable->pfnEndOfStream(pFilter);
116 else
118 }
119 LeaveCriticalSection(This->pin.pCritSec);
122 return hr;
123}
HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer *iface)
Definition: renderer.c:567
HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin *iface)
Definition: pin.c:944

◆ BaseRenderer_InputPin_ReceiveConnection()

static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection ( IPin iface,
IPin pReceivePin,
const AM_MEDIA_TYPE pmt 
)
static

Definition at line 59 of file renderer.c.

60{
62 BaseRenderer *renderer = impl_from_IBaseFilter(This->pin.pinInfo.pFilter);
63 HRESULT hr;
64
65 TRACE("(%p/%p)->(%p, %p)\n", This, renderer, pReceivePin, pmt);
66
67 EnterCriticalSection(This->pin.pCritSec);
68 hr = BaseInputPinImpl_ReceiveConnection(iface, pReceivePin, pmt);
69 if (SUCCEEDED(hr))
70 {
71 if (renderer->pFuncsTable->pfnCompleteConnect)
72 hr = renderer->pFuncsTable->pfnCompleteConnect(renderer, pReceivePin);
73 }
74 LeaveCriticalSection(This->pin.pCritSec);
75
76 return hr;
77}
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:889

◆ BaseRenderer_Receive()

static HRESULT WINAPI BaseRenderer_Receive ( BaseInputPin pin,
IMediaSample pSample 
)
static

Definition at line 219 of file renderer.c.

220{
221 BaseRenderer *This = impl_from_IBaseFilter(pin->pin.pinInfo.pFilter);
222 return BaseRendererImpl_Receive(This, pSample);
223}
HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample *pSample)
Definition: renderer.c:329

◆ BaseRendererImpl_BeginFlush()

HRESULT WINAPI BaseRendererImpl_BeginFlush ( BaseRenderer iface)

Definition at line 590 of file renderer.c.

591{
592 TRACE("(%p)\n", iface);
594 SetEvent(iface->ThreadSignal);
595 SetEvent(iface->RenderEvent);
596 return S_OK;
597}
#define S_OK
Definition: intsafe.h:52
HANDLE ThreadSignal
Definition: strmbase.h:586
HANDLE RenderEvent
Definition: strmbase.h:587
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733

Referenced by BaseRenderer_InputPin_BeginFlush(), and DSoundRender_BeginFlush().

◆ BaseRendererImpl_ClearPendingSample()

HRESULT WINAPI BaseRendererImpl_ClearPendingSample ( BaseRenderer iface)

Definition at line 609 of file renderer.c.

610{
611 if (iface->pMediaSample)
612 {
613 IMediaSample_Release(iface->pMediaSample);
614 iface->pMediaSample = NULL;
615 }
616 return S_OK;
617}
IMediaSample * pMediaSample
Definition: strmbase.h:588

Referenced by BaseRenderer_InputPin_Disconnect(), BaseRendererImpl_BeginFlush(), BaseRendererImpl_Pause(), BaseRendererImpl_Receive(), BaseRendererImpl_Release(), and BaseRendererImpl_Run().

◆ BaseRendererImpl_EndFlush()

HRESULT WINAPI BaseRendererImpl_EndFlush ( BaseRenderer iface)

Definition at line 599 of file renderer.c.

600{
601 TRACE("(%p)\n", iface);
604 ResetEvent(iface->ThreadSignal);
605 ResetEvent(iface->RenderEvent);
606 return S_OK;
607}
void QualityControlRender_Start(QualityControlImpl *This, REFERENCE_TIME tStart)
HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface)
Definition: pospass.c:611
REFERENCE_TIME rtStreamStart
Definition: strmbase.h:168
struct QualityControlImpl * qcimpl
Definition: strmbase.h:591
IUnknown * pPosition
Definition: strmbase.h:583
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714

Referenced by BaseRenderer_InputPin_EndFlush(), DSoundRender_EndFlush(), and VideoRenderer_EndFlush().

◆ BaseRendererImpl_EndOfStream()

HRESULT WINAPI BaseRendererImpl_EndOfStream ( BaseRenderer iface)

Definition at line 567 of file renderer.c.

568{
569 IMediaEventSink* pEventSink;
570 IFilterGraph *graph;
571 HRESULT hr = S_OK;
572
573 TRACE("(%p)\n", iface);
574
575 graph = iface->filter.filterInfo.pGraph;
576 if (graph)
577 { hr = IFilterGraph_QueryInterface(iface->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
578 if (SUCCEEDED(hr))
579 {
580 hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, (LONG_PTR)iface);
581 IMediaEventSink_Release(pEventSink);
582 }
583 }
585 SetEvent(iface->evComplete);
586
587 return hr;
588}
#define EC_COMPLETE
Definition: evcode.h:17
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HRESULT WINAPI RendererPosPassThru_EOS(IUnknown *iface)
Definition: pospass.c:620
FILTER_INFO filterInfo
Definition: strmbase.h:170
HANDLE evComplete
Definition: strmbase.h:585

Referenced by BaseRenderer_InputPin_EndOfStream(), and DSoundRender_EndOfStream().

◆ BaseRendererImpl_FindPin()

HRESULT WINAPI BaseRendererImpl_FindPin ( IBaseFilter iface,
LPCWSTR  Id,
IPin **  ppPin 
)

Definition at line 421 of file renderer.c.

422{
424
425 TRACE("(%p)->(%s,%p)\n", This, debugstr_w(Id), ppPin);
426
427 if (!Id || !ppPin)
428 return E_POINTER;
429
431 {
432 *ppPin = &This->pInputPin->pin.IPin_iface;
433 IPin_AddRef(*ppPin);
434 return S_OK;
435 }
436 *ppPin = NULL;
437 return VFW_E_NOT_FOUND;
438}
DWORD Id
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR wcsAltInputPinName[]
Definition: renderer.c:34
#define VFW_E_NOT_FOUND
Definition: vfwmsgs.h:61
#define E_POINTER
Definition: winerror.h:2365

◆ BaseRendererImpl_GetState()

HRESULT WINAPI BaseRendererImpl_GetState ( IBaseFilter iface,
DWORD  dwMilliSecsTimeout,
FILTER_STATE *  pState 
)

Definition at line 550 of file renderer.c.

551{
552 HRESULT hr;
554
555 TRACE("(%p)->(%d, %p)\n", This, dwMilliSecsTimeout, pState);
556
557 if (WaitForSingleObject(This->evComplete, dwMilliSecsTimeout) == WAIT_TIMEOUT)
559 else
560 hr = S_OK;
561
562 BaseFilterImpl_GetState(iface, dwMilliSecsTimeout, pState);
563
564 return hr;
565}
#define WAIT_TIMEOUT
Definition: dderror.h:14
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: filter.c:87
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define VFW_S_STATE_INTERMEDIATE
Definition: vfwmsgs.h:21

◆ BaseRendererImpl_Pause()

HRESULT WINAPI BaseRendererImpl_Pause ( IBaseFilter iface)

Definition at line 506 of file renderer.c.

507{
509
510 TRACE("(%p)->()\n", This);
511
512 EnterCriticalSection(&This->csRenderLock);
513 {
514 if (This->filter.state != State_Paused)
515 {
516 if (This->filter.state == State_Stopped)
517 {
518 if (This->pInputPin->pin.pConnectedTo)
519 ResetEvent(This->evComplete);
520 This->pInputPin->end_of_stream = FALSE;
521 }
522 else if (This->pFuncsTable->pfnOnStopStreaming)
523 This->pFuncsTable->pfnOnStopStreaming(This);
524
525 if (This->filter.state == State_Stopped)
527 ResetEvent(This->RenderEvent);
528 This->filter.state = State_Paused;
529 }
530 }
531 ResetEvent(This->ThreadSignal);
532 LeaveCriticalSection(&This->csRenderLock);
533
534 return S_OK;
535}

◆ BaseRendererImpl_QueryInterface()

HRESULT WINAPI BaseRendererImpl_QueryInterface ( IBaseFilter iface,
REFIID  riid,
LPVOID ppv 
)

Definition at line 280 of file renderer.c.

281{
283
284 if (IsEqualIID(riid, &IID_IMediaSeeking) || IsEqualIID(riid, &IID_IMediaPosition))
285 return IUnknown_QueryInterface(This->pPosition, riid, ppv);
286 else if (IsEqualIID(riid, &IID_IQualityControl))
287 {
288 *ppv = &This->qcimpl->IQualityControl_iface;
289 IUnknown_AddRef((IUnknown *)(*ppv));
290 return S_OK;
291 }
292 else
293 return BaseFilterImpl_QueryInterface(iface, riid, ppv);
294}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: filter.c:37

Referenced by DSoundRender_QueryInterface(), NullRendererInner_QueryInterface(), VideoRendererInner_QueryInterface(), and VMR9Inner_QueryInterface().

◆ BaseRendererImpl_Receive()

HRESULT WINAPI BaseRendererImpl_Receive ( BaseRenderer This,
IMediaSample pSample 
)

Definition at line 329 of file renderer.c.

330{
331 HRESULT hr = S_OK;
332 REFERENCE_TIME start, stop;
333 AM_MEDIA_TYPE *pmt;
334
335 TRACE("(%p)->%p\n", This, pSample);
336
337 if (This->pInputPin->end_of_stream || This->pInputPin->flushing)
338 return S_FALSE;
339
340 if (This->filter.state == State_Stopped)
341 return VFW_E_WRONG_STATE;
342
343 if (IMediaSample_GetMediaType(pSample, &pmt) == S_OK)
344 {
345 if (FAILED(This->pFuncsTable->pfnCheckMediaType(This, pmt)))
346 {
348 }
349 }
350
351 This->pMediaSample = pSample;
352 IMediaSample_AddRef(pSample);
353
354 if (This->pFuncsTable->pfnPrepareReceive)
355 hr = This->pFuncsTable->pfnPrepareReceive(This, pSample);
356 if (FAILED(hr))
357 {
359 return S_OK;
360 else
361 return hr;
362 }
363
364 if (This->pFuncsTable->pfnPrepareRender)
365 This->pFuncsTable->pfnPrepareRender(This);
366
367 EnterCriticalSection(&This->csRenderLock);
368 if ( This->filter.state == State_Paused )
369 {
370 if (This->pFuncsTable->pfnOnReceiveFirstSample)
371 This->pFuncsTable->pfnOnReceiveFirstSample(This, pSample);
372
373 SetEvent(This->evComplete);
374 }
375
376 /* Wait for render Time */
377 if (SUCCEEDED(IMediaSample_GetTime(pSample, &start, &stop)))
378 {
379 hr = S_FALSE;
381 if (This->pFuncsTable->pfnShouldDrawSampleNow)
382 hr = This->pFuncsTable->pfnShouldDrawSampleNow(This, pSample, &start, &stop);
383
384 if (hr == S_OK)
385 ;/* Do not wait: drop through */
386 else if (hr == S_FALSE)
387 {
388 if (This->pFuncsTable->pfnOnWaitStart)
389 This->pFuncsTable->pfnOnWaitStart(This);
390
391 LeaveCriticalSection(&This->csRenderLock);
392 hr = QualityControlRender_WaitFor(This->qcimpl, pSample, This->RenderEvent);
393 EnterCriticalSection(&This->csRenderLock);
394
395 if (This->pFuncsTable->pfnOnWaitEnd)
396 This->pFuncsTable->pfnOnWaitEnd(This);
397 }
398 else
399 {
400 LeaveCriticalSection(&This->csRenderLock);
401 /* Drop Sample */
402 return S_OK;
403 }
404 }
405
406 if (SUCCEEDED(hr))
407 {
409 hr = This->pFuncsTable->pfnDoRenderSample(This, pSample);
411 }
412
414
416 LeaveCriticalSection(&This->csRenderLock);
417
418 return hr;
419}
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
GLuint start
Definition: gl.h:1545
void QualityControlRender_EndRender(QualityControlImpl *This)
void QualityControlRender_BeginRender(QualityControlImpl *This)
void QualityControlRender_DoQOS(QualityControlImpl *priv)
HRESULT QualityControlRender_WaitFor(QualityControlImpl *This, IMediaSample *sample, HANDLE ev)
HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start)
Definition: pospass.c:601
#define VFW_E_TYPE_NOT_ACCEPTED
Definition: vfwmsgs.h:81
#define VFW_E_WRONG_STATE
Definition: vfwmsgs.h:78
#define VFW_E_SAMPLE_REJECTED
Definition: vfwmsgs.h:82
#define S_FALSE
Definition: winerror.h:2357

Referenced by BaseRenderer_Receive().

◆ BaseRendererImpl_Release()

ULONG WINAPI BaseRendererImpl_Release ( IBaseFilter iface)

Definition at line 296 of file renderer.c.

297{
299 ULONG refCount = InterlockedDecrement(&This->filter.refCount);
300
301 if (!refCount)
302 {
303 IPin *pConnectedTo;
304
305 if (SUCCEEDED(IPin_ConnectedTo(&This->pInputPin->pin.IPin_iface, &pConnectedTo)))
306 {
307 IPin_Disconnect(pConnectedTo);
308 IPin_Release(pConnectedTo);
309 }
310 IPin_Disconnect(&This->pInputPin->pin.IPin_iface);
311 IPin_Release(&This->pInputPin->pin.IPin_iface);
312
313 if (This->pPosition)
314 IUnknown_Release(This->pPosition);
315
316 This->csRenderLock.DebugInfo->Spare[0] = 0;
317 DeleteCriticalSection(&This->csRenderLock);
318
320 CloseHandle(This->evComplete);
321 CloseHandle(This->ThreadSignal);
322 CloseHandle(This->RenderEvent);
324 BaseFilter_Destroy(&This->filter);
325 }
326 return refCount;
327}
#define InterlockedDecrement
Definition: armddk.h:52
#define CloseHandle
Definition: compat.h:739
void QualityControlImpl_Destroy(QualityControlImpl *This)
HRESULT WINAPI BaseFilter_Destroy(BaseFilter *This)
Definition: filter.c:214
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by DSoundRender_create(), DSoundRender_Release(), NullRenderer_create(), NullRendererInner_Release(), VideoRenderer_create(), VideoRendererInner_Release(), VMR9Inner_Release(), and vmr_create().

◆ BaseRendererImpl_Run()

HRESULT WINAPI BaseRendererImpl_Run ( IBaseFilter iface,
REFERENCE_TIME  tStart 
)

Definition at line 461 of file renderer.c.

462{
463 HRESULT hr = S_OK;
465 TRACE("(%p)->(%s)\n", This, wine_dbgstr_longlong(tStart));
466
467 EnterCriticalSection(&This->csRenderLock);
468 This->filter.rtStreamStart = tStart;
469 if (This->filter.state == State_Running)
470 goto out;
471
472 SetEvent(This->evComplete);
473 ResetEvent(This->ThreadSignal);
474
475 if (This->pInputPin->pin.pConnectedTo)
476 {
477 This->pInputPin->end_of_stream = FALSE;
478 }
479 else if (This->filter.filterInfo.pGraph)
480 {
481 IMediaEventSink *pEventSink;
482 hr = IFilterGraph_QueryInterface(This->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
483 if (SUCCEEDED(hr))
484 {
485 hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, (LONG_PTR)This);
486 IMediaEventSink_Release(pEventSink);
487 }
488 hr = S_OK;
489 }
490 if (SUCCEEDED(hr))
491 {
492 QualityControlRender_Start(This->qcimpl, This->filter.rtStreamStart);
493 if (This->pFuncsTable->pfnOnStartStreaming)
494 This->pFuncsTable->pfnOnStartStreaming(This);
495 if (This->filter.state == State_Stopped)
497 SetEvent(This->RenderEvent);
498 This->filter.state = State_Running;
499 }
500out:
501 LeaveCriticalSection(&This->csRenderLock);
502
503 return hr;
504}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
static FILE * out
Definition: regtests2xml.c:44

◆ BaseRendererImpl_SetSyncSource()

HRESULT WINAPI BaseRendererImpl_SetSyncSource ( IBaseFilter iface,
IReferenceClock clock 
)

Definition at line 537 of file renderer.c.

538{
540 HRESULT hr;
541
542 EnterCriticalSection(&This->filter.csFilter);
545 LeaveCriticalSection(&This->filter.csFilter);
546 return hr;
547}
void QualityControlRender_SetClock(QualityControlImpl *This, IReferenceClock *clock)
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
Definition: filter.c:101

◆ BaseRendererImpl_Stop()

HRESULT WINAPI BaseRendererImpl_Stop ( IBaseFilter iface)

Definition at line 440 of file renderer.c.

441{
443
444 TRACE("(%p)->()\n", This);
445
446 EnterCriticalSection(&This->csRenderLock);
447 {
449 if (This->pFuncsTable->pfnOnStopStreaming)
450 This->pFuncsTable->pfnOnStopStreaming(This);
451 This->filter.state = State_Stopped;
452 SetEvent(This->evComplete);
453 SetEvent(This->ThreadSignal);
454 SetEvent(This->RenderEvent);
455 }
456 LeaveCriticalSection(&This->csRenderLock);
457
458 return S_OK;
459}

◆ impl_BaseInputPin_from_IPin()

static BaseInputPin * impl_BaseInputPin_from_IPin ( IPin iface)
inlinestatic

◆ impl_from_BaseFilter()

static BaseRenderer * impl_from_BaseFilter ( BaseFilter iface)
inlinestatic

Definition at line 46 of file renderer.c.

47{
49}
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005

Referenced by BaseRenderer_GetPin().

◆ impl_from_IBaseFilter()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( strmbase  )

Variable Documentation

◆ BaseRenderer_InputPin_Vtbl

const IPinVtbl BaseRenderer_InputPin_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin *iface)
Definition: renderer.c:150
static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: renderer.c:59
static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin *iface)
Definition: renderer.c:125
static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin *iface)
Definition: renderer.c:100
static HRESULT WINAPI BaseRenderer_InputPin_Disconnect(IPin *iface)
Definition: renderer.c:79
HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
Definition: pin.c:248
ULONG WINAPI BaseInputPinImpl_Release(IPin *iface)
Definition: pin.c:868
HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:935
HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
Definition: pin.c:329
HRESULT WINAPI BasePinImpl_ConnectedTo(IPin *iface, IPin **ppPin)
Definition: pin.c:222
HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
Definition: pin.c:1015
HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, LPWSTR *Id)
Definition: pin.c:296
HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *pInfo)
Definition: pin.c:273
HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
Definition: pin.c:838
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
Definition: pin.c:318
HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *pPinDir)
Definition: pin.c:285
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pConnector, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:881
ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
Definition: pin.c:187

Definition at line 175 of file renderer.c.

Referenced by BaseRenderer_Init().

◆ input_BaseInputFuncTable

const BaseInputPinFuncTable input_BaseInputFuncTable
static
Initial value:
= {
{
},
}
static HRESULT WINAPI BaseRenderer_Input_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt)
Definition: renderer.c:213
static HRESULT WINAPI BaseRenderer_Receive(BaseInputPin *pin, IMediaSample *pSample)
Definition: renderer.c:219
LONG WINAPI BasePinImpl_GetMediaTypeVersion(BasePin *This)
Definition: pin.c:182
HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt)
Definition: pin.c:175

Definition at line 230 of file renderer.c.

Referenced by BaseRenderer_Init().

◆ Renderer_QualityControl_Vtbl

const IQualityControlVtbl Renderer_QualityControl_Vtbl
static
Initial value:
= {
}
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface)
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface)
HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify)

Definition at line 51 of file renderer.c.

Referenced by BaseRenderer_Init().

◆ RendererBaseFilterFuncTable

const BaseFilterFuncTable RendererBaseFilterFuncTable
static
Initial value:
= {
}
static IPin *WINAPI BaseRenderer_GetPin(BaseFilter *iface, int pos)
Definition: renderer.c:197
static LONG WINAPI BaseRenderer_GetPinCount(BaseFilter *iface)
Definition: renderer.c:208

Definition at line 225 of file renderer.c.

Referenced by BaseRenderer_Init().

◆ wcsAltInputPinName

const WCHAR wcsAltInputPinName[] = {'I','n',0}
static

Definition at line 34 of file renderer.c.

Referenced by BaseRendererImpl_FindPin().

◆ wcsInputPinName

const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0}
static

Definition at line 33 of file renderer.c.

Referenced by BaseRenderer_Init(), and BaseRendererImpl_FindPin().