Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mfplat/main.c | 4 +++- dlls/mfplat/tests/mfplat.c | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index a6ff97ae04a..8ed18b1b87f 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -5750,6 +5750,8 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu if (!(queued_result = heap_alloc_zero(sizeof(*queued_result)))) return E_OUTOFMEMORY;
+ queued_result->origin = origin; + IRtwqAsyncResult_GetObject(inner_result, &handler.handler);
switch (origin) @@ -5788,8 +5790,8 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu
if (SUCCEEDED(RtwqCreateAsyncResult(queued_result->object, data->pCallback, caller_state, &caller_result))) { + queued_result->inner_result = caller_result; RtwqInvokeCallback(caller_result); - IRtwqAsyncResult_Release(caller_result); } }
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 55c07adb1fe..a5388840bc5 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -343,12 +343,10 @@ static HRESULT WINAPI test_create_from_url_callback_Invoke(IMFAsyncCallback *ifa
object = NULL; hr = IMFSourceResolver_EndCreateObjectFromURL(resolver, result, &obj_type, &object); -todo_wine ok(hr == S_OK, "Failed to create an object, hr %#x.\n", hr);
hr = IMFAsyncResult_GetObject(result, &object2); ok(hr == S_OK, "Failed to get result object, hr %#x.\n", hr); -todo_wine ok(object2 == object, "Unexpected object.\n");
if (object)
Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mfmediaengine/main.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index d93e2b2f38c..d1261e3cd73 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -418,7 +418,10 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi { sd_video = sd; IMFStreamDescriptor_AddRef(sd_video); + /* TODO: reintroduce this once we set up video stream nodes */ +#if 0 IMFPresentationDescriptor_SelectStream(pd, i); +#endif }
IMFMediaTypeHandler_Release(type_handler); @@ -480,6 +483,9 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi if (audio_src) IMFTopologyNode_Release(audio_src); } + + if (SUCCEEDED(hr)) + hr = IMFMediaSession_SetTopology(engine->session, MFSESSION_SETTOPOLOGY_IMMEDIATE, topology); }
if (topology)
On 10/17/20 1:02 AM, Derek Lesho wrote:
Signed-off-by: Derek Lesho dlesho@codeweavers.com
dlls/mfmediaengine/main.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index d93e2b2f38c..d1261e3cd73 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -418,7 +418,10 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi { sd_video = sd; IMFStreamDescriptor_AddRef(sd_video);
/* TODO: reintroduce this once we set up video stream nodes */
+#if 0 IMFPresentationDescriptor_SelectStream(pd, i); +#endif }
What do we need to set them up?
IMFMediaTypeHandler_Release(type_handler);
@@ -480,6 +483,9 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi if (audio_src) IMFTopologyNode_Release(audio_src); }
if (SUCCEEDED(hr))
}hr = IMFMediaSession_SetTopology(engine->session, MFSESSION_SETTOPOLOGY_IMMEDIATE, topology);
That's fine, either here or returning new topology to set it in the callback.
if (topology)
On 10/20/20 6:43 AM, Nikolay Sivov wrote:
On 10/17/20 1:02 AM, Derek Lesho wrote:
Signed-off-by: Derek Lesho dlesho@codeweavers.com
dlls/mfmediaengine/main.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index d93e2b2f38c..d1261e3cd73 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -418,7 +418,10 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi { sd_video = sd; IMFStreamDescriptor_AddRef(sd_video);
/* TODO: reintroduce this once we set up video stream nodes */
+#if 0 IMFPresentationDescriptor_SelectStream(pd, i); +#endif }
What do we need to set them up?
I think we need the sample grabber in frame server mode, and the EVR in the normal presentation mode.
IMFMediaTypeHandler_Release(type_handler);
@@ -480,6 +483,9 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi if (audio_src) IMFTopologyNode_Release(audio_src); }
if (SUCCEEDED(hr))
hr = IMFMediaSession_SetTopology(engine->session, MFSESSION_SETTOPOLOGY_IMMEDIATE, topology); }
That's fine, either here or returning new topology to set it in the callback.
Probably less complex to just set it here since we don't access the object later.
if (topology)
Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mfmediaengine/main.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index d1261e3cd73..bc89b2f702a 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -295,6 +295,14 @@ static HRESULT WINAPI media_engine_session_events_Invoke(IMFAsyncCallback *iface IMFMediaEngineNotify_EventNotify(engine->callback, event_type == MEBufferingStarted ? MF_MEDIA_ENGINE_EVENT_BUFFERINGSTARTED : MF_MEDIA_ENGINE_EVENT_BUFFERINGENDED, 0, 0); break; + case MESessionTopologyStatus: + { + UINT32 topo_status = 0; + IMFMediaEvent_GetUINT32(event, &MF_EVENT_TOPOLOGY_STATUS, &topo_status); + if (topo_status == MF_TOPOSTATUS_READY) + IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_CANPLAY, 0, 0); + break; + } }
failed:
Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mfmediaengine/main.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index bc89b2f702a..ed57aec7eb1 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -303,6 +303,10 @@ static HRESULT WINAPI media_engine_session_events_Invoke(IMFAsyncCallback *iface IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_CANPLAY, 0, 0); break; } + case MESessionStarted: + + IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PLAYING, 0, 0); + break; }
failed:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=80523
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
mfplat: mfplat.c:3461: Test failed: Unexpected refcount 1.
=== debiant (32 bit WoW report) ===
mfplat: Unhandled exception: page fault on execute access to 0x0a2e7823 in 32-bit code (0x0a2e7823).
Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mfmediaengine/main.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index ed57aec7eb1..fe9aa81121f 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -307,6 +307,10 @@ static HRESULT WINAPI media_engine_session_events_Invoke(IMFAsyncCallback *iface
IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PLAYING, 0, 0); break; + case MESessionEnded: + + IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_ENDED, 0, 0); + break; }
failed:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=80524
Your paranoid android.
=== debiant (32 bit WoW report) ===
mfplat: Unhandled exception: page fault on execute access to 0x0a2e7823 in 32-bit code (0x0a2e7823).
On 10/17/20 1:02 AM, Derek Lesho wrote:
Signed-off-by: Derek Lesho dlesho@codeweavers.com
dlls/mfplat/main.c | 4 +++- dlls/mfplat/tests/mfplat.c | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index a6ff97ae04a..8ed18b1b87f 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -5750,6 +5750,8 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu if (!(queued_result = heap_alloc_zero(sizeof(*queued_result)))) return E_OUTOFMEMORY;
- queued_result->origin = origin;
- IRtwqAsyncResult_GetObject(inner_result, &handler.handler);
This one is good, only worked before because 0 is occasionally valid too.
switch (origin)
@@ -5788,8 +5790,8 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu
if (SUCCEEDED(RtwqCreateAsyncResult(queued_result->object, data->pCallback, caller_state, &caller_result))) {
queued_result->inner_result = caller_result; RtwqInvokeCallback(caller_result);
}IRtwqAsyncResult_Release(caller_result); }
It's been a while, could you explain what this part fixes? Maybe we could have another test for it.
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 55c07adb1fe..a5388840bc5 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -343,12 +343,10 @@ static HRESULT WINAPI test_create_from_url_callback_Invoke(IMFAsyncCallback *ifa
object = NULL; hr = IMFSourceResolver_EndCreateObjectFromURL(resolver, result, &obj_type, &object);
-todo_wine ok(hr == S_OK, "Failed to create an object, hr %#x.\n", hr);
hr = IMFAsyncResult_GetObject(result, &object2); ok(hr == S_OK, "Failed to get result object, hr %#x.\n", hr);
-todo_wine ok(object2 == object, "Unexpected object.\n");
First hunk alone fixes these two tests for me.
if (object)
On 10/20/20 6:28 AM, Nikolay Sivov wrote:
On 10/17/20 1:02 AM, Derek Lesho wrote:
Signed-off-by: Derek Lesho dlesho@codeweavers.com
dlls/mfplat/main.c | 4 +++- dlls/mfplat/tests/mfplat.c | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index a6ff97ae04a..8ed18b1b87f 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -5750,6 +5750,8 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu if (!(queued_result = heap_alloc_zero(sizeof(*queued_result)))) return E_OUTOFMEMORY;
- queued_result->origin = origin;
IRtwqAsyncResult_GetObject(inner_result, &handler.handler);
This one is good, only worked before because 0 is occasionally valid too.
switch (origin)
@@ -5788,8 +5790,8 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu
if (SUCCEEDED(RtwqCreateAsyncResult(queued_result->object, data->pCallback, caller_state, &caller_result))) {
queued_result->inner_result = caller_result; RtwqInvokeCallback(caller_result);
IRtwqAsyncResult_Release(caller_result); } }
It's been a while, could you explain what this part fixes? Maybe we could have another test for it.
Ah, good catch, I took a glance at `if (iter->inner_result == result || (iter->object == object && iter->origin == origin))` and assumed all three fields had to match. I'll resend without the second hunk.
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 55c07adb1fe..a5388840bc5 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -343,12 +343,10 @@ static HRESULT WINAPI test_create_from_url_callback_Invoke(IMFAsyncCallback *ifa
object = NULL; hr = IMFSourceResolver_EndCreateObjectFromURL(resolver, result, &obj_type, &object);
-todo_wine ok(hr == S_OK, "Failed to create an object, hr %#x.\n", hr);
hr = IMFAsyncResult_GetObject(result, &object2); ok(hr == S_OK, "Failed to get result object, hr %#x.\n", hr);
-todo_wine ok(object2 == object, "Unexpected object.\n");
First hunk alone fixes these two tests for me.
if (object)