2017-09-20 14:03:38 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Fabian Maurer
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "evr_private.h"
|
|
|
|
#include "d3d9.h"
|
|
|
|
|
|
|
|
#include "initguid.h"
|
|
|
|
#include "dxva2api.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(evr);
|
|
|
|
|
2020-03-31 00:55:16 +02:00
|
|
|
struct evr
|
2017-09-20 14:03:38 +02:00
|
|
|
{
|
2019-10-24 03:04:23 +02:00
|
|
|
struct strmbase_renderer renderer;
|
2021-04-22 03:23:44 +02:00
|
|
|
IEVRFilterConfig IEVRFilterConfig_iface;
|
2020-03-31 00:55:16 +02:00
|
|
|
};
|
2017-09-20 14:03:38 +02:00
|
|
|
|
2020-03-31 00:55:16 +02:00
|
|
|
static struct evr *impl_from_strmbase_renderer(struct strmbase_renderer *iface)
|
2019-06-05 00:54:28 +02:00
|
|
|
{
|
2020-03-31 00:55:16 +02:00
|
|
|
return CONTAINING_RECORD(iface, struct evr, renderer);
|
2019-06-05 00:54:28 +02:00
|
|
|
}
|
|
|
|
|
2021-04-22 03:23:44 +02:00
|
|
|
static HRESULT evr_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out)
|
|
|
|
{
|
|
|
|
struct evr *filter = impl_from_strmbase_renderer(iface);
|
|
|
|
|
|
|
|
if (IsEqualGUID(iid, &IID_IEVRFilterConfig))
|
|
|
|
*out = &filter->IEVRFilterConfig_iface;
|
|
|
|
else
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown *)*out);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2019-10-24 03:04:23 +02:00
|
|
|
static void evr_destroy(struct strmbase_renderer *iface)
|
2017-09-20 14:03:38 +02:00
|
|
|
{
|
2020-03-31 00:55:16 +02:00
|
|
|
struct evr *filter = impl_from_strmbase_renderer(iface);
|
2019-08-28 03:45:17 +02:00
|
|
|
|
|
|
|
strmbase_renderer_cleanup(&filter->renderer);
|
2020-03-31 00:55:15 +02:00
|
|
|
free(filter);
|
2017-09-20 14:03:38 +02:00
|
|
|
}
|
|
|
|
|
2021-03-12 00:21:56 +01:00
|
|
|
static HRESULT evr_render(struct strmbase_renderer *iface, IMediaSample *sample)
|
2019-06-05 00:54:28 +02:00
|
|
|
{
|
2019-08-28 03:45:17 +02:00
|
|
|
FIXME("Not implemented.\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2019-06-05 00:54:28 +02:00
|
|
|
|
2021-03-11 02:23:37 +01:00
|
|
|
static HRESULT evr_query_accept(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt)
|
2019-08-28 03:45:17 +02:00
|
|
|
{
|
|
|
|
FIXME("Not implemented.\n");
|
|
|
|
return E_NOTIMPL;
|
2019-06-05 00:54:28 +02:00
|
|
|
}
|
|
|
|
|
2019-10-24 03:04:24 +02:00
|
|
|
static const struct strmbase_renderer_ops renderer_ops =
|
2017-09-20 14:03:38 +02:00
|
|
|
{
|
2021-03-11 02:23:37 +01:00
|
|
|
.renderer_query_accept = evr_query_accept,
|
2021-03-12 00:21:56 +01:00
|
|
|
.renderer_render = evr_render,
|
2021-04-22 03:23:44 +02:00
|
|
|
.renderer_query_interface = evr_query_interface,
|
2019-08-28 03:45:17 +02:00
|
|
|
.renderer_destroy = evr_destroy,
|
2017-09-20 14:03:38 +02:00
|
|
|
};
|
|
|
|
|
2021-04-22 03:23:44 +02:00
|
|
|
static struct evr *impl_from_IEVRFilterConfig(IEVRFilterConfig *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, struct evr, IEVRFilterConfig_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI filter_config_QueryInterface(IEVRFilterConfig *iface, REFIID iid, void **out)
|
|
|
|
{
|
|
|
|
struct evr *filter = impl_from_IEVRFilterConfig(iface);
|
|
|
|
return IUnknown_QueryInterface(filter->renderer.filter.outer_unk, iid, out);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI filter_config_AddRef(IEVRFilterConfig *iface)
|
|
|
|
{
|
|
|
|
struct evr *filter = impl_from_IEVRFilterConfig(iface);
|
|
|
|
return IUnknown_AddRef(filter->renderer.filter.outer_unk);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI filter_config_Release(IEVRFilterConfig *iface)
|
|
|
|
{
|
|
|
|
struct evr *filter = impl_from_IEVRFilterConfig(iface);
|
|
|
|
return IUnknown_Release(filter->renderer.filter.outer_unk);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI filter_config_SetNumberOfStreams(IEVRFilterConfig *iface, DWORD count)
|
|
|
|
{
|
|
|
|
struct evr *filter = impl_from_IEVRFilterConfig(iface);
|
|
|
|
|
|
|
|
FIXME("filter %p, count %u, stub!\n", filter, count);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI filter_config_GetNumberOfStreams(IEVRFilterConfig *iface, DWORD *count)
|
|
|
|
{
|
|
|
|
struct evr *filter = impl_from_IEVRFilterConfig(iface);
|
|
|
|
|
|
|
|
FIXME("filter %p, count %p, stub!\n", filter, count);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IEVRFilterConfigVtbl filter_config_vtbl =
|
|
|
|
{
|
|
|
|
filter_config_QueryInterface,
|
|
|
|
filter_config_AddRef,
|
|
|
|
filter_config_Release,
|
|
|
|
filter_config_SetNumberOfStreams,
|
|
|
|
filter_config_GetNumberOfStreams,
|
|
|
|
};
|
|
|
|
|
2019-06-05 00:54:28 +02:00
|
|
|
HRESULT evr_filter_create(IUnknown *outer, void **out)
|
2017-09-20 14:03:38 +02:00
|
|
|
{
|
2020-03-31 00:55:16 +02:00
|
|
|
struct evr *object;
|
2017-09-20 14:03:38 +02:00
|
|
|
|
2020-03-31 00:55:15 +02:00
|
|
|
if (!(object = calloc(1, sizeof(*object))))
|
2017-09-20 14:03:38 +02:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2019-10-23 01:30:07 +02:00
|
|
|
strmbase_renderer_init(&object->renderer, outer,
|
2020-01-16 03:30:30 +01:00
|
|
|
&CLSID_EnhancedVideoRenderer, L"EVR Input0", &renderer_ops);
|
2021-04-22 03:23:44 +02:00
|
|
|
object->IEVRFilterConfig_iface.lpVtbl = &filter_config_vtbl;
|
2017-09-20 14:03:38 +02:00
|
|
|
|
2020-03-31 00:55:15 +02:00
|
|
|
TRACE("Created EVR %p.\n", object);
|
2019-08-28 03:45:17 +02:00
|
|
|
*out = &object->renderer.filter.IUnknown_inner;
|
2017-09-20 14:03:38 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|