Nikolay Sivov : mf/evr: Handle sample requests from the mixer.

Alexandre Julliard julliard at winehq.org
Wed Nov 11 15:31:43 CST 2020


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Nov 11 16:36:46 2020 +0300

mf/evr: Handle sample requests from the mixer.

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

---

 dlls/mf/evr.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c
index 486958f5f79..a77372977c7 100644
--- a/dlls/mf/evr.c
+++ b/dlls/mf/evr.c
@@ -21,6 +21,7 @@
 #include "mf_private.h"
 #include "uuids.h"
 #include "evr.h"
+#include "evcode.h"
 #include "d3d9.h"
 #include "initguid.h"
 #include "dxva2api.h"
@@ -1723,9 +1724,34 @@ static ULONG WINAPI video_renderer_event_sink_Release(IMediaEventSink *iface)
 
 static HRESULT WINAPI video_renderer_event_sink_Notify(IMediaEventSink *iface, LONG event, LONG_PTR param1, LONG_PTR param2)
 {
-    FIXME("%p, %d, %ld, %ld.\n", iface, event, param1, param2);
+    struct video_renderer *renderer = impl_from_IMediaEventSink(iface);
+    HRESULT hr = S_OK;
+    unsigned int idx;
 
-    return E_NOTIMPL;
+    TRACE("%p, %d, %ld, %ld.\n", iface, event, param1, param2);
+
+    EnterCriticalSection(&renderer->cs);
+
+    if (event == EC_SAMPLE_NEEDED)
+    {
+        idx = param1;
+        if (idx >= renderer->stream_count)
+            hr = MF_E_INVALIDSTREAMNUMBER;
+        else
+        {
+            hr = IMFMediaEventQueue_QueueEventParamVar(renderer->streams[idx]->event_queue,
+                MEStreamSinkRequestSample, &GUID_NULL, S_OK, NULL);
+        }
+    }
+    else
+    {
+        WARN("Unhandled event %d.\n", event);
+        hr = MF_E_UNEXPECTED;
+    }
+
+    LeaveCriticalSection(&renderer->cs);
+
+    return hr;
 }
 
 static const IMediaEventSinkVtbl media_event_sink_vtbl =




More information about the wine-cvs mailing list