Zebediah Figura : quartz/vmr9: Implement IVMRFilterConfig9::GetNumberOfStreams().

Alexandre Julliard julliard at winehq.org
Wed May 13 16:29:53 CDT 2020


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue May 12 21:24:59 2020 -0500

quartz/vmr9: Implement IVMRFilterConfig9::GetNumberOfStreams().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/tests/vmr9.c | 26 +++++++++++---------------
 dlls/quartz/vmr9.c       | 20 ++++++++++++++++----
 2 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index 2129429bfb..3edc91a342 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -170,16 +170,14 @@ static void test_filter_config(void)
     ok(hr == S_OK, "Got hr %#x.\n", hr);
 
     hr = IVMRFilterConfig9_GetNumberOfStreams(config, &count);
-    todo_wine ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr);
+    ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr);
 
     hr = IVMRFilterConfig9_SetNumberOfStreams(config, 3);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
 
     hr = IVMRFilterConfig9_GetNumberOfStreams(config, &count);
-    todo_wine {
-        ok(hr == S_OK, "Got hr %#x.\n", hr);
-        ok(count == 3, "Got count %u.\n", count);
-    }
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(count == 3, "Got count %u.\n", count);
 
     hr = IVMRFilterConfig9_GetRenderingMode(config, &mode);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -195,10 +193,8 @@ static void test_filter_config(void)
     ok(mode == VMR9Mode_Windowless, "Got mode %#x.\n", mode);
 
     hr = IVMRFilterConfig9_GetNumberOfStreams(config, &count);
-    todo_wine {
-        ok(hr == S_OK, "Got hr %#x.\n", hr);
-        ok(count == 3, "Got count %u.\n", count);
-    }
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(count == 3, "Got count %u.\n", count);
 
     ref = IVMRFilterConfig9_Release(config);
     ok(!ref, "Got outstanding refcount %d.\n", ref);
@@ -3147,14 +3143,14 @@ static void test_mixing_mode(void)
         ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
 
         hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count);
-        todo_wine ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr);
+        ok(hr == VFW_E_VMR_NOT_IN_MIXER_MODE, "Got hr %#x.\n", hr);
 
         hr = IVMRFilterConfig9_SetNumberOfStreams(config, 1);
         ok(hr == S_OK, "Got hr %#x.\n", hr);
 
         hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count);
-        todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
-        todo_wine ok(stream_count == 1, "Got %u streams.\n", stream_count);
+        ok(hr == S_OK, "Got hr %#x.\n", hr);
+        ok(stream_count == 1, "Got %u streams.\n", stream_count);
 
         hr = IBaseFilter_QueryInterface(filter, &IID_IVMRMixerControl9, (void **)&mixer_control);
         todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -3165,8 +3161,8 @@ static void test_mixing_mode(void)
         ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
 
         hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count);
-        todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
-        todo_wine ok(stream_count == 1, "Got %u streams.\n", stream_count);
+        ok(hr == S_OK, "Got hr %#x.\n", hr);
+        ok(stream_count == 1, "Got %u streams.\n", stream_count);
 
         IVMRFilterConfig9_Release(config);
         ref = IBaseFilter_Release(filter);
@@ -3195,7 +3191,7 @@ static void test_mixing_mode(void)
     todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
 
     hr = IVMRFilterConfig9_GetNumberOfStreams(config, &stream_count);
-    todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
     todo_wine ok(stream_count == 4, "Got %u streams.\n", stream_count);
 
     IVMRWindowlessControl9_Release(windowless_control);
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index ef306a546b..6dfc82804f 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -1301,12 +1301,24 @@ static HRESULT WINAPI VMR9FilterConfig_SetNumberOfStreams(IVMRFilterConfig9 *ifa
     return S_OK;
 }
 
-static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams(IVMRFilterConfig9 *iface, DWORD *max)
+static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams(IVMRFilterConfig9 *iface, DWORD *count)
 {
-    struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface);
+    struct quartz_vmr *filter = impl_from_IVMRFilterConfig9(iface);
 
-    FIXME("(%p/%p)->(%p) stub\n", iface, This, max);
-    return E_NOTIMPL;
+    TRACE("filter %p, count %p.\n", filter, count);
+
+    EnterCriticalSection(&filter->renderer.filter.csFilter);
+
+    if (!filter->stream_count)
+    {
+        LeaveCriticalSection(&filter->renderer.filter.csFilter);
+        return VFW_E_VMR_NOT_IN_MIXER_MODE;
+    }
+
+    *count = filter->stream_count;
+
+    LeaveCriticalSection(&filter->renderer.filter.csFilter);
+    return S_OK;
 }
 
 static HRESULT WINAPI VMR9FilterConfig_SetRenderingPrefs(IVMRFilterConfig9 *iface, DWORD renderflags)




More information about the wine-cvs mailing list