ReactOS 0.4.16-dev-297-gc569aee
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.

214{
216}
@ AM_FILTER_MISC_FLAGS_IS_RENDERER
Definition: axextend.idl:1239

◆ 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: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ 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}

◆ 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}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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}

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}

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 S_OK
Definition: intsafe.h:52
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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}
#define NULL
Definition: types.h:112
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define FAILED(hr)
Definition: intsafe.h:51
static const IBaseFilterVtbl NullRenderer_Vtbl
Definition: nullrenderer.c:170
static const BaseRendererFuncTable RendererFuncTable
Definition: nullrenderer.c:61
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
Definition: nullrenderer.c:218
static const IUnknownVtbl IInner_VTable
Definition: nullrenderer.c:140
HRESULT hr
Definition: shlfolder.c:183
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
IBaseFilter IBaseFilter_iface
Definition: strmbase.h:163
BaseFilter filter
Definition: strmbase.h:580
IAMFilterMiscFlags IAMFilterMiscFlags_iface
Definition: nullrenderer.c:46
IUnknown * outer_unk
Definition: nullrenderer.c:47
BaseRenderer renderer
Definition: nullrenderer.c:44
IUnknown IUnknown_inner
Definition: nullrenderer.c:45
uint32_t DWORD_PTR
Definition: typedefs.h:65

◆ 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}

◆ 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}

◆ 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}

◆ 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 FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const char * qzdebugstr_guid(const GUID *id)
Definition: main.c:279
#define SUCCEEDED(hr)
Definition: intsafe.h:50
const GUID IID_IPin
Definition: pincontrol.cpp:15
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: renderer.c:280
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ 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}
uint32_t ULONG
Definition: typedefs.h:59

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( quartz  )

Variable Documentation

◆ IAMFilterMiscFlags_Vtbl

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

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 HRESULT WINAPI NullRendererInner_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: nullrenderer.c:88
static ULONG WINAPI NullRendererInner_Release(IUnknown *iface)
Definition: nullrenderer.c:126

Definition at line 140 of file nullrenderer.c.

Referenced by NullRenderer_create().

◆ NullRenderer_Vtbl

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

Definition at line 170 of file nullrenderer.c.

Referenced by NullRenderer_create().

◆ RendererFuncTable

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

Definition at line 61 of file nullrenderer.c.

Referenced by NullRenderer_create().