4 * Copyright 2004 Christian Costa
5 * Copyright 2008 Maarten Lankhorst
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/debug.h"
25 #include "wine/strmbase.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(qedit
);
31 struct strmbase_renderer renderer
;
34 static struct null_renderer
*impl_from_strmbase_renderer(struct strmbase_renderer
*iface
)
36 return CONTAINING_RECORD(iface
, struct null_renderer
, renderer
);
39 static HRESULT WINAPI
NullRenderer_DoRenderSample(struct strmbase_renderer
*iface
, IMediaSample
*sample
)
41 struct null_renderer
*filter
= impl_from_strmbase_renderer(iface
);
43 if (filter
->renderer
.filter
.state
== State_Paused
)
44 SetEvent(filter
->renderer
.state_event
);
49 static HRESULT WINAPI
NullRenderer_CheckMediaType(struct strmbase_renderer
*iface
, const AM_MEDIA_TYPE
*mt
)
51 TRACE("Not a stub!\n");
55 static void null_renderer_destroy(struct strmbase_renderer
*iface
)
57 struct null_renderer
*filter
= impl_from_strmbase_renderer(iface
);
59 strmbase_renderer_cleanup(&filter
->renderer
);
63 static const struct strmbase_renderer_ops renderer_ops
=
65 .pfnCheckMediaType
= NullRenderer_CheckMediaType
,
66 .pfnDoRenderSample
= NullRenderer_DoRenderSample
,
67 .renderer_destroy
= null_renderer_destroy
,
70 HRESULT
null_renderer_create(IUnknown
*outer
, IUnknown
**out
)
72 struct null_renderer
*object
;
74 if (!(object
= calloc(1, sizeof(*object
))))
77 strmbase_renderer_init(&object
->renderer
, outer
, &CLSID_NullRenderer
, L
"In", &renderer_ops
);
79 TRACE("Created null renderer %p.\n", object
);
80 *out
= &object
->renderer
.filter
.IUnknown_inner
;