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
|
|
|
|
{
|
2019-10-24 03:04:23 +02:00
|
|
|
struct strmbase_renderer renderer;
|
2008-03-12 18:12:18 +01:00
|
|
|
} NullRendererImpl;
|
|
|
|
|
2019-10-24 03:04:23 +02:00
|
|
|
static inline NullRendererImpl *impl_from_strmbase_renderer(struct strmbase_renderer *iface)
|
2019-06-05 00:54:25 +02:00
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, NullRendererImpl, renderer);
|
|
|
|
}
|
|
|
|
|
2019-10-24 03:04:23 +02:00
|
|
|
static HRESULT WINAPI NullRenderer_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *sample)
|
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
|
|
|
}
|
|
|
|
|
2019-10-24 03:04:23 +02:00
|
|
|
static HRESULT WINAPI NullRenderer_CheckMediaType(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt)
|
2008-03-12 18:12:18 +01:00
|
|
|
{
|
|
|
|
TRACE("Not a stub!\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2019-10-24 03:04:23 +02:00
|
|
|
static void null_renderer_destroy(struct strmbase_renderer *iface)
|
2019-06-05 00:54:25 +02:00
|
|
|
{
|
2019-10-24 03:04:23 +02:00
|
|
|
NullRendererImpl *filter = impl_from_strmbase_renderer(iface);
|
2019-06-05 00:54:25 +02:00
|
|
|
|
|
|
|
strmbase_renderer_cleanup(&filter->renderer);
|
|
|
|
CoTaskMemFree(filter);
|
|
|
|
}
|
|
|
|
|
2019-10-24 03:04:24 +02:00
|
|
|
static const struct strmbase_renderer_ops renderer_ops =
|
2019-07-03 05:25:45 +02:00
|
|
|
{
|
|
|
|
.pfnCheckMediaType = NullRenderer_CheckMediaType,
|
|
|
|
.pfnDoRenderSample = NullRenderer_DoRenderSample,
|
|
|
|
.renderer_destroy = null_renderer_destroy,
|
2010-10-13 18:02:01 +02: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-10-23 01:30:07 +02:00
|
|
|
hr = strmbase_renderer_init(&pNullRenderer->renderer, outer,
|
2019-10-24 03:04:24 +02:00
|
|
|
&CLSID_NullRenderer, sink_name, &renderer_ops);
|
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;
|
|
|
|
}
|