Nikolay Sivov : evr/tests: Add basic creation test for default mixer object.

Alexandre Julliard julliard at winehq.org
Wed Jun 17 15:54:02 CDT 2020


Module: wine
Branch: master
Commit: d492f7bbf818ba35a0bb8a7be2d814c0ba8acc5a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d492f7bbf818ba35a0bb8a7be2d814c0ba8acc5a

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Jun 17 14:59:32 2020 +0300

evr/tests: Add basic creation test for default mixer object.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/evr/Makefile.in       |  4 +++-
 dlls/evr/evr.spec          |  2 +-
 dlls/evr/mixer.c           | 28 ++++++++++++++++++++++++
 dlls/evr/tests/Makefile.in |  2 +-
 dlls/evr/tests/evr.c       | 32 +++++++++++++++++++++++++++
 include/evr.idl            | 54 ++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 119 insertions(+), 3 deletions(-)

diff --git a/dlls/evr/Makefile.in b/dlls/evr/Makefile.in
index 053d80e61d..8f971dca06 100644
--- a/dlls/evr/Makefile.in
+++ b/dlls/evr/Makefile.in
@@ -1,10 +1,12 @@
 MODULE    = evr.dll
+IMPORTLIB = evr
 IMPORTS   = mfuuid strmiids strmbase uuid ole32 oleaut32
 
 EXTRADLLFLAGS = -mno-cygwin
 
 C_SRCS = \
 	evr.c \
-	main.c
+	main.c \
+	mixer.c
 
 IDL_SRCS = evr_classes.idl
diff --git a/dlls/evr/evr.spec b/dlls/evr/evr.spec
index c78900c576..ea87f16da1 100644
--- a/dlls/evr/evr.spec
+++ b/dlls/evr/evr.spec
@@ -13,7 +13,7 @@
 @ stub MFCreateVideoMediaTypeFromSubtype
 @ stub MFCreateVideoMediaTypeFromVideoInfoHeader2
 @ stub MFCreateVideoMediaTypeFromVideoInfoHeader
-@ stub MFCreateVideoMixer
+@ stdcall MFCreateVideoMixer(ptr ptr ptr ptr)
 @ stub MFCreateVideoMixerAndPresenter
 @ stub MFCreateVideoOTA
 @ stub MFCreateVideoPresenter2
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c
new file mode 100644
index 0000000000..fe2f4bab1d
--- /dev/null
+++ b/dlls/evr/mixer.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2020 Nikolay Sivov
+ *
+ * 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
+ */
+
+#include "wine/debug.h"
+#include "evr.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(evr);
+
+HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj)
+{
+    FIXME("%p, %s, %s, %p.\n", owner, debugstr_guid(riid_device), debugstr_guid(riid), obj);
+    return E_NOTIMPL;
+}
diff --git a/dlls/evr/tests/Makefile.in b/dlls/evr/tests/Makefile.in
index 8dc11e5e55..529c535450 100644
--- a/dlls/evr/tests/Makefile.in
+++ b/dlls/evr/tests/Makefile.in
@@ -1,5 +1,5 @@
 TESTDLL   = evr.dll
-IMPORTS   = mfuuid strmiids uuid ole32 oleaut32
+IMPORTS   = mfuuid strmiids uuid dxguid ole32 oleaut32 evr
 
 C_SRCS = \
 	evr.c
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c
index 489b7b949d..adb2b777a2 100644
--- a/dlls/evr/tests/evr.c
+++ b/dlls/evr/tests/evr.c
@@ -22,6 +22,7 @@
 #include "dshow.h"
 #include "wine/test.h"
 #include "d3d9.h"
+#include "evr.h"
 #include "initguid.h"
 #include "dxva2api.h"
 
@@ -337,6 +338,36 @@ static void test_pin_info(void)
     ok(!ref, "Got outstanding refcount %d.\n", ref);
 }
 
+static void test_default_mixer(void)
+{
+    IMFTransform *transform;
+    IUnknown *unk;
+    HRESULT hr;
+
+    hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&transform);
+todo_wine
+    ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
+    if (FAILED(hr))
+        return;
+
+    hr = IMFTransform_QueryInterface(transform, &IID_IMFTopologyServiceLookupClient, (void **)&unk);
+    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    IUnknown_Release(unk);
+
+    hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoDeviceID, (void **)&unk);
+    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    IUnknown_Release(unk);
+
+    IMFTransform_Release(transform);
+
+    hr = MFCreateVideoMixer(NULL, &IID_IMFTransform, &IID_IMFTransform, (void **)&transform);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+
+    hr = CoCreateInstance(&CLSID_MFVideoMixer9, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, (void **)&transform);
+    ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
+    IMFTransform_Release(transform);
+}
+
 START_TEST(evr)
 {
     CoInitialize(NULL);
@@ -346,6 +377,7 @@ START_TEST(evr)
     test_enum_pins();
     test_find_pin();
     test_pin_info();
+    test_default_mixer();
 
     CoUninitialize();
 }
diff --git a/include/evr.idl b/include/evr.idl
index 3768b41b16..39b4853b2e 100644
--- a/include/evr.idl
+++ b/include/evr.idl
@@ -107,3 +107,57 @@ interface IMFVideoRenderer : IUnknown
         [in] IMFVideoPresenter *pVideoPresenter
     );
 }
+
+typedef enum _MF_SERVICE_LOOKUP_TYPE
+{
+    MF_SERVICE_LOOKUP_UPSTREAM,
+    MF_SERVICE_LOOKUP_UPSTREAM_DIRECT,
+    MF_SERVICE_LOOKUP_DOWNSTREAM,
+    MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT,
+    MF_SERVICE_LOOKUP_ALL,
+    MF_SERVICE_LOOKUP_GLOBAL,
+} MF_SERVICE_LOOKUP_TYPE;
+
+[
+    object,
+    uuid(fa993889-4383-415a-a930-dd472a8cf6f7),
+    local
+]
+interface IMFTopologyServiceLookup : IUnknown
+{
+    HRESULT LookupService(
+        [in] MF_SERVICE_LOOKUP_TYPE lookup_type,
+        [in] DWORD index,
+        [in] REFGUID service,
+        [in] REFIID riid,
+        [out, iid_is(riid)] void **objects,
+        [in, out] DWORD *num_objects
+    );
+}
+
+[
+    object,
+    uuid(fa99388a-4383-415a-a930-dd472a8cf6f7),
+    local
+]
+interface IMFTopologyServiceLookupClient : IUnknown
+{
+    HRESULT InitServicePointers(
+        [in] IMFTopologyServiceLookup *service_lookup
+    );
+    HRESULT ReleaseServicePointers();
+}
+
+[
+    object,
+    uuid(a38d9567-5a9c-4f3c-b293-8eb415b279ba),
+    local
+]
+interface IMFVideoDeviceID : IUnknown
+{
+    HRESULT GetDeviceID(
+        [out] IID *device_id
+    );
+}
+
+cpp_quote("HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);")




More information about the wine-cvs mailing list