Send INVALIDATEMEDIATYPE to allow the transform type to be set before retrying PROCESSINPUTNOTIFY.
-- v4: mf: Send MEError when IMFStreamSink_ProcessSample fails. mf: Retry PROCESSINPUTNOTIFY if TRANSFORM_TYPE_NOT_SET is returned.
From: Brendan McGrath bmcgrath@codeweavers.com
Send INVALIDATEMEDIATYPE to allow the transform type to be set before retrying PROCESSINPUTNOTIFY. --- dlls/mf/evr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index db7053a1405..a13c2d7e89b 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -416,7 +416,10 @@ static HRESULT WINAPI video_stream_sink_ProcessSample(IMFStreamSink *iface, IMFS }
if (SUCCEEDED(IMFTransform_ProcessInput(stream->parent->mixer, stream->id, sample, 0))) - IMFVideoPresenter_ProcessMessage(stream->parent->presenter, MFVP_MESSAGE_PROCESSINPUTNOTIFY, 0); + { + while (hr == S_OK && (hr = IMFVideoPresenter_ProcessMessage(stream->parent->presenter, MFVP_MESSAGE_PROCESSINPUTNOTIFY, 0)) == MF_E_TRANSFORM_TYPE_NOT_SET) + hr = IMFVideoPresenter_ProcessMessage(stream->parent->presenter, MFVP_MESSAGE_INVALIDATEMEDIATYPE, 0); + }
if (stream->flags & EVR_STREAM_PREROLLING) {
From: Brendan McGrath bmcgrath@codeweavers.com
--- dlls/mf/session.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 3c989249229..9645d0b0394 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -3707,6 +3707,7 @@ static void session_deliver_sample_to_node(struct media_session *session, struct { if (FAILED(hr = IMFStreamSink_ProcessSample(topo_node->object.sink_stream, sample))) WARN("Stream sink failed to process sample, hr %#lx.\n", hr); + IMFMediaEventQueue_QueueEventParamVar(session->event_queue, MEError, &GUID_NULL, hr, NULL); } else if (FAILED(hr = IMFStreamSink_PlaceMarker(topo_node->object.sink_stream, MFSTREAMSINK_MARKER_ENDOFSEGMENT, NULL, NULL)))
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147501
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000020D00D2, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
On Tue Jul 30 13:12:14 2024 +0000, Nikolay Sivov wrote:
It's not clear what it should do if MFVP_MESSAGE_PROCESSINPUTNOTIFY keeps failing, of if MFVP_MESSAGE_INVALIDATEMEDIATYPE fails. Regarding the tests, the main problem is that such tests quickly become unmanageable, once you add some other paths to test different situation. Also it's covered with broken() checks all over. It might be better to figure out first if we need to retry more than once, and then strip the tests and attach them as a plain diff for this MR.
Thanks for taking a look @nsivov.
I've done as you suggested. I added some tests to see what happens when an error occurs with either `MFVP_MESSAGE_PROCESSINPUTNOTIFY` or `MFVP_MESSAGE_INVALIDATEMEDIATYPE` and found Windows will in fact loop indefinitely if `MFVP_MESSAGE_PROCESSINPUTNOTIFY` keeps returning `MF_E_TRANSFORM_TYPE_NOT_SET`. So I have modified the MR so we do the same.
I also found that on another error (such as `E_FAIL`), it will not retry but will raise an `MEError`. I've added a second commit to reflect this.
I've also removed the tests from the MR, and instead I have attached them here.[cw_23939_tests.patch](/uploads/5ec73aaba969babf7d8c6b16a4c8d5a0/cw_23939_tests.patch)