Nikolay Sivov : mf/evr: Pass incoming samples to the mixer.

Alexandre Julliard julliard at winehq.org
Fri Oct 30 16:18:45 CDT 2020


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Oct 30 16:50:46 2020 +0300

mf/evr: Pass incoming samples to the mixer.

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

---

 dlls/mf/evr.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c
index 4dca8515c94..618bbf8924f 100644
--- a/dlls/mf/evr.c
+++ b/dlls/mf/evr.c
@@ -335,19 +335,36 @@ static HRESULT WINAPI video_stream_sink_GetMediaTypeHandler(IMFStreamSink *iface
 static HRESULT WINAPI video_stream_sink_ProcessSample(IMFStreamSink *iface, IMFSample *sample)
 {
     struct video_stream *stream = impl_from_IMFStreamSink(iface);
+    LONGLONG timestamp;
+    HRESULT hr = S_OK;
 
-    FIXME("%p, %p.\n", iface, sample);
+    TRACE("%p, %p.\n", iface, sample);
 
     EnterCriticalSection(&stream->cs);
-    if (stream->flags & EVR_STREAM_PREROLLING)
+
+    if (!stream->parent)
+        hr = MF_E_STREAMSINK_REMOVED;
+    else if (!stream->parent->clock)
+        hr = MF_E_NO_CLOCK;
+    else if (FAILED(hr = IMFSample_GetSampleTime(sample, &timestamp)))
+    {
+        WARN("No sample timestamp, hr %#x.\n", hr);
+    }
+    else if (stream->parent->state == EVR_STATE_RUNNING)
     {
-        IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkPrerolled, &GUID_NULL, S_OK, NULL);
-        stream->flags &= ~EVR_STREAM_PREROLLING;
-        stream->flags |= EVR_STREAM_PREROLLED;
+        IMFTransform_ProcessInput(stream->parent->mixer, stream->id, sample, 0);
+
+        if (stream->flags & EVR_STREAM_PREROLLING)
+        {
+            IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamSinkPrerolled, &GUID_NULL, S_OK, NULL);
+            stream->flags &= ~EVR_STREAM_PREROLLING;
+            stream->flags |= EVR_STREAM_PREROLLED;
+        }
     }
+
     LeaveCriticalSection(&stream->cs);
 
-    return E_NOTIMPL;
+    return hr;
 }
 
 static HRESULT WINAPI video_stream_sink_PlaceMarker(IMFStreamSink *iface, MFSTREAMSINK_MARKER_TYPE marker_type,




More information about the wine-cvs mailing list