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
|
|
|
|
2020-03-31 00:55:14 +02:00
|
|
|
struct null_renderer
|
2008-03-12 18:12:18 +01:00
|
|
|
{
|
2019-10-24 03:04:23 +02:00
|
|
|
struct strmbase_renderer renderer;
|
2020-03-31 00:55:14 +02:00
|
|
|
};
|
2008-03-12 18:12:18 +01:00
|
|
|
|
2020-03-31 00:55:14 +02:00
|
|
|
static struct null_renderer *impl_from_strmbase_renderer(struct strmbase_renderer *iface)
|
2019-06-05 00:54:25 +02:00
|
|
|
{
|
2020-03-31 00:55:14 +02:00
|
|
|
return CONTAINING_RECORD(iface, struct null_renderer, renderer);
|
2019-06-05 00:54:25 +02:00
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2020-03-31 00:55:14 +02:00
|
|
|
struct null_renderer *filter = impl_from_strmbase_renderer(iface);
|
2019-06-05 00:54:25 +02:00
|
|
|
|
|
|
|
strmbase_renderer_cleanup(&filter->renderer);
|
2020-03-31 00:55:13 +02:00
|
|
|
free(filter);
|
2019-06-05 00:54:25 +02:00
|
|
|
}
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2020-03-12 03:10:09 +01:00
|
|
|
HRESULT null_renderer_create(IUnknown *outer, IUnknown **out)
|
2012-07-02 01:03:21 +02:00
|
|
|
{
|
2020-03-31 00:55:14 +02:00
|
|
|
struct null_renderer *object;
|
2012-07-02 01:03:21 +02:00
|
|
|
|
2020-03-31 00:55:13 +02:00
|
|
|
if (!(object = calloc(1, sizeof(*object))))
|
|
|
|
return E_OUTOFMEMORY;
|
2012-07-02 01:03:21 +02:00
|
|
|
|
2020-03-31 00:55:13 +02:00
|
|
|
strmbase_renderer_init(&object->renderer, outer, &CLSID_NullRenderer, L"In", &renderer_ops);
|
2012-07-02 01:03:21 +02:00
|
|
|
|
2020-03-31 00:55:13 +02:00
|
|
|
TRACE("Created null renderer %p.\n", object);
|
|
|
|
*out = &object->renderer.filter.IUnknown_inner;
|
2012-07-02 01:03:21 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|