This MR adds two tests for additional test coverage in preparation of an update to MF Media Engine to use a dedicated Video Sink instead of the Sample Grabber
-- v4: mfmediaengine/tests: Add test for audio only.
From: Brendan McGrath bmcgrath@codeweavers.com
This test is extracted from a patch provided by Nikolay Sivov. --- dlls/mfmediaengine/tests/mfmediaengine.c | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
diff --git a/dlls/mfmediaengine/tests/mfmediaengine.c b/dlls/mfmediaengine/tests/mfmediaengine.c index bf8de216890..f6f9c3f7993 100644 --- a/dlls/mfmediaengine/tests/mfmediaengine.c +++ b/dlls/mfmediaengine/tests/mfmediaengine.c @@ -2676,6 +2676,49 @@ done: IMFByteStream_Release(stream); }
+static void test_audio_only(void) +{ + struct media_engine_notify *notify; + IMFMediaEngine *media_engine; + IMFAttributes *attributes; + LONGLONG timestamp; + ULONG refcount; + HRESULT hr; + + notify = create_callback(); + + hr = MFCreateAttributes(&attributes, 2); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFAttributes_SetUnknown(attributes, &MF_MEDIA_ENGINE_CALLBACK, (IUnknown *)¬ify->IMFMediaEngineNotify_iface); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + hr = IMFAttributes_SetUINT32(attributes, &MF_MEDIA_ENGINE_VIDEO_OUTPUT_FORMAT, DXGI_FORMAT_UNKNOWN); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaEngineClassFactory_CreateInstance(factory, MF_MEDIA_ENGINE_AUDIOONLY, attributes, &media_engine); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaEngine_OnVideoStreamTick(media_engine, NULL); + ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaEngine_OnVideoStreamTick(media_engine, ×tamp); + ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaEngine_Shutdown(media_engine); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + IMFAttributes_Release(attributes); + + /* IMFMediaEngineEx_Shutdown can release media_engine in parallel. A small sleep allows this test to pass more + * often than not. But given its a matter of timing, this test is marked flaky */ + Sleep(10); + refcount = IMFMediaEngine_Release(media_engine); + flaky + ok(!refcount, "Unexpected refcount %lu.\n", refcount); + + IMFMediaEngineNotify_Release(¬ify->IMFMediaEngineNotify_iface); +} + START_TEST(mfmediaengine) { HRESULT hr; @@ -2712,6 +2755,7 @@ START_TEST(mfmediaengine) test_GetSeekable(); test_media_extension(); test_SetCurrentTime(); + test_audio_only();
IMFMediaEngineClassFactory_Release(factory);
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=145473
Your paranoid android.
=== w1064v1507 (64 bit report) ===
mfmediaengine: mfmediaengine.c:2564: Test failed: Unexpected time 0.288823.
=== debian11 (32 bit de report) ===
mfmediaengine: mfmediaengine.c:2616: Test failed: Unexpected time 0.133467.
=== debian11b (32 bit WoW report) ===
mfmediaengine: mfmediaengine.c:2564: Test failed: Unexpected time 0.000000.
On Thu May 9 00:53:37 2024 +0000, Brendan McGrath wrote:
changed this line in [version 4 of the diff](/wine/wine/-/merge_requests/5509/diffs?diff_id=113039&start_sha=c9e33d5dc5114068456453e5bbd8c62620e76704#f56f5661ad29be925a16bb2ec6a9a6bb11da77b4_1490_1389)
@nsivov I've removed the second commit (which had the test in question) and just kept the audio only test (which is pretty much untouched from the patch you provided).