ReactOS  0.4.13-dev-982-g9853eab
nullrenderer.c File Reference
#include "config.h"
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "amvideo.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "evcode.h"
#include "strmif.h"
#include "ddraw.h"
#include "wine/unicode.h"
#include "wine/debug.h"
Include dependency graph for nullrenderer.c:

Go to the source code of this file.

Classes

struct  NullRendererImpl
 

Typedefs

typedef struct NullRendererImpl NullRendererImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (quartz)
 
static HRESULT WINAPI NullRenderer_DoRenderSample (BaseRenderer *iface, IMediaSample *pMediaSample)
 
static HRESULT WINAPI NullRenderer_CheckMediaType (BaseRenderer *iface, const AM_MEDIA_TYPE *pmt)
 
static NullRendererImplimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI NullRendererInner_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI NullRendererInner_AddRef (IUnknown *iface)
 
static ULONG WINAPI NullRendererInner_Release (IUnknown *iface)
 
static NullRendererImplimpl_from_IBaseFilter (IBaseFilter *iface)
 
static HRESULT WINAPI NullRenderer_QueryInterface (IBaseFilter *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI NullRenderer_AddRef (IBaseFilter *iface)
 
static ULONG WINAPI NullRenderer_Release (IBaseFilter *iface)
 
static NullRendererImplimpl_from_IAMFilterMiscFlags (IAMFilterMiscFlags *iface)
 
static HRESULT WINAPI AMFilterMiscFlags_QueryInterface (IAMFilterMiscFlags *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI AMFilterMiscFlags_AddRef (IAMFilterMiscFlags *iface)
 
static ULONG WINAPI AMFilterMiscFlags_Release (IAMFilterMiscFlags *iface)
 
static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags (IAMFilterMiscFlags *iface)
 
HRESULT NullRenderer_create (IUnknown *pUnkOuter, void **ppv)
 

Variables

static const BaseRendererFuncTable RendererFuncTable
 
static const IUnknownVtbl IInner_VTable
 
static const IBaseFilterVtbl NullRenderer_Vtbl
 
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
 

Typedef Documentation

◆ NullRendererImpl

Function Documentation

◆ AMFilterMiscFlags_AddRef()

static ULONG WINAPI AMFilterMiscFlags_AddRef ( IAMFilterMiscFlags iface)
static

Definition at line 201 of file nullrenderer.c.

202 {
204  return IUnknown_AddRef(This->outer_unk);
205 }
static NullRendererImpl * impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface)
Definition: nullrenderer.c:189

◆ AMFilterMiscFlags_GetMiscFlags()

static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags ( IAMFilterMiscFlags iface)
static

Definition at line 213 of file nullrenderer.c.

◆ AMFilterMiscFlags_QueryInterface()

static HRESULT WINAPI AMFilterMiscFlags_QueryInterface ( IAMFilterMiscFlags iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 194 of file nullrenderer.c.

196 {
198  return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
199 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static NullRendererImpl * impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface)
Definition: nullrenderer.c:189

◆ AMFilterMiscFlags_Release()

static ULONG WINAPI AMFilterMiscFlags_Release ( IAMFilterMiscFlags iface)
static

Definition at line 207 of file nullrenderer.c.

208 {
210  return IUnknown_Release(This->outer_unk);
211 }
static NullRendererImpl * impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface)
Definition: nullrenderer.c:189

◆ impl_from_IAMFilterMiscFlags()

static NullRendererImpl* impl_from_IAMFilterMiscFlags ( IAMFilterMiscFlags iface)
static

Definition at line 189 of file nullrenderer.c.

190 {
191  return CONTAINING_RECORD(iface, NullRendererImpl, IAMFilterMiscFlags_iface);
192 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by AMFilterMiscFlags_AddRef(), AMFilterMiscFlags_QueryInterface(), and AMFilterMiscFlags_Release().

◆ impl_from_IBaseFilter()

static NullRendererImpl* impl_from_IBaseFilter ( IBaseFilter iface)
inlinestatic

Definition at line 147 of file nullrenderer.c.

148 {
149  return CONTAINING_RECORD(iface, NullRendererImpl, renderer.filter.IBaseFilter_iface);
150 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by NullRenderer_AddRef(), NullRenderer_QueryInterface(), and NullRenderer_Release().

◆ impl_from_IUnknown()

static NullRendererImpl* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 83 of file nullrenderer.c.

84 {
85  return CONTAINING_RECORD(iface, NullRendererImpl, IUnknown_inner);
86 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by NullRendererInner_AddRef(), NullRendererInner_QueryInterface(), and NullRendererInner_Release().

◆ NullRenderer_AddRef()

static ULONG WINAPI NullRenderer_AddRef ( IBaseFilter iface)
static

Definition at line 158 of file nullrenderer.c.

159 {
161  return IUnknown_AddRef(This->outer_unk);
162 }
static NullRendererImpl * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: nullrenderer.c:147

◆ NullRenderer_CheckMediaType()

static HRESULT WINAPI NullRenderer_CheckMediaType ( BaseRenderer iface,
const AM_MEDIA_TYPE pmt 
)
static

Definition at line 55 of file nullrenderer.c.

56 {
57  TRACE("Not a stub!\n");
58  return S_OK;
59 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ NullRenderer_create()

HRESULT NullRenderer_create ( IUnknown pUnkOuter,
void **  ppv 
)

Definition at line 225 of file nullrenderer.c.

226 {
227  HRESULT hr;
228  NullRendererImpl *pNullRenderer;
229 
230  TRACE("(%p, %p)\n", pUnkOuter, ppv);
231 
232  *ppv = NULL;
233 
234  pNullRenderer = CoTaskMemAlloc(sizeof(NullRendererImpl));
235  pNullRenderer->IUnknown_inner.lpVtbl = &IInner_VTable;
236  pNullRenderer->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl;
237 
238  if (pUnkOuter)
239  pNullRenderer->outer_unk = pUnkOuter;
240  else
241  pNullRenderer->outer_unk = &pNullRenderer->IUnknown_inner;
242 
243  hr = BaseRenderer_Init(&pNullRenderer->renderer, &NullRenderer_Vtbl, pUnkOuter,
244  &CLSID_NullRenderer, (DWORD_PTR)(__FILE__ ": NullRendererImpl.csFilter"),
246 
247  if (FAILED(hr))
248  {
250  CoTaskMemFree(pNullRenderer);
251  }
252  else
253  *ppv = &pNullRenderer->IUnknown_inner;
254 
255  return S_OK;
256 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
REFIID LPVOID * ppv
Definition: atlbase.h:39
IUnknown * outer_unk
Definition: nullrenderer.c:47
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter *iface)
Definition: renderer.c:296
HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable *pBaseFuncsTable)
Definition: renderer.c:241
smooth NULL
Definition: ftsmooth.c:416
IUnknown IUnknown_inner
Definition: nullrenderer.c:45
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
BaseRenderer renderer
Definition: nullrenderer.c:44
static const IUnknownVtbl IInner_VTable
Definition: nullrenderer.c:140
IBaseFilter IBaseFilter_iface
Definition: strmbase.h:163
BaseFilter filter
Definition: strmbase.h:580
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define S_OK
Definition: intsafe.h:59
static const BaseRendererFuncTable RendererFuncTable
Definition: nullrenderer.c:61
static const IBaseFilterVtbl NullRenderer_Vtbl
Definition: nullrenderer.c:170
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
Definition: nullrenderer.c:218
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406
IAMFilterMiscFlags IAMFilterMiscFlags_iface
Definition: nullrenderer.c:46

◆ NullRenderer_DoRenderSample()

static HRESULT WINAPI NullRenderer_DoRenderSample ( BaseRenderer iface,
IMediaSample pMediaSample 
)
static

Definition at line 50 of file nullrenderer.c.

51 {
52  return S_OK;
53 }
#define S_OK
Definition: intsafe.h:59

◆ NullRenderer_QueryInterface()

static HRESULT WINAPI NullRenderer_QueryInterface ( IBaseFilter iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 152 of file nullrenderer.c.

153 {
155  return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
156 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static NullRendererImpl * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: nullrenderer.c:147

◆ NullRenderer_Release()

static ULONG WINAPI NullRenderer_Release ( IBaseFilter iface)
static

Definition at line 164 of file nullrenderer.c.

165 {
167  return IUnknown_Release(This->outer_unk);
168 }
static NullRendererImpl * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: nullrenderer.c:147

◆ NullRendererInner_AddRef()

static ULONG WINAPI NullRendererInner_AddRef ( IUnknown iface)
static

Definition at line 120 of file nullrenderer.c.

121 {
123  return BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface);
124 }
static NullRendererImpl * impl_from_IUnknown(IUnknown *iface)
Definition: nullrenderer.c:83
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54

◆ NullRendererInner_QueryInterface()

static HRESULT WINAPI NullRendererInner_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 88 of file nullrenderer.c.

89 {
91 
92  TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
93 
94  *ppv = NULL;
95 
97  *ppv = &This->IUnknown_inner;
98  else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
99  *ppv = &This->IAMFilterMiscFlags_iface;
100  else
101  {
102  HRESULT hr;
103  hr = BaseRendererImpl_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
104  if (SUCCEEDED(hr))
105  return hr;
106  }
107 
108  if (*ppv)
109  {
110  IUnknown_AddRef((IUnknown *)*ppv);
111  return S_OK;
112  }
113 
114  if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow))
115  FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
116 
117  return E_NOINTERFACE;
118 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
const char * qzdebugstr_guid(const GUID *id)
Definition: main.c:279
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: renderer.c:280
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static NullRendererImpl * impl_from_IUnknown(IUnknown *iface)
Definition: nullrenderer.c:83
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
const GUID IID_IPin
Definition: pincontrol.cpp:15
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ NullRendererInner_Release()

static ULONG WINAPI NullRendererInner_Release ( IUnknown iface)
static

Definition at line 126 of file nullrenderer.c.

127 {
129  ULONG refCount = BaseRendererImpl_Release(&This->renderer.filter.IBaseFilter_iface);
130 
131  if (!refCount)
132  {
133  TRACE("Destroying Null Renderer\n");
135  }
136 
137  return refCount;
138 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter *iface)
Definition: renderer.c:296
static NullRendererImpl * impl_from_IUnknown(IUnknown *iface)
Definition: nullrenderer.c:83
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int ULONG
Definition: retypes.h:1

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( quartz  )

Variable Documentation

◆ IAMFilterMiscFlags_Vtbl

const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI AMFilterMiscFlags_QueryInterface(IAMFilterMiscFlags *iface, REFIID riid, void **ppv)
Definition: nullrenderer.c:194
static ULONG WINAPI AMFilterMiscFlags_AddRef(IAMFilterMiscFlags *iface)
Definition: nullrenderer.c:201
static ULONG WINAPI AMFilterMiscFlags_Release(IAMFilterMiscFlags *iface)
Definition: nullrenderer.c:207
static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags(IAMFilterMiscFlags *iface)
Definition: nullrenderer.c:213

Definition at line 218 of file nullrenderer.c.

Referenced by NullRenderer_create().

◆ IInner_VTable

const IUnknownVtbl IInner_VTable
static
Initial value:
=
{
}
static ULONG WINAPI NullRendererInner_AddRef(IUnknown *iface)
Definition: nullrenderer.c:120
static ULONG WINAPI NullRendererInner_Release(IUnknown *iface)
Definition: nullrenderer.c:126
static HRESULT WINAPI NullRendererInner_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: nullrenderer.c:88

Definition at line 140 of file nullrenderer.c.

Referenced by NullRenderer_create().

◆ NullRenderer_Vtbl

const IBaseFilterVtbl NullRenderer_Vtbl
static
Initial value:
=
{
}
HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
Definition: renderer.c:537
HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: renderer.c:550
HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
Definition: renderer.c:421
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
Definition: filter.c:77
static HRESULT WINAPI NullRenderer_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: nullrenderer.c:152
static ULONG WINAPI NullRenderer_Release(IBaseFilter *iface)
Definition: nullrenderer.c:164
HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter *iface)
Definition: renderer.c:506
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
Definition: filter.c:178
HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
Definition: renderer.c:461
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
Definition: filter.c:135
HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter *iface)
Definition: renderer.c:440
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
Definition: filter.c:145
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
Definition: filter.c:119
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
Definition: filter.c:159
static ULONG WINAPI NullRenderer_AddRef(IBaseFilter *iface)
Definition: nullrenderer.c:158

Definition at line 170 of file nullrenderer.c.

Referenced by NullRenderer_create().

◆ RendererFuncTable

const BaseRendererFuncTable RendererFuncTable
static
Initial value:
= {
}
static HRESULT WINAPI NullRenderer_DoRenderSample(BaseRenderer *iface, IMediaSample *pMediaSample)
Definition: nullrenderer.c:50
static HRESULT WINAPI NullRenderer_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE *pmt)
Definition: nullrenderer.c:55
smooth NULL
Definition: ftsmooth.c:416

Definition at line 61 of file nullrenderer.c.

Referenced by NullRenderer_create().