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 "config.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "evr_private.h"
|
|
|
|
#include "d3d9.h"
|
|
|
|
#include "wine/strmbase.h"
|
|
|
|
|
|
|
|
#include "initguid.h"
|
|
|
|
#include "dxva2api.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(evr);
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BaseFilter filter;
|
|
|
|
} evr_filter;
|
|
|
|
|
|
|
|
static const IBaseFilterVtbl basefilter_vtbl =
|
|
|
|
{
|
2019-06-05 00:54:28 +02:00
|
|
|
BaseFilterImpl_QueryInterface,
|
|
|
|
BaseFilterImpl_AddRef,
|
|
|
|
BaseFilterImpl_Release,
|
2017-09-20 14:03:38 +02:00
|
|
|
BaseFilterImpl_GetClassID,
|
|
|
|
BaseRendererImpl_Stop,
|
|
|
|
BaseRendererImpl_Pause,
|
|
|
|
BaseRendererImpl_Run,
|
|
|
|
BaseRendererImpl_GetState,
|
|
|
|
BaseRendererImpl_SetSyncSource,
|
|
|
|
BaseFilterImpl_GetSyncSource,
|
|
|
|
BaseFilterImpl_EnumPins,
|
2019-03-12 06:32:57 +01:00
|
|
|
BaseFilterImpl_FindPin,
|
2017-09-20 14:03:38 +02:00
|
|
|
BaseFilterImpl_QueryFilterInfo,
|
|
|
|
BaseFilterImpl_JoinFilterGraph,
|
|
|
|
BaseFilterImpl_QueryVendorInfo
|
|
|
|
};
|
|
|
|
|
2019-06-05 00:54:28 +02:00
|
|
|
static inline evr_filter *impl_from_BaseFilter(BaseFilter *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, evr_filter, filter);
|
|
|
|
}
|
|
|
|
|
2019-05-24 00:06:32 +02:00
|
|
|
static IPin *evr_get_pin(BaseFilter *iface, unsigned int index)
|
2017-09-20 14:03:38 +02:00
|
|
|
{
|
2019-05-24 00:06:30 +02:00
|
|
|
FIXME("iface %p, index %u, stub!\n", iface, index);
|
2017-09-20 14:03:38 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-06-05 00:54:28 +02:00
|
|
|
static void evr_destroy(BaseFilter *iface)
|
|
|
|
{
|
|
|
|
evr_filter *filter = impl_from_BaseFilter(iface);
|
|
|
|
|
|
|
|
strmbase_filter_cleanup(&filter->filter);
|
|
|
|
CoTaskMemFree(filter);
|
|
|
|
}
|
|
|
|
|
2017-09-20 14:03:38 +02:00
|
|
|
static const BaseFilterFuncTable basefilter_functable =
|
|
|
|
{
|
2019-05-24 00:06:31 +02:00
|
|
|
.filter_get_pin = evr_get_pin,
|
2019-06-05 00:54:28 +02:00
|
|
|
.filter_destroy = evr_destroy,
|
2017-09-20 14:03:38 +02:00
|
|
|
};
|
|
|
|
|
2019-06-05 00:54:28 +02:00
|
|
|
HRESULT evr_filter_create(IUnknown *outer, void **out)
|
2017-09-20 14:03:38 +02:00
|
|
|
{
|
|
|
|
evr_filter *object;
|
|
|
|
|
2019-06-05 00:54:28 +02:00
|
|
|
*out = NULL;
|
2017-09-20 14:03:38 +02:00
|
|
|
|
|
|
|
object = CoTaskMemAlloc(sizeof(evr_filter));
|
|
|
|
if (!object)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2019-06-05 00:54:28 +02:00
|
|
|
strmbase_filter_init(&object->filter, &basefilter_vtbl, outer, &CLSID_EnhancedVideoRenderer,
|
2017-09-20 14:03:38 +02:00
|
|
|
(DWORD_PTR)(__FILE__ ": EVR.csFilter"), &basefilter_functable);
|
|
|
|
|
2019-06-05 00:54:28 +02:00
|
|
|
*out = &object->filter.IUnknown_inner;
|
2017-09-20 14:03:38 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|