[PATCH v2 6/7] evr: Add EnhancedVideoRenderer coclass
Fabian Maurer
dark.shadow4 at web.de
Sun Sep 10 10:16:08 CDT 2017
Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
---
dlls/evr/Makefile.in | 5 +-
dlls/evr/evr.c | 164 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/evr/evr_classes.idl | 28 ++++++++
dlls/evr/evr_private.h | 28 ++++++++
dlls/evr/main.c | 4 +-
5 files changed, 227 insertions(+), 2 deletions(-)
create mode 100644 dlls/evr/evr.c
create mode 100644 dlls/evr/evr_classes.idl
create mode 100644 dlls/evr/evr_private.h
diff --git a/dlls/evr/Makefile.in b/dlls/evr/Makefile.in
index 9e52e115b5..9e4da8217b 100644
--- a/dlls/evr/Makefile.in
+++ b/dlls/evr/Makefile.in
@@ -1,5 +1,8 @@
MODULE = evr.dll
-IMPORTS = uuid ole32
+IMPORTS = strmiids strmbase uuid ole32 oleaut32
C_SRCS = \
+ evr.c \
main.c
+
+IDL_SRCS = evr_classes.idl
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c
new file mode 100644
index 0000000000..f4827284a2
--- /dev/null
+++ b/dlls/evr/evr.c
@@ -0,0 +1,164 @@
+/*
+ * 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 basefilter;
+
+ IUnknown IUnknown_inner;
+ LONG ref;
+} evr_impl;
+
+static inline evr_impl *impl_from_inner_IUnknown(IUnknown *iface)
+{
+ return CONTAINING_RECORD(iface, evr_impl, IUnknown_inner);
+}
+
+static HRESULT WINAPI impl_inner_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
+{
+ evr_impl *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))
+ FIXME("No interface for IID_IBaseFilter\n");
+ else if (IsEqualIID(riid, &IID_IMediaFilter))
+ FIXME("No interface for IID_IMediaFilter\n");
+ else if (IsEqualIID(riid, &IID_IPersist))
+ FIXME("No interface for IID_IPersist\n");
+ 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;
+ }
+
+ ERR("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI impl_inner_AddRef(IUnknown *iface)
+{
+ evr_impl *This = impl_from_inner_IUnknown(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p, %p)->(): new ref %d\n", iface, This, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI impl_inner_Release(IUnknown *iface)
+{
+ evr_impl *This = impl_from_inner_IUnknown(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p, %p)->(): new ref %d\n", iface, This, ref);
+
+ if (!ref)
+ {
+ CoTaskMemFree(This);
+ }
+
+ return ref;
+}
+
+static const IUnknownVtbl evr_inner_vtbl =
+{
+ impl_inner_QueryInterface,
+ impl_inner_AddRef,
+ impl_inner_Release
+};
+
+HRESULT evr_impl_create(IUnknown *outer_unk, void **ppv)
+{
+ evr_impl *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_impl));
+ if (!object)
+ return E_OUTOFMEMORY;
+
+ object->IUnknown_inner.lpVtbl = &evr_inner_vtbl;
+ object->ref = 1;
+
+ *ppv = &object->IUnknown_inner;
+
+ return S_OK;
+}
diff --git a/dlls/evr/evr_classes.idl b/dlls/evr/evr_classes.idl
new file mode 100644
index 0000000000..20a346ac67
--- /dev/null
+++ b/dlls/evr/evr_classes.idl
@@ -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; }
diff --git a/dlls/evr/evr_private.h b/dlls/evr/evr_private.h
new file mode 100644
index 0000000000..32a0e94cbe
--- /dev/null
+++ b/dlls/evr/evr_private.h
@@ -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_impl_create(IUnknown *outer_unk, void **ppv) DECLSPEC_HIDDEN;
+
+
+#endif /* __EVR_PRIVATE_INCLUDED__ */
diff --git a/dlls/evr/main.c b/dlls/evr/main.c
index 641aed90e6..acc5c923eb 100644
--- a/dlls/evr/main.c
+++ b/dlls/evr/main.c
@@ -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_impl_create },
};
static HRESULT WINAPI classfactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
--
2.14.1
More information about the wine-patches
mailing list