2008-03-12 18:12:18 +01:00
|
|
|
/*
|
2019-04-16 06:20:53 +02:00
|
|
|
* Null renderer filter
|
2008-03-12 18:12:18 +01:00
|
|
|
*
|
|
|
|
* Copyright 2004 Christian Costa
|
|
|
|
* Copyright 2008 Maarten Lankhorst
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2019-04-16 06:20:53 +02:00
|
|
|
#define COBJMACROS
|
2008-03-12 18:12:18 +01:00
|
|
|
#include "dshow.h"
|
|
|
|
#include "wine/debug.h"
|
2019-04-16 06:20:53 +02:00
|
|
|
#include "wine/strmbase.h"
|
2008-03-12 18:12:18 +01:00
|
|
|
|
2019-04-16 06:20:53 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(qedit);
|
2008-03-12 18:12:18 +01:00
|
|
|
|
|
|
|
typedef struct NullRendererImpl
|
|
|
|
{
|
2012-03-30 02:21:54 +02:00
|
|
|
BaseRenderer renderer;
|
2008-03-12 18:12:18 +01:00
|
|
|
} NullRendererImpl;
|
|
|
|
|
2019-06-05 00:54:25 +02:00
|
|
|
static inline NullRendererImpl *impl_from_BaseRenderer(BaseRenderer *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, NullRendererImpl, renderer);
|
|
|
|
}
|
|
|
|
|
2012-03-30 02:21:54 +02:00
|
|
|
static HRESULT WINAPI NullRenderer_DoRenderSample(BaseRenderer *iface, IMediaSample *pMediaSample)
|
2008-03-12 18:12:18 +01:00
|
|
|
{
|
2012-03-30 02:21:54 +02:00
|
|
|
return S_OK;
|
2008-03-12 18:12:18 +01:00
|
|
|
}
|
|
|
|
|
2012-03-30 02:21:54 +02:00
|
|
|
static HRESULT WINAPI NullRenderer_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE * pmt)
|
2008-03-12 18:12:18 +01:00
|
|
|
{
|
|
|
|
TRACE("Not a stub!\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2019-06-05 00:54:25 +02:00
|
|
|
static void null_renderer_destroy(BaseRenderer *iface)
|
|
|
|
{
|
|
|
|
NullRendererImpl *filter = impl_from_BaseRenderer(iface);
|
|
|
|
|
|
|
|
strmbase_renderer_cleanup(&filter->renderer);
|
|
|
|
CoTaskMemFree(filter);
|
|
|
|
}
|
|
|
|
|
2012-03-30 02:21:54 +02:00
|
|
|
static const BaseRendererFuncTable RendererFuncTable = {
|
2010-10-13 18:02:01 +02:00
|
|
|
NullRenderer_CheckMediaType,
|
2012-03-30 02:21:54 +02:00
|
|
|
NullRenderer_DoRenderSample,
|
2012-03-31 03:08:07 +02:00
|
|
|
/**/
|
2012-03-30 02:21:54 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-03-31 03:08:07 +02:00
|
|
|
/**/
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-03-30 02:21:54 +02:00
|
|
|
NULL,
|
2010-10-13 18:02:08 +02:00
|
|
|
NULL,
|
2019-06-05 00:54:25 +02:00
|
|
|
null_renderer_destroy,
|
2010-10-13 18:02:01 +02:00
|
|
|
};
|
|
|
|
|
2008-03-12 18:12:18 +01:00
|
|
|
static const IBaseFilterVtbl NullRenderer_Vtbl =
|
|
|
|
{
|
2019-06-05 00:54:25 +02:00
|
|
|
BaseFilterImpl_QueryInterface,
|
|
|
|
BaseFilterImpl_AddRef,
|
|
|
|
BaseFilterImpl_Release,
|
2010-10-07 21:47:33 +02:00
|
|
|
BaseFilterImpl_GetClassID,
|
2012-03-30 02:21:54 +02:00
|
|
|
BaseRendererImpl_Stop,
|
|
|
|
BaseRendererImpl_Pause,
|
|
|
|
BaseRendererImpl_Run,
|
2012-03-31 03:08:07 +02:00
|
|
|
BaseRendererImpl_GetState,
|
2012-04-02 14:52:08 +02:00
|
|
|
BaseRendererImpl_SetSyncSource,
|
2010-10-07 21:47:33 +02:00
|
|
|
BaseFilterImpl_GetSyncSource,
|
2010-10-07 21:48:01 +02:00
|
|
|
BaseFilterImpl_EnumPins,
|
2019-03-12 06:32:57 +01:00
|
|
|
BaseFilterImpl_FindPin,
|
2010-10-07 21:47:33 +02:00
|
|
|
BaseFilterImpl_QueryFilterInfo,
|
|
|
|
BaseFilterImpl_JoinFilterGraph,
|
|
|
|
BaseFilterImpl_QueryVendorInfo
|
2008-03-12 18:12:18 +01:00
|
|
|
};
|
|
|
|
|
2019-06-05 00:54:25 +02:00
|
|
|
HRESULT NullRenderer_create(IUnknown *outer, void **out)
|
2012-07-02 01:03:21 +02:00
|
|
|
{
|
2019-03-12 06:32:57 +01:00
|
|
|
static const WCHAR sink_name[] = {'I','n',0};
|
|
|
|
|
2012-07-02 01:03:21 +02:00
|
|
|
HRESULT hr;
|
|
|
|
NullRendererImpl *pNullRenderer;
|
|
|
|
|
2019-06-05 00:54:25 +02:00
|
|
|
*out = NULL;
|
2012-07-02 01:03:21 +02:00
|
|
|
|
|
|
|
pNullRenderer = CoTaskMemAlloc(sizeof(NullRendererImpl));
|
|
|
|
|
2019-06-05 00:54:25 +02:00
|
|
|
hr = strmbase_renderer_init(&pNullRenderer->renderer, &NullRenderer_Vtbl, outer,
|
2019-03-12 06:32:57 +01:00
|
|
|
&CLSID_NullRenderer, sink_name,
|
|
|
|
(DWORD_PTR)(__FILE__ ": NullRendererImpl.csFilter"), &RendererFuncTable);
|
2012-07-02 01:03:21 +02:00
|
|
|
|
|
|
|
if (FAILED(hr))
|
|
|
|
CoTaskMemFree(pNullRenderer);
|
|
|
|
else
|
2019-06-05 00:54:25 +02:00
|
|
|
*out = &pNullRenderer->renderer.filter.IUnknown_inner;
|
2012-07-02 01:03:21 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|