evr: Add EnhancedVideoRenderer coclass.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3dddaba2d2
commit
44cb0afb25
|
@ -18338,7 +18338,7 @@ wine_fn_config_test dlls/dxgi/tests dxgi_test
|
|||
wine_fn_config_lib dxguid
|
||||
wine_fn_config_dll dxva2 enable_dxva2
|
||||
wine_fn_config_dll esent enable_esent
|
||||
wine_fn_config_dll evr enable_evr
|
||||
wine_fn_config_dll evr enable_evr clean
|
||||
wine_fn_config_test dlls/evr/tests evr_test
|
||||
wine_fn_config_dll explorerframe enable_explorerframe clean
|
||||
wine_fn_config_test dlls/explorerframe/tests explorerframe_test
|
||||
|
|
|
@ -3121,7 +3121,7 @@ WINE_CONFIG_TEST(dlls/dxgi/tests)
|
|||
WINE_CONFIG_LIB(dxguid)
|
||||
WINE_CONFIG_DLL(dxva2)
|
||||
WINE_CONFIG_DLL(esent)
|
||||
WINE_CONFIG_DLL(evr)
|
||||
WINE_CONFIG_DLL(evr,,[clean])
|
||||
WINE_CONFIG_TEST(dlls/evr/tests)
|
||||
WINE_CONFIG_DLL(explorerframe,,[clean])
|
||||
WINE_CONFIG_TEST(dlls/explorerframe/tests)
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
MODULE = evr.dll
|
||||
IMPORTS = uuid ole32
|
||||
IMPORTS = mfuuid strmiids strmbase uuid ole32 oleaut32
|
||||
|
||||
C_SRCS = \
|
||||
evr.c \
|
||||
main.c
|
||||
|
||||
IDL_SRCS = evr_classes.idl
|
||||
|
|
|
@ -0,0 +1,235 @@
|
|||
/*
|
||||
* 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;
|
||||
|
||||
IUnknown IUnknown_inner;
|
||||
} evr_filter;
|
||||
|
||||
static inline evr_filter *impl_from_inner_IUnknown(IUnknown *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, evr_filter, IUnknown_inner);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI inner_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
evr_filter *This = impl_from_inner_IUnknown(iface);
|
||||
TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if (IsEqualIID(riid, &IID_IUnknown))
|
||||
*ppv = &This->IUnknown_inner;
|
||||
|
||||
else if (IsEqualIID(riid, &IID_IAMCertifiedOutputProtection))
|
||||
FIXME("No interface for IID_IAMCertifiedOutputProtection\n");
|
||||
else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
|
||||
FIXME("No interface for IID_IAMFilterMiscFlags\n");
|
||||
else if (IsEqualIID(riid, &IID_IBaseFilter))
|
||||
*ppv =&This->filter.IBaseFilter_iface;
|
||||
else if (IsEqualIID(riid, &IID_IMediaFilter))
|
||||
*ppv =&This->filter.IBaseFilter_iface;
|
||||
else if (IsEqualIID(riid, &IID_IPersist))
|
||||
*ppv =&This->filter.IBaseFilter_iface;
|
||||
else if (IsEqualIID(riid, &IID_IKsPropertySet))
|
||||
FIXME("No interface for IID_IKsPropertySet\n");
|
||||
else if (IsEqualIID(riid, &IID_IMediaEventSink))
|
||||
FIXME("No interface for IID_IMediaEventSink\n");
|
||||
else if (IsEqualIID(riid, &IID_IMediaSeeking))
|
||||
FIXME("No interface for IID_IMediaSeeking\n");
|
||||
else if (IsEqualIID(riid, &IID_IQualityControl))
|
||||
FIXME("No interface for IID_IQualityControl\n");
|
||||
else if (IsEqualIID(riid, &IID_IQualProp))
|
||||
FIXME("No interface for IID_IQualProp\n");
|
||||
|
||||
else if (IsEqualIID(riid, &IID_IEVRFilterConfig))
|
||||
FIXME("No interface for IID_IEVRFilterConfig\n");
|
||||
else if (IsEqualIID(riid, &IID_IMFGetService))
|
||||
FIXME("No interface for IID_IMFGetService\n");
|
||||
else if (IsEqualIID(riid, &IID_IMFVideoPositionMapper))
|
||||
FIXME("No interface for IID_IMFVideoPositionMapper\n");
|
||||
else if (IsEqualIID(riid, &IID_IMFVideoRenderer))
|
||||
FIXME("No interface for IID_IMFVideoRenderer\n");
|
||||
|
||||
else if (IsEqualIID(riid, &IID_IMemInputPin))
|
||||
FIXME("No interface for IID_IMemInputPin\n");
|
||||
else if (IsEqualIID(riid, &IID_IPin))
|
||||
FIXME("No interface for IID_IPin\n");
|
||||
else if (IsEqualIID(riid, &IID_IQualityControl))
|
||||
FIXME("No interface for IID_IQualityControl\n");
|
||||
|
||||
else if (IsEqualIID(riid, &IID_IDirectXVideoMemoryConfiguration))
|
||||
FIXME("No interface for IID_IDirectXVideoMemoryConfiguration\n");
|
||||
|
||||
if (*ppv)
|
||||
{
|
||||
IUnknown_AddRef((IUnknown *)(*ppv));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI inner_AddRef(IUnknown *iface)
|
||||
{
|
||||
evr_filter *This = impl_from_inner_IUnknown(iface);
|
||||
ULONG ref = BaseFilterImpl_AddRef(&This->filter.IBaseFilter_iface);
|
||||
|
||||
TRACE("(%p, %p)->(): new ref %d\n", iface, This, ref);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI inner_Release(IUnknown *iface)
|
||||
{
|
||||
evr_filter *This = impl_from_inner_IUnknown(iface);
|
||||
ULONG ref = BaseFilterImpl_Release(&This->filter.IBaseFilter_iface);
|
||||
|
||||
TRACE("(%p, %p)->(): new ref %d\n", iface, This, ref);
|
||||
|
||||
if (!ref)
|
||||
CoTaskMemFree(This);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static const IUnknownVtbl evr_inner_vtbl =
|
||||
{
|
||||
inner_QueryInterface,
|
||||
inner_AddRef,
|
||||
inner_Release
|
||||
};
|
||||
|
||||
static inline evr_filter *impl_from_IBaseFilter(IBaseFilter *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, evr_filter, filter);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI filter_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
evr_filter *This = impl_from_IBaseFilter(iface);
|
||||
return IUnknown_QueryInterface(&This->IUnknown_inner, riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI filter_AddRef(IBaseFilter *iface)
|
||||
{
|
||||
evr_filter *This = impl_from_IBaseFilter(iface);
|
||||
LONG ret;
|
||||
|
||||
ret = IUnknown_AddRef(&This->IUnknown_inner);
|
||||
|
||||
TRACE("(%p)->AddRef from %d\n", iface, ret - 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ULONG WINAPI filter_Release(IBaseFilter *iface)
|
||||
{
|
||||
evr_filter *This = impl_from_IBaseFilter(iface);
|
||||
LONG ret;
|
||||
|
||||
ret = IUnknown_Release(&This->IUnknown_inner);
|
||||
|
||||
TRACE("(%p)->Release from %d\n", iface, ret + 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const IBaseFilterVtbl basefilter_vtbl =
|
||||
{
|
||||
filter_QueryInterface,
|
||||
filter_AddRef,
|
||||
filter_Release,
|
||||
BaseFilterImpl_GetClassID,
|
||||
BaseRendererImpl_Stop,
|
||||
BaseRendererImpl_Pause,
|
||||
BaseRendererImpl_Run,
|
||||
BaseRendererImpl_GetState,
|
||||
BaseRendererImpl_SetSyncSource,
|
||||
BaseFilterImpl_GetSyncSource,
|
||||
BaseFilterImpl_EnumPins,
|
||||
BaseRendererImpl_FindPin,
|
||||
BaseFilterImpl_QueryFilterInfo,
|
||||
BaseFilterImpl_JoinFilterGraph,
|
||||
BaseFilterImpl_QueryVendorInfo
|
||||
};
|
||||
|
||||
static IPin* WINAPI filter_GetPin(BaseFilter *iface, int position)
|
||||
{
|
||||
FIXME("(%p, %d): stub!\n", iface, position);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static LONG WINAPI filter_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
FIXME("(%p): stub!\n", iface);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable basefilter_functable =
|
||||
{
|
||||
filter_GetPin,
|
||||
filter_GetPinCount,
|
||||
};
|
||||
|
||||
HRESULT evr_filter_create(IUnknown *outer_unk, void **ppv)
|
||||
{
|
||||
evr_filter *object;
|
||||
|
||||
TRACE("(%p, %p)\n", outer_unk, ppv);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(outer_unk != NULL)
|
||||
{
|
||||
FIXME("Aggregation yet unsupported!\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
object = CoTaskMemAlloc(sizeof(evr_filter));
|
||||
if (!object)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
BaseFilter_Init(&object->filter, &basefilter_vtbl, &CLSID_EnhancedVideoRenderer,
|
||||
(DWORD_PTR)(__FILE__ ": EVR.csFilter"), &basefilter_functable);
|
||||
|
||||
object->IUnknown_inner.lpVtbl = &evr_inner_vtbl;
|
||||
|
||||
*ppv = &object->IUnknown_inner;
|
||||
|
||||
return S_OK;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#pragma makedep register
|
||||
|
||||
#include "strmif.idl"
|
||||
|
||||
[
|
||||
helpstring("Enhanced Video Renderer"),
|
||||
threading(both),
|
||||
uuid(fa10746c-9b63-4b6c-bc49-fc300ea5f256)
|
||||
]
|
||||
coclass EnhancedVideoRenderer { interface IBaseFilter; }
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef __EVR_PRIVATE_INCLUDED__
|
||||
#define __EVR_PRIVATE_INCLUDED__
|
||||
|
||||
#include "dshow.h"
|
||||
#include "evr.h"
|
||||
|
||||
HRESULT evr_filter_create(IUnknown *outer_unk, void **ppv) DECLSPEC_HIDDEN;
|
||||
|
||||
|
||||
#endif /* __EVR_PRIVATE_INCLUDED__ */
|
|
@ -28,6 +28,8 @@
|
|||
#include "ole2.h"
|
||||
#include "rpcproxy.h"
|
||||
|
||||
#include "evr_private.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(evr);
|
||||
|
@ -71,7 +73,7 @@ struct object_creation_info
|
|||
|
||||
static const struct object_creation_info object_creation[] =
|
||||
{
|
||||
{ &GUID_NULL, 0 },
|
||||
{ &CLSID_EnhancedVideoRenderer, evr_filter_create },
|
||||
};
|
||||
|
||||
static HRESULT WINAPI classfactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
|
||||
|
|
Loading…
Reference in New Issue