From 06b768e634f7b3d9c0447fbaa856e2a9cbf09006 Mon Sep 17 00:00:00 2001 From: Bones Date: Mon, 11 Nov 2024 23:12:31 -0500 Subject: [PATCH] rtsp15-rebase --- patches/protonprep-valve-staging.sh | 22 +-- ...ng-support-for-IMFMediaSession-Start.patch | 18 +- ...reate_media_session_with_source_sink.patch | 14 +- ...-mf-tests-Test-IMFMediaSession-Start.patch | 20 +- ...plement-IMFMediaEngineEx-SetCurrentT.patch | 12 +- ...sts-Test-IMFMediaEngineEx-SetCurrent.patch | 18 +- ...e-Implement-IMFMediaEngine-IsSeeking.patch | 8 +- .../0007-AVPro-Video-seeking-support.patch | 8 +- ...-overflow-when-passing-url-as-filen.patch} | 7 +- ...tialize-condition-variable-of-struc.patch} | 11 +- ...nect-autoplug-continue-and-deep-ele.patch} | 19 +- ...not-create-a-read-thread-for-uridec.patch} | 13 +- ...eamer-Ignore-an-assert-in-wg_parser.patch} | 12 +- ...ke-wg_parser-report-the-exact-suppor.patch | 73 -------- ...d-more-RTSP-based-URI-schemes-to-GSt.patch | 5 +- ...rk-wg_parser-container-bin-as-stream.patch | 10 +- ...t-a-clock-for-the-wg_parser-pipeline.patch | 10 +- ...t-base-time-on-wg_parser-bin-while-c.patch | 13 +- ...t-pipeline-into-PLAYING-state-before.patch | 12 +- ...mer-Handle-a-duration-of-1-correctly.patch | 14 +- ...n-t-only-accept-segment-events-when-.patch | 10 +- ...nvert-buffer-presentation-timestamps.patch | 21 ++- ...order-parser-initialization-code-a-b.patch | 17 +- ...-away-with-the-per-stream-condvars-a.patch | 41 ++-- ...e-pthread_cond_broadcast-instead-of-.patch | 23 +-- ...-not-fail-caps-negotiation-when-ther.patch | 176 +++++++++++------- ...negstreamer-Do-not-seek-live-sources.patch | 64 ++++--- ...gstreamer-Implement-buffering-events.patch | 45 ++--- ...-Send-sample-requests-for-unused-spa.patch | 5 +- ...x-race-between-wg_parser_stream_disa.patch | 9 +- ...ndle-Gstreamer-pipeline-flushes-grac.patch | 16 +- ...-waits-for-samples-on-stream-specifi.patch | 59 +++--- ...e-that-the-command-callback-does-not.patch | 12 +- ...nt-media-session-from-running-comman.patch | 47 ++--- ...rting-audio-renderer-again-after-pau.patch | 5 +- ...eamer-Also-flush-token-queue-on-seek.patch | 10 +- ...ausing-a-media-session-when-the-medi.patch | 29 +-- ...-not-force-uridecodebin-to-expose-un.patch | 36 +++- ...ne-Unstub-IMFMediaEngine-SetAutoPlay.patch | 11 +- ...low-video_frame_sink-to-continue-to-.patch | 61 ++++++ ...r-Add-a-resampler-to-wg_parser-for-.patch} | 11 +- ...r-Add-a-videoscale-element-to-wg_pa.patch} | 13 +- ...e-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch} | 12 +- ...42-Marker-commit-do-not-put-into-MR.patch} | 10 +- ...l-instead-of-syscall-for-QueryPerfo.patch} | 16 +- ...Allocate-memory-buffers-using-calloc.patch | 10 +- ...EBUG-winegstreamer-GST_LOG-GST_DEBUG.patch | 40 ++-- ...yt-dlp.exe-redirection-and-cmdline-m.patch | 4 +- ...ed-timers-for-the-original-time-inst.patch | 4 +- ...ing-samples-only-at-the-PTS-of-the-f.patch | 71 +++---- ...ase-Replace-stderr-of-yt-dlp-process.patch | 4 +- 51 files changed, 655 insertions(+), 556 deletions(-) rename patches/wine-gst/{0043-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch => 0008-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch} (83%) rename patches/wine-gst/{0008-winegstreamer-Initialize-condition-variable-of-struc.patch => 0009-winegstreamer-Initialize-condition-variable-of-struc.patch} (70%) rename patches/wine-gst/{0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch => 0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch} (53%) rename patches/wine-gst/{0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch => 0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch} (79%) rename patches/wine-gst/{0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch => 0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch} (81%) delete mode 100644 patches/wine-gst/0012-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch create mode 100644 patches/wine-gst/0038-mfmediaengine-Allow-video_frame_sink-to-continue-to-.patch rename patches/wine-gst/{0038-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch => 0039-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch} (78%) rename patches/wine-gst/{0039-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch => 0040-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch} (82%) rename patches/wine-gst/{0040-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch => 0041-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch} (88%) rename patches/wine-gst/{0041-Marker-commit-do-not-put-into-MR.patch => 0042-Marker-commit-do-not-put-into-MR.patch} (54%) rename patches/wine-gst/{0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch => 0043-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch} (89%) diff --git a/patches/protonprep-valve-staging.sh b/patches/protonprep-valve-staging.sh index 44f160a62..f0f4db2ff 100755 --- a/patches/protonprep-valve-staging.sh +++ b/patches/protonprep-valve-staging.sh @@ -341,11 +341,11 @@ patch -Np1 < ../patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch patch -Np1 < ../patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch patch -Np1 < ../patches/wine-gst/0007-AVPro-Video-seeking-support.patch - patch -Np1 < ../patches/wine-gst/0008-winegstreamer-Initialize-condition-variable-of-struc.patch - patch -Np1 < ../patches/wine-gst/0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch - patch -Np1 < ../patches/wine-gst/0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch - patch -Np1 < ../patches/wine-gst/0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch - patch -Np1 < ../patches/wine-gst/0012-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch + patch -Np1 < ../patches/wine-gst/0008-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch + patch -Np1 < ../patches/wine-gst/0009-winegstreamer-Initialize-condition-variable-of-struc.patch + patch -Np1 < ../patches/wine-gst/0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch + patch -Np1 < ../patches/wine-gst/0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch + patch -Np1 < ../patches/wine-gst/0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch patch -Np1 < ../patches/wine-gst/0013-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch patch -Np1 < ../patches/wine-gst/0014-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch patch -Np1 < ../patches/wine-gst/0015-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch @@ -371,12 +371,12 @@ patch -Np1 < ../patches/wine-gst/0035-mf-session-Fix-pausing-a-media-session-when-the-medi.patch patch -Np1 < ../patches/wine-gst/0036-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch patch -Np1 < ../patches/wine-gst/0037-mfmediaengine-Unstub-IMFMediaEngine-SetAutoPlay.patch - patch -Np1 < ../patches/wine-gst/0038-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch - patch -Np1 < ../patches/wine-gst/0039-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch - patch -Np1 < ../patches/wine-gst/0040-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch - patch -Np1 < ../patches/wine-gst/0041-Marker-commit-do-not-put-into-MR.patch - patch -Np1 < ../patches/wine-gst/0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch - patch -Np1 < ../patches/wine-gst/0043-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch + patch -Np1 < ../patches/wine-gst/0038-mfmediaengine-Allow-video_frame_sink-to-continue-to-.patch + patch -Np1 < ../patches/wine-gst/0039-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch + patch -Np1 < ../patches/wine-gst/0040-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch + patch -Np1 < ../patches/wine-gst/0041-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch + patch -Np1 < ../patches/wine-gst/0042-Marker-commit-do-not-put-into-MR.patch + patch -Np1 < ../patches/wine-gst/0043-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch patch -Np1 < ../patches/wine-gst/0044-mfplat-Allocate-memory-buffers-using-calloc.patch patch -Np1 < ../patches/wine-gst/0045-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch patch -Np1 < ../patches/wine-gst/0046-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch diff --git a/patches/wine-gst/0001-mf-Add-seeking-support-for-IMFMediaSession-Start.patch b/patches/wine-gst/0001-mf-Add-seeking-support-for-IMFMediaSession-Start.patch index bb44a749f..46cae0792 100644 --- a/patches/wine-gst/0001-mf-Add-seeking-support-for-IMFMediaSession-Start.patch +++ b/patches/wine-gst/0001-mf-Add-seeking-support-for-IMFMediaSession-Start.patch @@ -1,4 +1,4 @@ -From 6d99895f2ca9e3b74de6992296e765ae286139fd Mon Sep 17 00:00:00 2001 +From 7918790918b7ee249d04f6766ea0d6e304100205 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 1 Aug 2023 10:52:21 +0800 Subject: [PATCH 01/49] mf: Add seeking support for IMFMediaSession::Start(). @@ -8,7 +8,7 @@ Subject: [PATCH 01/49] mf: Add seeking support for IMFMediaSession::Start(). 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c -index ef707dea4de..3f3be2b84b0 100644 +index 4f94d3c30a7..a5caad3c97a 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -110,6 +110,7 @@ enum object_state @@ -19,7 +19,7 @@ index ef707dea4de..3f3be2b84b0 100644 OBJ_STATE_INVALID, }; -@@ -912,10 +913,28 @@ static HRESULT session_subscribe_sources(struct media_session *session) +@@ -994,10 +995,28 @@ static HRESULT session_subscribe_sources(struct media_session *session) return hr; } @@ -48,7 +48,7 @@ index ef707dea4de..3f3be2b84b0 100644 HRESULT hr; UINT i; -@@ -932,6 +951,13 @@ static void session_start(struct media_session *session, const GUID *time_format +@@ -1014,6 +1033,13 @@ static void session_start(struct media_session *session, const GUID *time_format /* fallthrough */ case SESSION_STATE_PAUSED: @@ -62,7 +62,7 @@ index ef707dea4de..3f3be2b84b0 100644 session->presentation.time_format = *time_format; session->presentation.start_position.vt = VT_EMPTY; -@@ -945,6 +971,14 @@ static void session_start(struct media_session *session, const GUID *time_format +@@ -1027,6 +1053,14 @@ static void session_start(struct media_session *session, const GUID *time_format LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry) { @@ -77,7 +77,7 @@ index ef707dea4de..3f3be2b84b0 100644 if (FAILED(hr = IMFMediaSource_Start(source->source, source->pd, &GUID_NULL, start_position))) { WARN("Failed to start media source %p, hr %#lx.\n", source->source, hr); -@@ -965,12 +999,22 @@ static void session_start(struct media_session *session, const GUID *time_format +@@ -1047,12 +1081,22 @@ static void session_start(struct media_session *session, const GUID *time_format } } @@ -104,7 +104,7 @@ index ef707dea4de..3f3be2b84b0 100644 default: session_command_complete_with_event(session, MESessionStarted, MF_E_INVALIDREQUEST, NULL); break; -@@ -2206,6 +2250,9 @@ static HRESULT WINAPI mfsession_Start(IMFMediaSession *iface, const GUID *format +@@ -2305,6 +2349,9 @@ static HRESULT WINAPI mfsession_Start(IMFMediaSession *iface, const GUID *format if (!start_position) return E_POINTER; @@ -114,7 +114,7 @@ index ef707dea4de..3f3be2b84b0 100644 if (FAILED(hr = create_session_op(SESSION_CMD_START, &op))) return hr; -@@ -3714,8 +3761,6 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM +@@ -4038,8 +4085,6 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM { case MESourceSeeked: case MEStreamSeeked: @@ -124,5 +124,5 @@ index ef707dea4de..3f3be2b84b0 100644 case MESourcePaused: case MESourceStopped: -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0002-mf-tests-Add-a-create_media_session_with_source_sink.patch b/patches/wine-gst/0002-mf-tests-Add-a-create_media_session_with_source_sink.patch index 484993fba..26126fc12 100644 --- a/patches/wine-gst/0002-mf-tests-Add-a-create_media_session_with_source_sink.patch +++ b/patches/wine-gst/0002-mf-tests-Add-a-create_media_session_with_source_sink.patch @@ -1,4 +1,4 @@ -From d2546730e1c900ceb2688ba94cb3433777099580 Mon Sep 17 00:00:00 2001 +From 6c06159c765dfdf524b3729e3e046954dd4baaa1 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 8 Aug 2023 15:24:34 +0800 Subject: [PATCH 02/49] mf/tests: Add a create_media_session_with_source_sink() @@ -9,10 +9,10 @@ Subject: [PATCH 02/49] mf/tests: Add a create_media_session_with_source_sink() 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c -index 0a34329bd75..e0bcedac20f 100644 +index 9382d8cae35..58d8ec73c4f 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c -@@ -4995,6 +4995,53 @@ static void test_sample_grabber_is_mediatype_supported(void) +@@ -4996,6 +4996,53 @@ static void test_sample_grabber_is_mediatype_supported(void) IMFSampleGrabberSinkCallback_Release(grabber_callback); } @@ -66,7 +66,7 @@ index 0a34329bd75..e0bcedac20f 100644 static void test_sample_grabber_orientation(GUID subtype) { media_type_desc video_rgb32_desc = -@@ -5004,17 +5051,12 @@ static void test_sample_grabber_orientation(GUID subtype) +@@ -5005,17 +5052,12 @@ static void test_sample_grabber_orientation(GUID subtype) }; struct test_grabber_callback *grabber_callback; @@ -84,7 +84,7 @@ index 0a34329bd75..e0bcedac20f 100644 HRESULT hr; DWORD res; -@@ -5035,33 +5077,6 @@ static void test_sample_grabber_orientation(GUID subtype) +@@ -5036,33 +5078,6 @@ static void test_sample_grabber_orientation(GUID subtype) grabber_callback->done_event = CreateEventW(NULL, FALSE, FALSE, NULL); ok(!!grabber_callback->done_event, "CreateEventW failed, error %lu\n", GetLastError()); @@ -118,7 +118,7 @@ index 0a34329bd75..e0bcedac20f 100644 hr = MFCreateMediaType(&output_type); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); init_media_type(output_type, video_rgb32_desc, -1); -@@ -5069,18 +5084,7 @@ static void test_sample_grabber_orientation(GUID subtype) +@@ -5070,18 +5085,7 @@ static void test_sample_grabber_orientation(GUID subtype) ok(hr == S_OK, "Failed to create grabber sink, hr %#lx.\n", hr); IMFMediaType_Release(output_type); @@ -139,5 +139,5 @@ index 0a34329bd75..e0bcedac20f 100644 propvar.vt = VT_EMPTY; hr = IMFMediaSession_Start(session, &GUID_NULL, &propvar); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0003-mf-tests-Test-IMFMediaSession-Start.patch b/patches/wine-gst/0003-mf-tests-Test-IMFMediaSession-Start.patch index f4a131c34..58d99f382 100644 --- a/patches/wine-gst/0003-mf-tests-Test-IMFMediaSession-Start.patch +++ b/patches/wine-gst/0003-mf-tests-Test-IMFMediaSession-Start.patch @@ -1,4 +1,4 @@ -From 23eb22d6b249a18679b1743f734f2c9c4bcf518f Mon Sep 17 00:00:00 2001 +From 17f7aa6528c839bf56c6fd41a853ba924cd67f44 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 7 Aug 2023 11:52:20 +0800 Subject: [PATCH 03/49] mf/tests: Test IMFMediaSession::Start(). @@ -8,10 +8,10 @@ Subject: [PATCH 03/49] mf/tests: Test IMFMediaSession::Start(). 1 file changed, 696 insertions(+), 8 deletions(-) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c -index e0bcedac20f..f164a04b989 100644 +index 58d8ec73c4f..240cbf194ea 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c -@@ -2086,6 +2086,448 @@ static IMFMediaSource *create_media_source(const WCHAR *name, const WCHAR *mime) +@@ -2087,6 +2087,448 @@ static IMFMediaSource *create_media_source(const WCHAR *name, const WCHAR *mime) return source; } @@ -460,7 +460,7 @@ index e0bcedac20f..f164a04b989 100644 static void test_media_session_events(void) { static const media_type_desc audio_float_44100 = -@@ -2887,27 +3329,27 @@ static ULONG WINAPI test_grabber_callback_Release(IMFSampleGrabberSinkCallback * +@@ -2888,27 +3330,27 @@ static ULONG WINAPI test_grabber_callback_Release(IMFSampleGrabberSinkCallback * static HRESULT WINAPI test_grabber_callback_OnClockStart(IMFSampleGrabberSinkCallback *iface, MFTIME time, LONGLONG offset) { @@ -493,7 +493,7 @@ index e0bcedac20f..f164a04b989 100644 } static HRESULT WINAPI test_grabber_callback_OnSetPresentationClock(IMFSampleGrabberSinkCallback *iface, -@@ -4995,9 +5437,9 @@ static void test_sample_grabber_is_mediatype_supported(void) +@@ -4996,9 +5438,9 @@ static void test_sample_grabber_is_mediatype_supported(void) IMFSampleGrabberSinkCallback_Release(grabber_callback); } @@ -505,7 +505,7 @@ index e0bcedac20f..f164a04b989 100644 { IMFTopologyNode *src_node, *sink_node; IMFPresentationDescriptor *pd; -@@ -5025,6 +5467,11 @@ static void create_media_session_with_source_sink(IMFMediaSource *source, IMFAct +@@ -5026,6 +5468,11 @@ static void create_media_session_with_source_sink(IMFMediaSource *source, IMFAct hr = IMFPresentationDescriptor_GetStreamDescriptorByIndex(pd, 0, &selected, &sd); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(selected, "got selected %u.\n", !!selected); @@ -517,7 +517,7 @@ index e0bcedac20f..f164a04b989 100644 init_source_node(source, -1, src_node, pd, sd); hr = IMFTopologyNode_SetObject(sink_node, (IUnknown *)sink_activate); ok(hr == S_OK, "Failed to set object, hr %#lx.\n", hr); -@@ -5084,7 +5531,7 @@ static void test_sample_grabber_orientation(GUID subtype) +@@ -5085,7 +5532,7 @@ static void test_sample_grabber_orientation(GUID subtype) ok(hr == S_OK, "Failed to create grabber sink, hr %#lx.\n", hr); IMFMediaType_Release(output_type); @@ -526,7 +526,7 @@ index e0bcedac20f..f164a04b989 100644 propvar.vt = VT_EMPTY; hr = IMFMediaSession_Start(session, &GUID_NULL, &propvar); -@@ -7280,6 +7727,246 @@ static void test_MFCreateSequencerSegmentOffset(void) +@@ -7286,6 +7733,246 @@ static void test_MFCreateSequencerSegmentOffset(void) PropVariantClear(&propvar); } @@ -773,12 +773,12 @@ index e0bcedac20f..f164a04b989 100644 START_TEST(mf) { init_functions(); -@@ -7316,4 +8003,5 @@ START_TEST(mf) +@@ -7322,4 +8009,5 @@ START_TEST(mf) test_MFRequireProtectedEnvironment(); test_mpeg4_media_sink(); test_MFCreateSequencerSegmentOffset(); + test_media_session_Start(); } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0004-mfmediaengine-Implement-IMFMediaEngineEx-SetCurrentT.patch b/patches/wine-gst/0004-mfmediaengine-Implement-IMFMediaEngineEx-SetCurrentT.patch index b7b697b0d..832577023 100644 --- a/patches/wine-gst/0004-mfmediaengine-Implement-IMFMediaEngineEx-SetCurrentT.patch +++ b/patches/wine-gst/0004-mfmediaengine-Implement-IMFMediaEngineEx-SetCurrentT.patch @@ -1,4 +1,4 @@ -From c9cb24b06e0d2b41d9026eeddc929474006a606d Mon Sep 17 00:00:00 2001 +From 538f935fa7b23f9502975f7902c24e5c9de0757d Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 28 Jul 2023 18:04:30 +0800 Subject: [PATCH 04/49] mfmediaengine: Implement @@ -9,7 +9,7 @@ Subject: [PATCH 04/49] mfmediaengine: Implement 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c -index 9e41d9dad84..28a273616c8 100644 +index 57bd2f82cec..d6d6b2fd7ab 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -96,6 +96,7 @@ enum media_engine_flags @@ -20,7 +20,7 @@ index 9e41d9dad84..28a273616c8 100644 }; struct vec3 -@@ -982,7 +983,14 @@ static HRESULT WINAPI media_engine_session_events_Invoke(IMFAsyncCallback *iface +@@ -955,7 +956,14 @@ static HRESULT WINAPI media_engine_session_events_Invoke(IMFAsyncCallback *iface break; } case MESessionStarted: @@ -36,7 +36,7 @@ index 9e41d9dad84..28a273616c8 100644 IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PLAYING, 0, 0); break; case MESessionEnded: -@@ -1846,19 +1854,9 @@ static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface) +@@ -1817,19 +1825,9 @@ static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface) static HRESULT WINAPI media_engine_SetCurrentTime(IMFMediaEngineEx *iface, double time) { @@ -58,7 +58,7 @@ index 9e41d9dad84..28a273616c8 100644 } static double WINAPI media_engine_GetStartTime(IMFMediaEngineEx *iface) -@@ -3059,9 +3057,43 @@ static HRESULT WINAPI media_engine_SetRealTimeMode(IMFMediaEngineEx *iface, BOOL +@@ -3108,9 +3106,43 @@ static HRESULT WINAPI media_engine_SetRealTimeMode(IMFMediaEngineEx *iface, BOOL static HRESULT WINAPI media_engine_SetCurrentTimeEx(IMFMediaEngineEx *iface, double seektime, MF_MEDIA_ENGINE_SEEK_MODE mode) { @@ -105,5 +105,5 @@ index 9e41d9dad84..28a273616c8 100644 static HRESULT WINAPI media_engine_EnableTimeUpdateTimer(IMFMediaEngineEx *iface, BOOL enable) -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch b/patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch index 3d07b0584..3424bc14b 100644 --- a/patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch +++ b/patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch @@ -1,4 +1,4 @@ -From aa917ac9bc5d31f786f16bb4d5765d53d63b50ea Mon Sep 17 00:00:00 2001 +From 0961c4c7828f15209444a55e807a0360f6037a08 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 7 Aug 2023 11:53:41 +0800 Subject: [PATCH 05/49] mfmediaengine/tests: Test @@ -9,10 +9,10 @@ Subject: [PATCH 05/49] mfmediaengine/tests: Test 1 file changed, 183 insertions(+) diff --git a/dlls/mfmediaengine/tests/mfmediaengine.c b/dlls/mfmediaengine/tests/mfmediaengine.c -index 47130d8e436..29a11d034cd 100644 +index 63a7e139193..506faec231c 100644 --- a/dlls/mfmediaengine/tests/mfmediaengine.c +++ b/dlls/mfmediaengine/tests/mfmediaengine.c -@@ -2185,6 +2185,9 @@ struct test_seek_notify +@@ -2156,6 +2156,9 @@ struct test_seek_notify { IMFMediaEngineNotify IMFMediaEngineNotify_iface; HANDLE playing_event; @@ -22,7 +22,7 @@ index 47130d8e436..29a11d034cd 100644 HRESULT expected_error; HRESULT error; LONG refcount; -@@ -2224,6 +2227,9 @@ static ULONG WINAPI test_seek_notify_Release(IMFMediaEngineNotify *iface) +@@ -2195,6 +2198,9 @@ static ULONG WINAPI test_seek_notify_Release(IMFMediaEngineNotify *iface) if (!refcount) { CloseHandle(notify->playing_event); @@ -32,7 +32,7 @@ index 47130d8e436..29a11d034cd 100644 free(notify); } -@@ -2240,6 +2246,15 @@ static HRESULT WINAPI test_seek_notify_EventNotify(IMFMediaEngineNotify *iface, +@@ -2211,6 +2217,15 @@ static HRESULT WINAPI test_seek_notify_EventNotify(IMFMediaEngineNotify *iface, case MF_MEDIA_ENGINE_EVENT_PLAYING: SetEvent(notify->playing_event); break; @@ -48,7 +48,7 @@ index 47130d8e436..29a11d034cd 100644 case MF_MEDIA_ENGINE_EVENT_ERROR: ok(param2 == notify->expected_error, "Unexpected error %#lx\n", param2); notify->error = param2; -@@ -2264,7 +2279,13 @@ static struct test_seek_notify *create_seek_notify(void) +@@ -2235,7 +2250,13 @@ static struct test_seek_notify *create_seek_notify(void) object = calloc(1, sizeof(*object)); object->IMFMediaEngineNotify_iface.lpVtbl = &test_seek_notify_vtbl; object->playing_event = CreateEventW(NULL, FALSE, FALSE, NULL); @@ -62,7 +62,7 @@ index 47130d8e436..29a11d034cd 100644 object->refcount = 1; return object; } -@@ -2510,6 +2531,167 @@ static void test_media_extension(void) +@@ -2481,6 +2502,167 @@ static void test_media_extension(void) IMFMediaEngineExtension_Release(&extension->IMFMediaEngineExtension_iface); } @@ -230,7 +230,7 @@ index 47130d8e436..29a11d034cd 100644 START_TEST(mfmediaengine) { HRESULT hr; -@@ -2545,6 +2727,7 @@ START_TEST(mfmediaengine) +@@ -2516,6 +2698,7 @@ START_TEST(mfmediaengine) test_GetDuration(); test_GetSeekable(); test_media_extension(); @@ -239,5 +239,5 @@ index 47130d8e436..29a11d034cd 100644 IMFMediaEngineClassFactory_Release(factory); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch b/patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch index 2f85473f2..00e6bc644 100644 --- a/patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch +++ b/patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch @@ -1,4 +1,4 @@ -From db326d9633962a78802f104d3d1eb10b4df9fd60 Mon Sep 17 00:00:00 2001 +From bd72831d81187c1a476563bd12b0e2c782ead62a Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 14 Jun 2024 03:09:34 +0200 Subject: [PATCH 06/49] mfmediaengine: Implement IMFMediaEngine::IsSeeking. @@ -8,10 +8,10 @@ Subject: [PATCH 06/49] mfmediaengine: Implement IMFMediaEngine::IsSeeking. 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c -index 28a273616c8..a40f8d64f58 100644 +index d6d6b2fd7ab..cd68c122851 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c -@@ -1825,9 +1825,16 @@ static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngineEx *iface) +@@ -1796,9 +1796,16 @@ static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngineEx *iface) static BOOL WINAPI media_engine_IsSeeking(IMFMediaEngineEx *iface) { @@ -31,5 +31,5 @@ index 28a273616c8..a40f8d64f58 100644 static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface) -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0007-AVPro-Video-seeking-support.patch b/patches/wine-gst/0007-AVPro-Video-seeking-support.patch index b21fda62f..a6b0b1ee7 100644 --- a/patches/wine-gst/0007-AVPro-Video-seeking-support.patch +++ b/patches/wine-gst/0007-AVPro-Video-seeking-support.patch @@ -1,4 +1,4 @@ -From e605d5a82a6c95cf929fa22ca4da54e51c614e4c Mon Sep 17 00:00:00 2001 +From eff1d3503cee12c8d58b01d72dc88aa31560de7b Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 10 Apr 2024 18:57:59 +0200 Subject: [PATCH 07/49] === AVPro Video seeking support === @@ -8,15 +8,15 @@ Subject: [PATCH 07/49] === AVPro Video seeking support === 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS -index 59873f6804c..ab42dff2884 100644 +index c4afb5da88c..a414cc846c8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -436,3 +436,5 @@ P: Zebediah Figura +@@ -435,3 +435,5 @@ P: Zebediah Figura P: Paul Gofman P: Erich E. Hoover W: https://wine-staging.com/ + +seek -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0043-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch b/patches/wine-gst/0008-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch similarity index 83% rename from patches/wine-gst/0043-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch rename to patches/wine-gst/0008-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch index b39cfb3b5..5f495fd24 100644 --- a/patches/wine-gst/0043-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch +++ b/patches/wine-gst/0008-quartz-Fix-buffer-overflow-when-passing-url-as-filen.patch @@ -1,9 +1,10 @@ -From 1c93f539054a0ad026f1cf0792e85886c3dcd573 Mon Sep 17 00:00:00 2001 +From 396294ff6ca75afdb67fd875b5c95a479dae9329 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 26 Aug 2024 16:15:16 +0200 -Subject: [PATCH 43/49] quartz: Fix buffer overflow when passing url as +Subject: [PATCH 08/49] quartz: Fix buffer overflow when passing url as filename to FilterGraph2_AddSourceFilter. +CW-Bug-Id: #21644 --- dlls/quartz/filesource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -22,5 +23,5 @@ index 7d6292df579..9d823662427 100644 { size = sizeof(guidstr); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0008-winegstreamer-Initialize-condition-variable-of-struc.patch b/patches/wine-gst/0009-winegstreamer-Initialize-condition-variable-of-struc.patch similarity index 70% rename from patches/wine-gst/0008-winegstreamer-Initialize-condition-variable-of-struc.patch rename to patches/wine-gst/0009-winegstreamer-Initialize-condition-variable-of-struc.patch index 81296b505..79367d13f 100644 --- a/patches/wine-gst/0008-winegstreamer-Initialize-condition-variable-of-struc.patch +++ b/patches/wine-gst/0009-winegstreamer-Initialize-condition-variable-of-struc.patch @@ -1,18 +1,19 @@ -From 322e1f96e0f2ef1c65ab4a3d05a2ecab327dd2cb Mon Sep 17 00:00:00 2001 +From 55d5e5edfcf5218a9f4bac140841871b0463664f Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 14 Jun 2024 03:15:57 +0200 -Subject: [PATCH 08/49] winegstreamer: Initialize condition variable of struct +Subject: [PATCH 09/49] winegstreamer: Initialize condition variable of struct media_stream. +CW-Bug-Id: #21644 --- dlls/winegstreamer/media_source.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index a4ac0085dea..93a4425dd06 100644 +index eb6ab3d21cd..119fde3e04f 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1172,6 +1172,7 @@ static HRESULT media_stream_create(IMFMediaSource *source, IMFStreamDescriptor * +@@ -1043,6 +1043,7 @@ static HRESULT media_stream_create(IMFMediaSource *source, IMFStreamDescriptor * object->active = TRUE; object->eos = FALSE; object->wg_stream = wg_stream; @@ -21,5 +22,5 @@ index a4ac0085dea..93a4425dd06 100644 TRACE("Created stream object %p.\n", object); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch b/patches/wine-gst/0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch similarity index 53% rename from patches/wine-gst/0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch rename to patches/wine-gst/0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch index 7ac1f8cf6..bfb2819a7 100644 --- a/patches/wine-gst/0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch +++ b/patches/wine-gst/0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch @@ -1,22 +1,19 @@ -From 5f965c4a5c870321b55de94b380eddbf13538a79 Mon Sep 17 00:00:00 2001 +From c751866d1efd4346ea0c91476f3b2bb02d6bf90b Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Sun, 31 Mar 2024 15:49:33 +0200 -Subject: [PATCH 09/49] winegstreamer: Connect autoplug-continue and +Subject: [PATCH 10/49] winegstreamer: Connect autoplug-continue and deep-element-added callbacks to uridecodebin-based parsers too. +CW-Bug-Id: #21644 --- - dlls/winegstreamer/wg_parser.c | 2 ++ - 1 file changed, 2 insertions(+) + dlls/winegstreamer/wg_parser.c | 1 + + 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 1cd44a90e6e..e4b2d57bf7c 100644 +index 2b3e19cdab7..8523ef0af1e 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -2102,9 +2102,11 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) - g_object_set(parser->decodebin, "uri", parser->uri, NULL); - g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); - g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); -+ g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); +@@ -2199,6 +2199,7 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_select_cb), parser); g_signal_connect(element, "autoplug-sort", G_CALLBACK(autoplug_sort_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); @@ -25,5 +22,5 @@ index 1cd44a90e6e..e4b2d57bf7c 100644 pthread_mutex_lock(&parser->mutex); parser->no_more_pads = false; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch b/patches/wine-gst/0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch similarity index 79% rename from patches/wine-gst/0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch rename to patches/wine-gst/0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch index 5f2bedec9..385030615 100644 --- a/patches/wine-gst/0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch +++ b/patches/wine-gst/0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch @@ -1,18 +1,19 @@ -From 50959df819d44760e3ec0e2966baad75d8ec8ab0 Mon Sep 17 00:00:00 2001 +From f40f133d6db8f882641a5375fd2ed112c8361df9 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 25 Mar 2024 09:19:18 +0100 -Subject: [PATCH 10/49] winegstreamer: Do not create a read thread for +Subject: [PATCH 11/49] winegstreamer: Do not create a read thread for uridecodebin-based media sources. +CW-Bug-Id: #21644 --- dlls/winegstreamer/media_source.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 93a4425dd06..6709af89444 100644 +index 119fde3e04f..93ddf6c6051 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1625,9 +1625,12 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -1501,9 +1501,12 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) wg_parser_disconnect(source->wg_parser); @@ -28,7 +29,7 @@ index 93a4425dd06..6709af89444 100644 IMFMediaEventQueue_Shutdown(source->event_queue); IMFByteStream_Close(source->byte_stream); -@@ -1722,7 +1725,8 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc +@@ -1598,7 +1601,8 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc } object->wg_parser = parser; @@ -39,5 +40,5 @@ index 93a4425dd06..6709af89444 100644 object->state = SOURCE_OPENING; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch b/patches/wine-gst/0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch similarity index 81% rename from patches/wine-gst/0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch rename to patches/wine-gst/0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch index 098dc4271..0664851bf 100644 --- a/patches/wine-gst/0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch +++ b/patches/wine-gst/0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch @@ -1,20 +1,22 @@ -From 03f5d8ca39af054cb48b9e84a9c6cda18a3bf218 Mon Sep 17 00:00:00 2001 +From 1da7f8bf361a80259285d6347d8f5c56400dd6cd Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 19 Mar 2024 04:06:37 +0100 -Subject: [PATCH 11/49] winegstreamer: Ignore an assert in wg_parser. +Subject: [PATCH 12/49] winegstreamer: Ignore an assert in wg_parser. This gets hit when a wg_parser receives GST_EVENT_FLUSH_START between the wg_parser_stream_get_buffer function return and the wg_parser_stream_release_buffer call. In this case the NULL buffer can be ignored, it does no harm and there is no memory leak from this. + +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index e4b2d57bf7c..7e6d22c8e0c 100644 +index 8523ef0af1e..25d84a430cf 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -423,11 +423,12 @@ static NTSTATUS wg_parser_stream_release_buffer(void *args) +@@ -481,11 +481,12 @@ static NTSTATUS wg_parser_stream_release_buffer(void *args) pthread_mutex_lock(&parser->mutex); @@ -33,5 +35,5 @@ index e4b2d57bf7c..7e6d22c8e0c 100644 pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&stream->event_empty_cond); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0012-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch b/patches/wine-gst/0012-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch deleted file mode 100644 index 2e50d51cf..000000000 --- a/patches/wine-gst/0012-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 5e7cce5e943155c0d65ebd66d706a4d1ddaa213b Mon Sep 17 00:00:00 2001 -From: Torge Matthies -Date: Tue, 20 Feb 2024 23:17:28 +0100 -Subject: [PATCH 12/49] winegstreamer: Make wg_parser report the exact - supported formats to gstreamer instead of just ANY. - ---- - dlls/winegstreamer/wg_parser.c | 42 +++++++++++++++++++++++++++++++++- - 1 file changed, 41 insertions(+), 1 deletion(-) - -diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 7e6d22c8e0c..b8b6f6865ee 100644 ---- a/dlls/winegstreamer/wg_parser.c -+++ b/dlls/winegstreamer/wg_parser.c -@@ -850,6 +850,43 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu - return GST_FLOW_OK; - } - -+static GstCaps *get_supported_formats(void) -+{ -+ GstCaps *caps = gst_caps_new_empty(), *temp; -+ GstAudioInfo ainfo; -+ GstVideoInfo vinfo; -+ gsize i; -+ -+ /* video/x-raw */ -+ gst_video_info_set_format(&vinfo, GST_VIDEO_FORMAT_BGRA, 1, 1); -+ temp = gst_video_info_to_caps(&vinfo); -+ for (i = 0; i < gst_caps_get_size(temp); ++i) -+ gst_structure_remove_fields(gst_caps_get_structure(temp, i), -+ "format", "width", "height", "framerate", "colorimetry", NULL); -+ gst_caps_append(caps, temp); -+ /* other formats */ -+ gst_caps_append(caps, gst_caps_new_empty_simple("video/x-cinepak")); -+ gst_caps_append(caps, gst_caps_new_simple("video/x-h264", "stream-format", G_TYPE_STRING, "byte-stream", -+ "alignment", G_TYPE_STRING, "au", NULL)); -+ gst_caps_append(caps, gst_caps_new_empty_simple("video/x-wmv")); -+ gst_caps_append(caps, gst_caps_new_empty_simple("video/x-indeo")); -+ -+ /* audio/x-raw */ -+ gst_audio_info_set_format(&ainfo, GST_AUDIO_FORMAT_S16LE, 1, 1, NULL); -+ temp = gst_audio_info_to_caps(&ainfo); -+ for (i = 0; i < gst_caps_get_size(temp); ++i) -+ gst_structure_remove_fields(gst_caps_get_structure(temp, i), -+ "format", "channels", "rate", "channel-mask", NULL); -+ gst_caps_append(caps, temp); -+ /* other formats */ -+ gst_caps_append(caps, gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 1, -+ "parsed", G_TYPE_BOOLEAN, TRUE, NULL)); -+ gst_caps_append(caps, gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 4, NULL)); -+ gst_caps_append(caps, gst_caps_new_empty_simple("audio/x-xma")); -+ -+ return caps; -+} -+ - static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) - { - struct wg_parser_stream *stream = gst_pad_get_element_private(pad); -@@ -867,7 +904,10 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) - gst_query_parse_caps(query, &filter); - - pthread_mutex_lock(&parser->mutex); -- caps = wg_format_to_caps(&stream->current_format); -+ if (stream->current_format.major_type != WG_MAJOR_TYPE_UNKNOWN) -+ caps = wg_format_to_caps(&stream->current_format); -+ else -+ caps = get_supported_formats(); - pthread_mutex_unlock(&parser->mutex); - - if (!caps) --- -2.46.0 - diff --git a/patches/wine-gst/0013-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch b/patches/wine-gst/0013-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch index b453fadee..4fadfbba9 100644 --- a/patches/wine-gst/0013-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch +++ b/patches/wine-gst/0013-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch @@ -1,9 +1,10 @@ -From fbec5cefbdaff199dc5bd41b872f236a8fb932c1 Mon Sep 17 00:00:00 2001 +From 9c08eb71ce96786f15e84dceb4d23abbdf68b7bf Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:54 +0100 Subject: [PATCH 13/49] winegstreamer: Add more RTSP-based URI schemes to GStreamer scheme handler. +CW-Bug-Id: #21644 --- dlls/winegstreamer/winegstreamer.rgs | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) @@ -52,5 +53,5 @@ index c50d3a05747..d0c0265f65a 100644 } } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0014-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch b/patches/wine-gst/0014-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch index 20a35d87e..719121f37 100644 --- a/patches/wine-gst/0014-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch +++ b/patches/wine-gst/0014-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch @@ -1,19 +1,21 @@ -From f05f2781fea1027c6c3360a8474e790c47ebf81a Mon Sep 17 00:00:00 2001 +From 9d46c498e7db6fdd6a820d1309ccbda265a4e62a Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 22 Apr 2024 11:43:45 +0200 Subject: [PATCH 14/49] winegstreamer: Mark wg_parser container bin as streams-aware. Mirroring wg_source. + +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index b8b6f6865ee..6ea25885112 100644 +index 25d84a430cf..363eb5db2c0 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1885,6 +1885,7 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1937,6 +1937,7 @@ static NTSTATUS wg_parser_connect(void *args) } parser->container = gst_bin_new(NULL); @@ -22,5 +24,5 @@ index b8b6f6865ee..6ea25885112 100644 if (parser->context) gst_element_set_context(parser->container, parser->context); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0015-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch b/patches/wine-gst/0015-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch index df334ec61..7b2a1a7d4 100644 --- a/patches/wine-gst/0015-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch +++ b/patches/wine-gst/0015-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch @@ -1,19 +1,21 @@ -From ff93a339ea5bf6e072f99cb265e6ad9a1ead72c2 Mon Sep 17 00:00:00 2001 +From 12f6a6fa7a1b08e41d4d7985c9246677c542c6d1 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 Subject: [PATCH 15/49] winegstreamer: Set a clock for the wg_parser pipeline. Some elements under uridecodebin (e.g. the RTSP demuxer) require a valid clock to function properly. GstPipeline does this so let's do this too. + +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 6ea25885112..2dc9ddd1f4b 100644 +index 363eb5db2c0..c9a847038a0 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1897,6 +1897,8 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1949,6 +1949,8 @@ static NTSTATUS wg_parser_connect(void *args) gst_pad_set_event_function(parser->my_src, src_event_cb); gst_pad_set_element_private(parser->my_src, parser); @@ -23,5 +25,5 @@ index 6ea25885112..2dc9ddd1f4b 100644 parser->next_pull_offset = 0; parser->error = false; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0016-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch b/patches/wine-gst/0016-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch index e6da89345..e3a10fe1f 100644 --- a/patches/wine-gst/0016-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch +++ b/patches/wine-gst/0016-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch @@ -1,18 +1,19 @@ -From 1e7d1b192b3fcf946ae4d3569490886dcac1feea Mon Sep 17 00:00:00 2001 +From cb98d8608de3dcda81ea2b1b86bd8350c650b9a5 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 Subject: [PATCH 16/49] winegstreamer: Set base time on wg_parser bin while connecting. +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 2dc9ddd1f4b..9b6c2ba2e9a 100644 +index c9a847038a0..320e624ccb1 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1861,6 +1861,7 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1913,6 +1913,7 @@ static NTSTATUS wg_parser_connect(void *args) const struct wg_parser_connect_params *params = args; struct wg_parser *parser = get_parser(params->parser); const WCHAR *uri = params->uri; @@ -20,7 +21,7 @@ index 2dc9ddd1f4b..9b6c2ba2e9a 100644 unsigned int i; int ret; -@@ -1897,7 +1898,8 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1949,7 +1950,8 @@ static NTSTATUS wg_parser_connect(void *args) gst_pad_set_event_function(parser->my_src, src_event_cb); gst_pad_set_element_private(parser->my_src, parser); @@ -30,7 +31,7 @@ index 2dc9ddd1f4b..9b6c2ba2e9a 100644 parser->start_offset = parser->next_offset = parser->stop_offset = 0; parser->next_pull_offset = 0; -@@ -1906,6 +1908,7 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1958,6 +1960,7 @@ static NTSTATUS wg_parser_connect(void *args) if (!parser->init_gst(parser)) goto out; @@ -39,5 +40,5 @@ index 2dc9ddd1f4b..9b6c2ba2e9a 100644 ret = gst_element_get_state(parser->container, NULL, NULL, -1); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0017-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch b/patches/wine-gst/0017-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch index d8e83ef4d..05a8759f2 100644 --- a/patches/wine-gst/0017-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch +++ b/patches/wine-gst/0017-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch @@ -1,19 +1,21 @@ -From b37d5bbd2ca3aa2a0bd30a22d6f923d3deab6411 Mon Sep 17 00:00:00 2001 +From 4f9a075050d6a6edae4c69af274090b2248ca0b1 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 Subject: [PATCH 17/49] winegstreamer: Put pipeline into PLAYING state before waiting for the no-more-pads callback. Some elements (e.g. uridecodebin with an RTSP URI) won't send no-more-pads in READY/PAUSED state. + +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 9b6c2ba2e9a..a2fa8f494f9 100644 +index 320e624ccb1..47922146d9a 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1909,9 +1909,9 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1961,9 +1961,9 @@ static NTSTATUS wg_parser_connect(void *args) goto out; gst_element_set_base_time(parser->container, gst_clock_get_time(clock)); @@ -26,7 +28,7 @@ index 9b6c2ba2e9a..a2fa8f494f9 100644 if (ret == GST_STATE_CHANGE_FAILURE) { if (!parser->use_mediaconv && parser->init_gst == decodebin_parser_init_gst) -@@ -1926,6 +1926,14 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1978,6 +1978,14 @@ static NTSTATUS wg_parser_connect(void *args) pthread_mutex_lock(&parser->mutex); @@ -42,5 +44,5 @@ index 9b6c2ba2e9a..a2fa8f494f9 100644 pthread_cond_wait(&parser->init_cond, &parser->mutex); if (parser->error) -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0018-winegstreamer-Handle-a-duration-of-1-correctly.patch b/patches/wine-gst/0018-winegstreamer-Handle-a-duration-of-1-correctly.patch index 913fa6e72..ce3790507 100644 --- a/patches/wine-gst/0018-winegstreamer-Handle-a-duration-of-1-correctly.patch +++ b/patches/wine-gst/0018-winegstreamer-Handle-a-duration-of-1-correctly.patch @@ -1,4 +1,4 @@ -From d01a36044e2625b46fb02560705daf6167836192 Mon Sep 17 00:00:00 2001 +From a3303110d4691ceb99d44c9e4e0a3fee848614aa Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Sat, 10 Aug 2024 01:43:37 +0200 Subject: [PATCH 18/49] winegstreamer: Handle a duration of -1 correctly. @@ -7,16 +7,18 @@ Live sources will return a duration of -1 to signify that the duration is unknow By dividing this by 100 this value gets wrongfully changed to 0. Media sources without a known duration should also not set a MF_PD_DURATION attribute on their presentation descriptors. + +CW-Bug-Id: #21644 --- dlls/winegstreamer/media_source.c | 7 +++++-- dlls/winegstreamer/wg_parser.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 6709af89444..d0e9b6fdf71 100644 +index 93ddf6c6051..ce6de32d1c4 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1487,8 +1487,11 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * +@@ -1358,8 +1358,11 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * hr = MF_E_SHUTDOWN; else if (SUCCEEDED(hr = MFCreatePresentationDescriptor(source->stream_count, source->descriptors, descriptor))) { @@ -31,10 +33,10 @@ index 6709af89444..d0e9b6fdf71 100644 for (i = 0; i < source->stream_count; ++i) { diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index a2fa8f494f9..8bf5e1e0bde 100644 +index 47922146d9a..caee2cadfb7 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1986,7 +1986,7 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -2038,7 +2038,7 @@ static NTSTATUS wg_parser_connect(void *args) } if (gst_pad_peer_query_duration(stream->my_sink, GST_FORMAT_TIME, &duration)) { @@ -44,5 +46,5 @@ index a2fa8f494f9..8bf5e1e0bde 100644 } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch b/patches/wine-gst/0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch index 710ab26bc..cc9cc03d5 100644 --- a/patches/wine-gst/0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch +++ b/patches/wine-gst/0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch @@ -1,19 +1,21 @@ -From e468354cc34d5f5ec74b9ea32926839a42da2a69 Mon Sep 17 00:00:00 2001 +From 9ae292993013df74eed2a94ec87eb4c1d2bb1440 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 23 Apr 2024 19:30:17 +0200 Subject: [PATCH 19/49] winegstreamer: Don't only accept segment events when streams are enabled. I don't know why this was done previously but this just creates a race condition, with no to me apparent benefit. + +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 8bf5e1e0bde..a3a71262b68 100644 +index caee2cadfb7..5451523eaf0 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -698,24 +698,20 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -794,24 +794,20 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) switch (event->type) { case GST_EVENT_SEGMENT: @@ -49,5 +51,5 @@ index 8bf5e1e0bde..a3a71262b68 100644 case GST_EVENT_EOS: pthread_mutex_lock(&parser->mutex); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0020-winegstreamer-Convert-buffer-presentation-timestamps.patch b/patches/wine-gst/0020-winegstreamer-Convert-buffer-presentation-timestamps.patch index 18726f2a5..d53479074 100644 --- a/patches/wine-gst/0020-winegstreamer-Convert-buffer-presentation-timestamps.patch +++ b/patches/wine-gst/0020-winegstreamer-Convert-buffer-presentation-timestamps.patch @@ -1,15 +1,16 @@ -From d09d4a21ad532521c8a561227071ae6067ab12b8 Mon Sep 17 00:00:00 2001 +From 1524e48ebff544374216ea134633cc3189468aef Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 Subject: [PATCH 20/49] winegstreamer: Convert buffer presentation timestamps into stream time. +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 56 ++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index a3a71262b68..fd678f111e0 100644 +index 5451523eaf0..34188d8b658 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -86,7 +86,7 @@ struct wg_parser @@ -21,7 +22,7 @@ index a3a71262b68..fd678f111e0 100644 bool err_on, warn_on; pthread_cond_t read_cond, read_done_cond; -@@ -320,6 +320,18 @@ static GstBuffer *wait_parser_stream_buffer(struct wg_parser *parser, struct wg_ +@@ -378,6 +378,18 @@ static GstBuffer *wait_parser_stream_buffer(struct wg_parser *parser, struct wg_ return buffer; } @@ -40,7 +41,7 @@ index a3a71262b68..fd678f111e0 100644 static NTSTATUS wg_parser_stream_get_buffer(void *args) { const struct wg_parser_stream_get_buffer_params *params = args; -@@ -331,6 +343,7 @@ static NTSTATUS wg_parser_stream_get_buffer(void *args) +@@ -389,6 +401,7 @@ static NTSTATUS wg_parser_stream_get_buffer(void *args) pthread_mutex_lock(&parser->mutex); @@ -48,7 +49,7 @@ index a3a71262b68..fd678f111e0 100644 if (stream) buffer = wait_parser_stream_buffer(parser, stream); else -@@ -373,13 +386,24 @@ static NTSTATUS wg_parser_stream_get_buffer(void *args) +@@ -431,13 +444,24 @@ static NTSTATUS wg_parser_stream_get_buffer(void *args) return S_FALSE; } @@ -79,7 +80,7 @@ index a3a71262b68..fd678f111e0 100644 if ((wg_buffer->has_duration = GST_BUFFER_DURATION_IS_VALID(buffer))) wg_buffer->duration = GST_BUFFER_DURATION(buffer) / 100; wg_buffer->discontinuity = GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DISCONT); -@@ -422,16 +446,8 @@ static NTSTATUS wg_parser_stream_release_buffer(void *args) +@@ -480,16 +504,8 @@ static NTSTATUS wg_parser_stream_release_buffer(void *args) struct wg_parser *parser = stream->parser; pthread_mutex_lock(&parser->mutex); @@ -97,7 +98,7 @@ index a3a71262b68..fd678f111e0 100644 return S_OK; } -@@ -490,6 +506,8 @@ static NTSTATUS wg_parser_stream_seek(void *args) +@@ -548,6 +564,8 @@ static NTSTATUS wg_parser_stream_seek(void *args) flags, start_type, params->start_pos * 100, stop_type, params->stop_pos == stream->duration ? -1 : params->stop_pos * 100))) GST_ERROR("Failed to seek."); @@ -106,7 +107,7 @@ index a3a71262b68..fd678f111e0 100644 return S_OK; } -@@ -700,6 +718,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -796,6 +814,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) case GST_EVENT_SEGMENT: { const GstSegment *segment; @@ -114,7 +115,7 @@ index a3a71262b68..fd678f111e0 100644 gst_event_parse_segment(event, &segment); if (segment->format != GST_FORMAT_TIME) -@@ -708,7 +727,12 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -804,7 +823,12 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) break; } pthread_mutex_lock(&parser->mutex); @@ -128,5 +129,5 @@ index a3a71262b68..fd678f111e0 100644 break; } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch b/patches/wine-gst/0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch index 2ed793a56..ae5665bd2 100644 --- a/patches/wine-gst/0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch +++ b/patches/wine-gst/0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch @@ -1,18 +1,19 @@ -From a6e00f61b2dd22d948fc77f2d2b893cfe5bd4416 Mon Sep 17 00:00:00 2001 +From d094f8e4fab75229510736b73f127401d43579fa Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 Subject: [PATCH 21/49] winegstreamer: Reorder parser initialization code a bit to prevent race conditions. +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index fd678f111e0..6f656db98c1 100644 +index 34188d8b658..3aeafae2175 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -2145,7 +2145,10 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) +@@ -2197,7 +2197,10 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; @@ -24,7 +25,7 @@ index fd678f111e0..6f656db98c1 100644 g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); -@@ -2153,10 +2156,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) +@@ -2205,10 +2208,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) g_signal_connect(element, "autoplug-sort", G_CALLBACK(autoplug_sort_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); g_signal_connect(element, "deep-element-added", G_CALLBACK(deep_element_added_cb), parser); @@ -36,7 +37,7 @@ index fd678f111e0..6f656db98c1 100644 if (!link_src_to_element(parser->my_src, element)) return FALSE; -@@ -2174,7 +2174,10 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) +@@ -2227,7 +2227,10 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; @@ -48,7 +49,7 @@ index fd678f111e0..6f656db98c1 100644 g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); -@@ -2182,10 +2185,7 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) +@@ -2235,10 +2238,7 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) g_signal_connect(element, "autoplug-sort", G_CALLBACK(autoplug_sort_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); g_signal_connect(element, "deep-element-added", G_CALLBACK(deep_element_added_cb), parser); @@ -60,7 +61,7 @@ index fd678f111e0..6f656db98c1 100644 return TRUE; } -@@ -2199,14 +2199,14 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser) +@@ -2252,14 +2252,14 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser) gst_bin_add(GST_BIN(parser->container), element); @@ -80,5 +81,5 @@ index fd678f111e0..6f656db98c1 100644 return FALSE; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch b/patches/wine-gst/0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch index 7ff3376a6..6f9cb9fe1 100644 --- a/patches/wine-gst/0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch +++ b/patches/wine-gst/0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch @@ -1,15 +1,16 @@ -From 8ce5fc567d6366479f03c6aa2632c61ecdacd162 Mon Sep 17 00:00:00 2001 +From 490744bd1ac88608d53e562ce953a9c8199879d9 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:54 +0100 Subject: [PATCH 22/49] winegstreamer: Do away with the per-stream condvars and use one parser-wide condvar instead. +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 6f656db98c1..293671a9c08 100644 +index 3aeafae2175..11bac45a9f9 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -90,6 +90,7 @@ struct wg_parser @@ -20,17 +21,17 @@ index 6f656db98c1..293671a9c08 100644 struct { GstBuffer *buffer; -@@ -122,7 +123,6 @@ struct wg_parser_stream - GstSegment segment; - struct wg_format preferred_format, current_format, codec_format; +@@ -124,7 +125,6 @@ struct wg_parser_stream + GstCaps *current_caps; + GstCaps *desired_caps; - pthread_cond_t event_cond, event_empty_cond; GstBuffer *buffer; GstMapInfo map_info; -@@ -302,8 +302,7 @@ static NTSTATUS wg_parser_stream_disable(void *args) - stream->enabled = false; - stream->current_format.major_type = WG_MAJOR_TYPE_UNKNOWN; +@@ -360,8 +360,7 @@ static NTSTATUS wg_parser_stream_disable(void *args) + stream->desired_caps = NULL; + } pthread_mutex_unlock(&parser->mutex); - pthread_cond_signal(&stream->event_cond); - pthread_cond_signal(&stream->event_empty_cond); @@ -38,7 +39,7 @@ index 6f656db98c1..293671a9c08 100644 return S_OK; } -@@ -315,7 +314,7 @@ static GstBuffer *wait_parser_stream_buffer(struct wg_parser *parser, struct wg_ +@@ -373,7 +372,7 @@ static GstBuffer *wait_parser_stream_buffer(struct wg_parser *parser, struct wg_ * must return the buffer. */ while (stream->enabled && !(buffer = stream->buffer) && !stream->eos) @@ -47,7 +48,7 @@ index 6f656db98c1..293671a9c08 100644 return buffer; } -@@ -329,7 +328,7 @@ static void release_buffer(struct wg_parser *parser, struct wg_parser_stream *st +@@ -387,7 +386,7 @@ static void release_buffer(struct wg_parser *parser, struct wg_parser_stream *st stream->buffer = NULL; } @@ -56,7 +57,7 @@ index 6f656db98c1..293671a9c08 100644 } static NTSTATUS wg_parser_stream_get_buffer(void *args) -@@ -741,7 +740,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -837,7 +836,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) pthread_mutex_lock(&parser->mutex); stream->eos = true; if (stream->enabled) @@ -65,7 +66,7 @@ index 6f656db98c1..293671a9c08 100644 else pthread_cond_signal(&parser->init_cond); pthread_mutex_unlock(&parser->mutex); -@@ -753,7 +752,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -849,7 +848,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) if (stream->enabled) { stream->flushing = true; @@ -74,7 +75,7 @@ index 6f656db98c1..293671a9c08 100644 if (stream->buffer) { -@@ -831,7 +830,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -926,7 +925,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu * implementing a queue object here. */ while (stream->enabled && !stream->flushing && stream->buffer) @@ -83,7 +84,7 @@ index 6f656db98c1..293671a9c08 100644 if (!stream->enabled) { -@@ -860,7 +859,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -955,7 +954,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu stream->buffer = buffer; pthread_mutex_unlock(&parser->mutex); @@ -92,16 +93,16 @@ index 6f656db98c1..293671a9c08 100644 /* The chain callback is given a reference to the buffer. Transfer that * reference to the stream object, which will release it in -@@ -1004,8 +1003,6 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser, char *id +@@ -1060,8 +1059,6 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser, char *id + stream->parser = parser; stream->number = parser->stream_count; stream->no_more_pads = true; - stream->current_format.major_type = WG_MAJOR_TYPE_UNKNOWN; - pthread_cond_init(&stream->event_cond, NULL); - pthread_cond_init(&stream->event_empty_cond, NULL); sprintf(pad_name, "qz_sink_%u", parser->stream_count); stream->my_sink = gst_pad_new(pad_name, GST_PAD_SINK); -@@ -1037,9 +1034,6 @@ static void free_stream(struct wg_parser_stream *stream) +@@ -1093,9 +1090,6 @@ static void free_stream(struct wg_parser_stream *stream) stream->buffer = NULL; } @@ -111,7 +112,7 @@ index 6f656db98c1..293671a9c08 100644 for (i = 0; i < ARRAY_SIZE(stream->tags); ++i) { if (stream->tags[i]) -@@ -2096,10 +2090,8 @@ static NTSTATUS wg_parser_disconnect(void *args) +@@ -2148,10 +2142,8 @@ static NTSTATUS wg_parser_disconnect(void *args) /* Unblock all of our streams. */ pthread_mutex_lock(&parser->mutex); for (i = 0; i < parser->stream_count; ++i) @@ -123,7 +124,7 @@ index 6f656db98c1..293671a9c08 100644 pthread_mutex_unlock(&parser->mutex); gst_element_set_state(parser->container, GST_STATE_NULL); -@@ -2275,6 +2267,7 @@ static NTSTATUS wg_parser_create(void *args) +@@ -2328,6 +2320,7 @@ static NTSTATUS wg_parser_create(void *args) pthread_cond_init(&parser->init_cond, NULL); pthread_cond_init(&parser->read_cond, NULL); pthread_cond_init(&parser->read_done_cond, NULL); @@ -132,5 +133,5 @@ index 6f656db98c1..293671a9c08 100644 parser->output_compressed = params->output_compressed; parser->err_on = params->err_on; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch b/patches/wine-gst/0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch index 11521f02d..0bb602ee2 100644 --- a/patches/wine-gst/0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch +++ b/patches/wine-gst/0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch @@ -1,27 +1,28 @@ -From 31c788f0093a57a8e8195eb4bd4047afe527397f Mon Sep 17 00:00:00 2001 +From 3cbe876714831c1b43dae8f76ecde771cbfe499f Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 18 Mar 2024 10:18:07 +0100 Subject: [PATCH 23/49] winegstreamer: Use pthread_cond_broadcast instead of pthread_cond_signal for stream_event_cond. +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 293671a9c08..56acd04d39c 100644 +index 11bac45a9f9..fd9ecaadb7c 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -302,7 +302,7 @@ static NTSTATUS wg_parser_stream_disable(void *args) - stream->enabled = false; - stream->current_format.major_type = WG_MAJOR_TYPE_UNKNOWN; +@@ -360,7 +360,7 @@ static NTSTATUS wg_parser_stream_disable(void *args) + stream->desired_caps = NULL; + } pthread_mutex_unlock(&parser->mutex); - pthread_cond_signal(&parser->stream_event_cond); + pthread_cond_broadcast(&parser->stream_event_cond); return S_OK; } -@@ -328,7 +328,7 @@ static void release_buffer(struct wg_parser *parser, struct wg_parser_stream *st +@@ -386,7 +386,7 @@ static void release_buffer(struct wg_parser *parser, struct wg_parser_stream *st stream->buffer = NULL; } @@ -30,7 +31,7 @@ index 293671a9c08..56acd04d39c 100644 } static NTSTATUS wg_parser_stream_get_buffer(void *args) -@@ -740,7 +740,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -836,7 +836,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) pthread_mutex_lock(&parser->mutex); stream->eos = true; if (stream->enabled) @@ -39,7 +40,7 @@ index 293671a9c08..56acd04d39c 100644 else pthread_cond_signal(&parser->init_cond); pthread_mutex_unlock(&parser->mutex); -@@ -752,7 +752,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -848,7 +848,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) if (stream->enabled) { stream->flushing = true; @@ -48,7 +49,7 @@ index 293671a9c08..56acd04d39c 100644 if (stream->buffer) { -@@ -859,7 +859,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -954,7 +954,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu stream->buffer = buffer; pthread_mutex_unlock(&parser->mutex); @@ -57,7 +58,7 @@ index 293671a9c08..56acd04d39c 100644 /* The chain callback is given a reference to the buffer. Transfer that * reference to the stream object, which will release it in -@@ -2091,7 +2091,7 @@ static NTSTATUS wg_parser_disconnect(void *args) +@@ -2143,7 +2143,7 @@ static NTSTATUS wg_parser_disconnect(void *args) pthread_mutex_lock(&parser->mutex); for (i = 0; i < parser->stream_count; ++i) parser->streams[i]->flushing = true; @@ -67,5 +68,5 @@ index 293671a9c08..56acd04d39c 100644 gst_element_set_state(parser->container, GST_STATE_NULL); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch b/patches/wine-gst/0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch index 06c3a3cf0..40f5b5d9b 100644 --- a/patches/wine-gst/0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch +++ b/patches/wine-gst/0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch @@ -1,4 +1,4 @@ -From 689c09959e19f7e9359a8930ac8b4ddd878efc46 Mon Sep 17 00:00:00 2001 +From 0cfd76a33d22752c8882d6e69ed33e6f87ac3af1 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 19 Mar 2024 10:09:59 +0100 Subject: [PATCH 24/49] winegstreamer: Do not fail caps negotiation when @@ -14,31 +14,30 @@ correct caps have been negotiated (signalled by a GST_EVENT_CAPS). Also try to omit the reconfigure event in some cases. --- - dlls/winegstreamer/wg_parser.c | 72 +++++++++++++++++++++++++++++++--- - 1 file changed, 66 insertions(+), 6 deletions(-) + dlls/winegstreamer/wg_parser.c | 107 ++++++++++++++++++++++++++++++--- + 1 file changed, 99 insertions(+), 8 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 56acd04d39c..d6e42c3d815 100644 +index fd9ecaadb7c..0e3d456c0b1 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -121,7 +121,7 @@ struct wg_parser_stream - GstPad *my_sink; - GstElement *flip, *decodebin; - GstSegment segment; -- struct wg_format preferred_format, current_format, codec_format; -+ struct wg_format preferred_format, current_format, next_format, codec_format; +@@ -124,6 +124,7 @@ struct wg_parser_stream + GstCaps *codec_caps; + GstCaps *current_caps; + GstCaps *desired_caps; ++ GstCaps *next_desired_caps; GstBuffer *buffer; GstMapInfo map_info; -@@ -268,16 +268,41 @@ static NTSTATUS wg_parser_stream_get_codec_format(void *args) +@@ -298,16 +299,53 @@ static NTSTATUS wg_parser_stream_get_codec_format(void *args) return S_OK; } -+static BOOL stream_set_next_caps(struct wg_parser_stream *stream, const struct wg_format *format) ++static BOOL stream_set_next_caps(struct wg_parser_stream *stream, GstCaps *caps) +{ + struct wg_parser *parser = stream->parser; + -+ while (stream->next_format.major_type != WG_MAJOR_TYPE_UNKNOWN && !parser->error) ++ while (stream->next_desired_caps && !parser->error) + pthread_cond_wait(&parser->stream_event_cond, &parser->mutex); + + if (parser->error) @@ -47,14 +46,26 @@ index 56acd04d39c..d6e42c3d815 100644 + return E_FAIL; + } + -+ if (!wg_format_compare(&stream->current_format, format) -+ && !(stream->has_caps && wg_format_compare(&stream->preferred_format, format))) ++ if (!(stream->current_caps && gst_caps_is_equal(stream->current_caps, caps))) + { -+ stream->next_format = *format; -+ return stream->has_caps; ++ if (stream->desired_caps) ++ { ++ if (!gst_caps_is_equal(stream->desired_caps, caps)) ++ { ++ stream->next_desired_caps = caps; ++ return !!stream->current_caps; ++ } ++ } ++ else ++ stream->desired_caps = caps; ++ return TRUE; ++ } ++ else if (!(stream->desired_caps && gst_caps_is_equal(stream->desired_caps, caps))) ++ { ++ stream->desired_caps = caps; ++ return FALSE; + } -+ else -+ stream->current_format = *format; ++ gst_caps_unref(caps); + return FALSE; +} + @@ -64,19 +75,19 @@ index 56acd04d39c..d6e42c3d815 100644 struct wg_parser_stream *stream = get_stream(params->stream); const struct wg_format *format = params->format; struct wg_parser *parser = stream->parser; -+ BOOL need_reconf = FALSE; ++ BOOL need_reconf; pthread_mutex_lock(&parser->mutex); -- stream->current_format = *format; -+ need_reconf = stream_set_next_caps(stream, format); +- stream->desired_caps = wg_format_to_caps(format); ++ need_reconf = stream_set_next_caps(stream, wg_format_to_caps(format)); stream->enabled = true; pthread_mutex_unlock(&parser->mutex); -@@ -285,11 +310,18 @@ static NTSTATUS wg_parser_stream_enable(void *args) +@@ -315,11 +353,18 @@ static NTSTATUS wg_parser_stream_enable(void *args) if (format->major_type == WG_MAJOR_TYPE_VIDEO) { - bool flip = (params->flags & STREAM_ENABLE_FLAG_FLIP_RGB) && (format->u.video.height < 0); + bool flip = (format->u.video.height < 0); + GstVideoOrientationMethod old_method = -1, new_method = flip ? GST_VIDEO_ORIENTATION_VERT : GST_VIDEO_ORIENTATION_IDENTITY; - gst_util_set_object_arg(G_OBJECT(stream->flip), "method", flip ? "vertical-flip" : "none"); @@ -94,37 +105,74 @@ index 56acd04d39c..d6e42c3d815 100644 return S_OK; } -@@ -301,6 +333,7 @@ static NTSTATUS wg_parser_stream_disable(void *args) +@@ -328,10 +373,11 @@ static NTSTATUS wg_parser_stream_enable_type(void *args) + const struct wg_parser_stream_enable_type_params *params = args; + struct wg_parser_stream *stream = get_stream(params->stream); + struct wg_parser *parser = stream->parser; ++ BOOL need_reconf; + pthread_mutex_lock(&parser->mutex); - stream->enabled = false; - stream->current_format.major_type = WG_MAJOR_TYPE_UNKNOWN; -+ stream->next_format.major_type = WG_MAJOR_TYPE_UNKNOWN; + +- stream->desired_caps = caps_from_media_type(¶ms->media_type); ++ need_reconf = stream_set_next_caps(stream, caps_from_media_type(¶ms->media_type)); + stream->enabled = true; + + pthread_mutex_unlock(&parser->mutex); +@@ -339,11 +385,18 @@ static NTSTATUS wg_parser_stream_enable_type(void *args) + if (IsEqualGUID(¶ms->media_type.major, &MEDIATYPE_Video) && stream->flip) + { + bool flip = !!(params->media_type.u.video->videoInfo.VideoFlags & MFVideoFlag_BottomUpLinearRep); ++ GstVideoOrientationMethod old_method = -1, new_method = flip ? GST_VIDEO_ORIENTATION_VERT : GST_VIDEO_ORIENTATION_IDENTITY; + +- gst_util_set_object_arg(G_OBJECT(stream->flip), "method", flip ? "vertical-flip" : "none"); ++ g_object_get(G_OBJECT(stream->flip), "method", &old_method, NULL); ++ if (new_method != old_method) ++ { ++ g_object_set(G_OBJECT(stream->flip), "method", new_method, NULL); ++ need_reconf = TRUE; ++ } + } + +- push_event(stream->my_sink, gst_event_new_reconfigure()); ++ if (need_reconf) ++ push_event(stream->my_sink, gst_event_new_reconfigure()); + return S_OK; + } + +@@ -359,6 +412,11 @@ static NTSTATUS wg_parser_stream_disable(void *args) + gst_caps_unref(stream->desired_caps); + stream->desired_caps = NULL; + } ++ if (stream->next_desired_caps) ++ { ++ gst_caps_unref(stream->next_desired_caps); ++ stream->next_desired_caps = NULL; ++ } pthread_mutex_unlock(&parser->mutex); pthread_cond_broadcast(&parser->stream_event_cond); return S_OK; -@@ -792,6 +825,17 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -887,6 +945,16 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) + gst_event_parse_caps(event, &caps); pthread_mutex_lock(&parser->mutex); - wg_format_from_caps(&stream->preferred_format, caps); - stream->has_caps = true; -+ if (stream->next_format.major_type != WG_MAJOR_TYPE_UNKNOWN) + stream->current_caps = gst_caps_ref(caps); ++ if (stream->next_desired_caps) + { -+ if (!wg_format_compare(&stream->preferred_format, &stream->next_format)) ++ if (!gst_caps_can_intersect(stream->current_caps, stream->next_desired_caps)) + push_event(stream->my_sink, gst_event_new_reconfigure()); + else + { -+ stream->current_format = stream->next_format; -+ stream->next_format.major_type = WG_MAJOR_TYPE_UNKNOWN; ++ stream->next_desired_caps = NULL; + pthread_cond_broadcast(&parser->stream_event_cond); + } + } pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->init_cond); break; -@@ -820,6 +864,14 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -915,6 +983,14 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu pthread_mutex_lock(&parser->mutex); -+ if (stream->next_format.major_type != WG_MAJOR_TYPE_UNKNOWN) ++ if (stream->next_desired_caps) + { + GST_DEBUG("Stream is changing format; discarding buffer."); + pthread_mutex_unlock(&parser->mutex); @@ -135,45 +183,45 @@ index 56acd04d39c..d6e42c3d815 100644 if (!stream->has_buffer) { stream->has_buffer = true; -@@ -923,7 +975,9 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -981,7 +1057,15 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) gst_query_parse_caps(query, &filter); pthread_mutex_lock(&parser->mutex); -- if (stream->current_format.major_type != WG_MAJOR_TYPE_UNKNOWN) -+ if (stream->next_format.major_type != WG_MAJOR_TYPE_UNKNOWN) -+ caps = wg_format_to_caps(&stream->next_format); -+ else if (stream->current_format.major_type != WG_MAJOR_TYPE_UNKNOWN) - caps = wg_format_to_caps(&stream->current_format); - else - caps = get_supported_formats(); -@@ -959,7 +1013,8 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +- if (!stream->desired_caps || !(caps = gst_caps_copy(stream->desired_caps))) ++ if (stream->next_desired_caps) ++ { ++ if (!(caps = gst_caps_copy(stream->next_desired_caps))) ++ { ++ pthread_mutex_unlock(&parser->mutex); ++ return FALSE; ++ } ++ } ++ else if (!stream->desired_caps || !(caps = gst_caps_copy(stream->desired_caps))) + { + pthread_mutex_unlock(&parser->mutex); + return FALSE; +@@ -1015,7 +1099,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) pthread_mutex_lock(&parser->mutex); -- if (stream->current_format.major_type == WG_MAJOR_TYPE_UNKNOWN) -+ if (stream->current_format.major_type == WG_MAJOR_TYPE_UNKNOWN || -+ stream->next_format.major_type != WG_MAJOR_TYPE_UNKNOWN) +- if (!stream->desired_caps) ++ if (!stream->desired_caps || !stream->next_desired_caps) { pthread_mutex_unlock(&parser->mutex); gst_query_set_accept_caps_result(query, TRUE); -@@ -969,6 +1024,8 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) - gst_query_parse_accept_caps(query, &caps); +@@ -1026,6 +1110,11 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) wg_format_from_caps(&format, caps); - ret = wg_format_compare(&format, &stream->current_format); + wg_format_from_caps(¤t_format, stream->desired_caps); + ret = wg_format_compare(&format, ¤t_format); + if (!ret) -+ ret = wg_format_compare(&format, &stream->next_format); ++ { ++ wg_format_from_caps(¤t_format, stream->next_desired_caps); ++ ret = wg_format_compare(&format, ¤t_format); ++ } pthread_mutex_unlock(&parser->mutex); -@@ -1003,6 +1060,7 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser, char *id - stream->number = parser->stream_count; - stream->no_more_pads = true; - stream->current_format.major_type = WG_MAJOR_TYPE_UNKNOWN; -+ stream->next_format.major_type = WG_MAJOR_TYPE_UNKNOWN; - - sprintf(pad_name, "qz_sink_%u", parser->stream_count); - stream->my_sink = gst_pad_new(pad_name, GST_PAD_SINK); -@@ -1660,6 +1718,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use +@@ -1712,6 +1801,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use parser->error = true; pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->init_cond); @@ -181,7 +229,7 @@ index 56acd04d39c..d6e42c3d815 100644 break; case GST_MESSAGE_WARNING: -@@ -1690,6 +1749,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use +@@ -1742,6 +1832,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use GST_WARNING("Autoplugged element failed to initialise, trying again with protonvideoconvert."); parser->error = true; pthread_cond_signal(&parser->init_cond); @@ -190,5 +238,5 @@ index 56acd04d39c..d6e42c3d815 100644 pthread_mutex_unlock(&parser->mutex); } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch b/patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch index 5fc8bf5e7..d949e71ec 100644 --- a/patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch +++ b/patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch @@ -1,8 +1,10 @@ -From 0874bb1607a73e9b5e08a61e61b445165b2a65c5 Mon Sep 17 00:00:00 2001 +From 274af9b358f011d5b1e7992b2a7209685beabfc6 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Sun, 14 Apr 2024 06:12:55 +0200 Subject: [PATCH 25/49] winegstreamer: Do not seek live sources. +Implementing MFMEDIASOURCE_CAN_SEEK makes the higher level components also ignore the seek. + souphttpsrc seems to break from seeking sometimes: winegstreamer error: source: Server does not support seeking. @@ -10,6 +12,8 @@ souphttpsrc seems to break from seeking sometimes: Server does not accept Range HTTP header, URL: https://stream.vrcdn.live/live/djzombiepunk.live.ts, Redirect to: (NULL) Seeking a live source doesn't make sense anyway. + +CW-Bug-Id: #21644 --- dlls/winegstreamer/gst_private.h | 2 ++ dlls/winegstreamer/main.c | 13 ++++++++ @@ -19,7 +23,7 @@ Seeking a live source doesn't make sense anyway. 5 files changed, 80 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index 88804c08a4c..fe3386c7def 100644 +index adefeaba15c..383c479c083 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -82,6 +82,8 @@ void wg_parser_push_data(wg_parser_t parser, const void *data, uint32_t size); @@ -28,14 +32,14 @@ index 88804c08a4c..fe3386c7def 100644 +BOOL wg_parser_is_seekable(wg_parser_t parser); + - void wg_parser_stream_get_preferred_format(wg_parser_stream_t stream, struct wg_format *format); + void wg_parser_stream_get_current_format(wg_parser_stream_t stream, struct wg_format *format); + HRESULT wg_parser_stream_get_current_type_mf(wg_parser_stream_t stream, IMFMediaType **media_type); void wg_parser_stream_get_codec_format(wg_parser_stream_t stream, struct wg_format *format); - void wg_parser_stream_enable(wg_parser_stream_t stream, const struct wg_format *format, diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c -index f7733fcbcfb..3f1654542cf 100644 +index 374924a3e6a..5e57e9d0b7f 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c -@@ -176,6 +176,19 @@ wg_parser_stream_t wg_parser_get_stream(wg_parser_t parser, uint32_t index) +@@ -273,6 +273,19 @@ wg_parser_stream_t wg_parser_get_stream(wg_parser_t parser, uint32_t index) return params.stream; } @@ -52,14 +56,14 @@ index f7733fcbcfb..3f1654542cf 100644 + return params.seekable; +} + - void wg_parser_stream_get_preferred_format(wg_parser_stream_t stream, struct wg_format *format) + static HRESULT wg_get_media_type_mf(enum unix_funcs unix_func, void *params, + struct wg_media_type *wg_media_type, IMFMediaType **media_type) { - struct wg_parser_stream_get_preferred_format_params params = diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index d0e9b6fdf71..6f9392d214a 100644 +index ce6de32d1c4..6e65c468a69 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1465,7 +1465,11 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO +@@ -1336,7 +1336,11 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO if (source->state == SOURCE_SHUTDOWN) hr = MF_E_SHUTDOWN; else @@ -73,10 +77,10 @@ index d0e9b6fdf71..6f9392d214a 100644 LeaveCriticalSection(&source->cs); diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h -index 7fe6bc284d4..0dbcbff7f33 100644 +index f9b87e51b93..88448714bff 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h -@@ -244,6 +244,12 @@ struct wg_parser_get_stream_params +@@ -270,6 +270,12 @@ struct wg_parser_get_stream_params wg_parser_stream_t stream; }; @@ -86,20 +90,20 @@ index 7fe6bc284d4..0dbcbff7f33 100644 + BOOL seekable; +}; + - struct wg_parser_stream_get_preferred_format_params + struct wg_parser_stream_get_current_type_params { wg_parser_stream_t stream; -@@ -486,6 +492,8 @@ enum unix_funcs +@@ -527,6 +533,8 @@ enum unix_funcs unix_wg_parser_get_stream_count, unix_wg_parser_get_stream, + unix_wg_parser_is_seekable, + - unix_wg_parser_stream_get_preferred_format, + unix_wg_parser_stream_get_current_type, + unix_wg_parser_stream_get_current_format, unix_wg_parser_stream_get_codec_format, - unix_wg_parser_stream_enable, diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index d6e42c3d815..2259ce08754 100644 +index 0e3d456c0b1..926523fb45c 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -110,6 +110,8 @@ struct wg_parser @@ -111,7 +115,7 @@ index d6e42c3d815..2259ce08754 100644 }; static const unsigned int input_cache_chunk_size = 512 << 10; -@@ -169,6 +171,15 @@ static NTSTATUS wg_parser_get_stream(void *args) +@@ -176,6 +178,15 @@ static NTSTATUS wg_parser_get_stream(void *args) return S_OK; } @@ -127,7 +131,7 @@ index d6e42c3d815..2259ce08754 100644 static NTSTATUS wg_parser_get_next_read_offset(void *args) { struct wg_parser_get_next_read_offset_params *params = args; -@@ -522,6 +533,9 @@ static NTSTATUS wg_parser_stream_seek(void *args) +@@ -605,6 +616,9 @@ static NTSTATUS wg_parser_stream_seek(void *args) stream = get_stream(params->stream); @@ -137,7 +141,7 @@ index d6e42c3d815..2259ce08754 100644 if (start_flags & AM_SEEKING_SeekToKeyFrame) flags |= GST_SEEK_FLAG_KEY_UNIT; if (start_flags & AM_SEEKING_Segment) -@@ -1978,6 +1992,7 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -2061,6 +2075,7 @@ static NTSTATUS wg_parser_connect(void *args) parser->start_offset = parser->next_offset = parser->stop_offset = 0; parser->next_pull_offset = 0; parser->error = false; @@ -145,7 +149,7 @@ index d6e42c3d815..2259ce08754 100644 if (!parser->init_gst(parser)) goto out; -@@ -1997,6 +2012,11 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -2080,6 +2095,11 @@ static NTSTATUS wg_parser_connect(void *args) GST_ERROR("Failed to play stream."); goto out; } @@ -157,7 +161,7 @@ index d6e42c3d815..2259ce08754 100644 pthread_mutex_lock(&parser->mutex); -@@ -2018,6 +2038,23 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -2101,6 +2121,23 @@ static NTSTATUS wg_parser_connect(void *args) goto out; } @@ -181,7 +185,7 @@ index d6e42c3d815..2259ce08754 100644 for (i = 0; i < parser->stream_count; ++i) { struct wg_parser_stream *stream = parser->streams[i]; -@@ -2060,7 +2097,17 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -2143,7 +2180,17 @@ static NTSTATUS wg_parser_connect(void *args) } if (gst_pad_peer_query_duration(stream->my_sink, GST_FORMAT_TIME, &duration)) { @@ -200,24 +204,24 @@ index d6e42c3d815..2259ce08754 100644 break; } -@@ -2378,6 +2425,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] = +@@ -2462,6 +2509,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] = X(wg_parser_get_stream_count), X(wg_parser_get_stream), + X(wg_parser_is_seekable), + - X(wg_parser_stream_get_preferred_format), + X(wg_parser_stream_get_current_format), + X(wg_parser_stream_get_current_type), X(wg_parser_stream_get_codec_format), - X(wg_parser_stream_enable), -@@ -2823,6 +2872,8 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +@@ -3028,6 +3077,8 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = X(wg_parser_get_stream_count), X(wg_parser_get_stream), + X(wg_parser_is_seekable), + - X64(wg_parser_stream_get_preferred_format), + X64(wg_parser_stream_get_current_format), + X64(wg_parser_stream_get_current_type), X64(wg_parser_stream_get_codec_format), - X64(wg_parser_stream_enable), -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0026-winegstreamer-Implement-buffering-events.patch b/patches/wine-gst/0026-winegstreamer-Implement-buffering-events.patch index 43f8ef48b..3ffff4a02 100644 --- a/patches/wine-gst/0026-winegstreamer-Implement-buffering-events.patch +++ b/patches/wine-gst/0026-winegstreamer-Implement-buffering-events.patch @@ -1,8 +1,9 @@ -From fc18f16912a564e10c57880d0df117f9a436cbb2 Mon Sep 17 00:00:00 2001 +From ceec982c7a5cd1232075df00da06cce3ad13b6a4 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 10 Apr 2024 15:11:02 +0200 Subject: [PATCH 26/49] winegstreamer: Implement buffering events. +CW-Bug-Id: #21644 --- dlls/winegstreamer/gst_private.h | 3 ++ dlls/winegstreamer/main.c | 21 ++++++++++ @@ -12,7 +13,7 @@ Subject: [PATCH 26/49] winegstreamer: Implement buffering events. 5 files changed, 158 insertions(+) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index fe3386c7def..764ea3d2f03 100644 +index 383c479c083..91f885ebc91 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -79,6 +79,9 @@ void wg_parser_disconnect(wg_parser_t parser); @@ -26,10 +27,10 @@ index fe3386c7def..764ea3d2f03 100644 wg_parser_stream_t wg_parser_get_stream(wg_parser_t parser, uint32_t index); diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c -index 3f1654542cf..da11e3bc821 100644 +index 5e57e9d0b7f..8cf1ed77304 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c -@@ -133,6 +133,27 @@ bool wg_parser_get_next_read_offset(wg_parser_t parser, uint64_t *offset, uint32 +@@ -230,6 +230,27 @@ bool wg_parser_get_next_read_offset(wg_parser_t parser, uint64_t *offset, uint32 return true; } @@ -58,7 +59,7 @@ index 3f1654542cf..da11e3bc821 100644 { struct wg_parser_push_data_params params = diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 6f9392d214a..b9054f48ccf 100644 +index 6e65c468a69..d6051a7e4db 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -207,6 +207,9 @@ struct media_source @@ -71,7 +72,7 @@ index 6f9392d214a..b9054f48ccf 100644 }; static inline struct media_stream *impl_from_IMFMediaStream(IMFMediaStream *iface) -@@ -825,6 +828,7 @@ static HRESULT wait_on_sample(struct media_stream *stream, IUnknown *token) +@@ -696,6 +699,7 @@ static HRESULT wait_on_sample(struct media_stream *stream, IUnknown *token) stream->busy = TRUE; LeaveCriticalSection(&source->cs); @@ -79,7 +80,7 @@ index 6f9392d214a..b9054f48ccf 100644 ret = wg_parser_stream_get_buffer(source->wg_parser, stream->wg_stream, &buffer); EnterCriticalSection(&source->cs); stream->busy = FALSE; -@@ -961,6 +965,41 @@ static DWORD CALLBACK read_thread(void *arg) +@@ -832,6 +836,41 @@ static DWORD CALLBACK read_thread(void *arg) return 0; } @@ -121,7 +122,7 @@ index 6f9392d214a..b9054f48ccf 100644 static HRESULT WINAPI media_stream_QueryInterface(IMFMediaStream *iface, REFIID riid, void **out) { struct media_stream *stream = impl_from_IMFMediaStream(iface); -@@ -1632,6 +1671,13 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -1508,6 +1547,13 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) wg_parser_disconnect(source->wg_parser); @@ -135,7 +136,7 @@ index 6f9392d214a..b9054f48ccf 100644 if (source->read_thread) { source->read_thread_shutdown = true; -@@ -1735,6 +1781,8 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc +@@ -1611,6 +1657,8 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc if (context->type != WG_PARSER_URIDECODEBIN) object->read_thread = CreateThread(NULL, 0, read_thread, object, 0, NULL); @@ -144,7 +145,7 @@ index 6f9392d214a..b9054f48ccf 100644 object->state = SOURCE_OPENING; if (FAILED(hr = wg_parser_connect(parser, object->file_size, context->url))) -@@ -1819,6 +1867,12 @@ fail: +@@ -1693,6 +1741,12 @@ fail: if (stream_count != UINT_MAX) wg_parser_disconnect(object->wg_parser); @@ -158,10 +159,10 @@ index 6f9392d214a..b9054f48ccf 100644 { object->read_thread_shutdown = true; diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h -index 0dbcbff7f33..c099ed255ee 100644 +index 88448714bff..2924757aa8d 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h -@@ -231,6 +231,16 @@ struct wg_parser_push_data_params +@@ -257,6 +257,16 @@ struct wg_parser_push_data_params UINT32 size; }; @@ -178,7 +179,7 @@ index 0dbcbff7f33..c099ed255ee 100644 struct wg_parser_get_stream_count_params { wg_parser_t parser; -@@ -489,6 +499,8 @@ enum unix_funcs +@@ -530,6 +540,8 @@ enum unix_funcs unix_wg_parser_get_next_read_offset, unix_wg_parser_push_data, @@ -188,7 +189,7 @@ index 0dbcbff7f33..c099ed255ee 100644 unix_wg_parser_get_stream, diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 2259ce08754..c6129d49ed5 100644 +index 926523fb45c..d0495936668 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -43,6 +43,12 @@ @@ -214,7 +215,7 @@ index 2259ce08754..c6129d49ed5 100644 }; static const unsigned int input_cache_chunk_size = 512 << 10; -@@ -246,6 +255,47 @@ static NTSTATUS wg_parser_push_data(void *args) +@@ -253,6 +262,47 @@ static NTSTATUS wg_parser_push_data(void *args) return S_OK; } @@ -259,10 +260,10 @@ index 2259ce08754..c6129d49ed5 100644 + return hr; +} + - static NTSTATUS wg_parser_stream_get_preferred_format(void *args) + static NTSTATUS wg_parser_stream_get_current_format(void *args) { - const struct wg_parser_stream_get_preferred_format_params *params = args; -@@ -1787,6 +1837,19 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use + const struct wg_parser_stream_get_current_format_params *params = args; +@@ -1870,6 +1920,19 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use break; } @@ -282,7 +283,7 @@ index 2259ce08754..c6129d49ed5 100644 default: break; } -@@ -2209,6 +2272,7 @@ static NTSTATUS wg_parser_disconnect(void *args) +@@ -2292,6 +2355,7 @@ static NTSTATUS wg_parser_disconnect(void *args) parser->sink_connected = false; pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->read_cond); @@ -290,7 +291,7 @@ index 2259ce08754..c6129d49ed5 100644 for (i = 0; i < parser->stream_count; ++i) free_stream(parser->streams[i]); -@@ -2422,6 +2486,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] = +@@ -2506,6 +2570,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] = X(wg_parser_get_next_read_offset), X(wg_parser_push_data), @@ -299,7 +300,7 @@ index 2259ce08754..c6129d49ed5 100644 X(wg_parser_get_stream_count), X(wg_parser_get_stream), -@@ -2869,6 +2935,8 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +@@ -3074,6 +3140,8 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = X(wg_parser_get_next_read_offset), X64(wg_parser_push_data), @@ -309,5 +310,5 @@ index 2259ce08754..c6129d49ed5 100644 X(wg_parser_get_stream), -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0027-mf-samplegrabber-Send-sample-requests-for-unused-spa.patch b/patches/wine-gst/0027-mf-samplegrabber-Send-sample-requests-for-unused-spa.patch index 8fd59060c..118ac3f24 100644 --- a/patches/wine-gst/0027-mf-samplegrabber-Send-sample-requests-for-unused-spa.patch +++ b/patches/wine-gst/0027-mf-samplegrabber-Send-sample-requests-for-unused-spa.patch @@ -1,9 +1,10 @@ -From f4d59ae9cc3de7105919c862757c17eafd90b3fd Mon Sep 17 00:00:00 2001 +From fc7d51add445aeee5bb38b5c71a7d5e89138cd3e Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 21 May 2024 08:25:47 +0200 Subject: [PATCH 27/49] mf/samplegrabber: Send sample requests for unused space of sample queue on pause => restart. +CW-Bug-Id: #24115 --- dlls/mf/samplegrabber.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) @@ -83,5 +84,5 @@ index de599139736..77a05a6adc1 100644 grabber->sample_count = 0; } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch b/patches/wine-gst/0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch index f4917187f..8f80428e0 100644 --- a/patches/wine-gst/0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch +++ b/patches/wine-gst/0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch @@ -1,18 +1,19 @@ -From 14b19a277f337874bec0205b90f2611f9f3fabd1 Mon Sep 17 00:00:00 2001 +From 6971d23f7ea7235c9a559acad5803f22d24bf31c Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 3 Jun 2024 11:05:38 +0200 Subject: [PATCH 28/49] winegstreamer: Fix race between wg_parser_stream_disable and GST_EVENT_FLUSH_STOP. +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index c6129d49ed5..b5acba93fdd 100644 +index d0495936668..a90d350ce55 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -874,8 +874,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -995,8 +995,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) pthread_mutex_lock(&parser->mutex); stream->eos = false; @@ -23,5 +24,5 @@ index c6129d49ed5..b5acba93fdd 100644 pthread_mutex_unlock(&parser->mutex); break; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch b/patches/wine-gst/0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch index 7cef55bcc..dc7ee046c 100644 --- a/patches/wine-gst/0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch +++ b/patches/wine-gst/0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch @@ -1,4 +1,4 @@ -From 20d5d0ab5f9678f88842c2c8f98d6f2148089d35 Mon Sep 17 00:00:00 2001 +From bd5deabc2c980da0704bf8741d22b47e210425a0 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 14 Jun 2024 03:11:44 +0200 Subject: [PATCH 29/49] winegstreamer: Handle Gstreamer pipeline flushes @@ -9,15 +9,19 @@ and wg_parser_stream_copy_buffer, the latter function will return an error, resu dropped without having delivered a sample. If wg_parser_stream_copy_buffer returns an error, retry the whole wait_on_sample procedure. + +CW-Bug-Id: #21644 +CW-Bug-Id: #22799 +CW-Bug-Id: #24115 --- dlls/winegstreamer/media_source.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index b9054f48ccf..5030838bf2c 100644 +index d6051a7e4db..dc5f67a5686 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -764,6 +764,7 @@ static HRESULT media_stream_send_sample(struct media_stream *stream, const struc +@@ -635,6 +635,7 @@ static HRESULT media_stream_send_sample(struct media_stream *stream, const struc if (!wg_parser_stream_copy_buffer(stream->wg_stream, data, 0, wg_buffer->size)) { @@ -25,7 +29,7 @@ index b9054f48ccf..5030838bf2c 100644 wg_parser_stream_release_buffer(stream->wg_stream); IMFMediaBuffer_Unlock(buffer); goto out; -@@ -822,10 +823,10 @@ static HRESULT wait_on_sample(struct media_stream *stream, IUnknown *token) +@@ -693,10 +694,10 @@ static HRESULT wait_on_sample(struct media_stream *stream, IUnknown *token) { struct media_source *source = impl_from_IMFMediaSource(stream->media_source); struct wg_parser_buffer buffer; @@ -38,7 +42,7 @@ index b9054f48ccf..5030838bf2c 100644 stream->busy = TRUE; LeaveCriticalSection(&source->cs); memset(&buffer, 0, sizeof(buffer)); -@@ -841,7 +842,12 @@ static HRESULT wait_on_sample(struct media_stream *stream, IUnknown *token) +@@ -712,7 +713,12 @@ static HRESULT wait_on_sample(struct media_stream *stream, IUnknown *token) } if (ret) @@ -53,5 +57,5 @@ index b9054f48ccf..5030838bf2c 100644 } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch b/patches/wine-gst/0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch index 78d5fc79b..7555a3ed2 100644 --- a/patches/wine-gst/0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch +++ b/patches/wine-gst/0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch @@ -1,16 +1,17 @@ -From c87cdc5bca26ea3aac4fc520eae4deb02413f30f Mon Sep 17 00:00:00 2001 +From 950575219b384d35ff8682c98140ad28448c0f62 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 14 Jun 2024 03:08:48 +0200 Subject: [PATCH 30/49] winegstreamer: Do waits for samples on stream-specific work queues. +CW-Bug-Id: #21644 --- dlls/winegstreamer/media_source.c | 181 +++++++++++++++++++++----- dlls/winegstreamer/new_media_source.c | 179 ++++++++++++++++++++----- 2 files changed, 296 insertions(+), 64 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 5030838bf2c..4dd6db8c9f5 100644 +index dc5f67a5686..e8c3b8339a6 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -121,9 +121,29 @@ static HRESULT object_context_create(DWORD flags, IMFByteStream *stream, const W @@ -172,7 +173,7 @@ index 5030838bf2c..4dd6db8c9f5 100644 source_async_command_AddRef, source_async_command_Release, }; -@@ -568,7 +635,6 @@ static BOOL enqueue_token(struct media_stream *stream, IUnknown *token) +@@ -435,7 +502,6 @@ static BOOL enqueue_token(struct media_stream *stream, IUnknown *token) static void flush_token_queue(struct media_stream *stream, BOOL send) { @@ -180,7 +181,7 @@ index 5030838bf2c..4dd6db8c9f5 100644 LONG i; for (i = 0; i < stream->token_queue_count; i++) -@@ -578,13 +644,12 @@ static void flush_token_queue(struct media_stream *stream, BOOL send) +@@ -445,13 +511,12 @@ static void flush_token_queue(struct media_stream *stream, BOOL send) IUnknown *op; HRESULT hr; @@ -197,7 +198,7 @@ index 5030838bf2c..4dd6db8c9f5 100644 IUnknown_Release(op); } if (FAILED(hr)) -@@ -884,15 +949,6 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA +@@ -755,15 +820,6 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA if (FAILED(hr = media_source_stop(source))) WARN("Failed to stop source %p, hr %#lx\n", source, hr); break; @@ -213,7 +214,7 @@ index 5030838bf2c..4dd6db8c9f5 100644 } LeaveCriticalSection(&source->cs); -@@ -911,6 +967,61 @@ static const IMFAsyncCallbackVtbl source_async_commands_callback_vtbl = +@@ -782,6 +838,61 @@ static const IMFAsyncCallbackVtbl source_async_commands_callback_vtbl = source_async_commands_Invoke, }; @@ -275,7 +276,7 @@ index 5030838bf2c..4dd6db8c9f5 100644 static DWORD CALLBACK read_thread(void *arg) { struct media_source *source = arg; -@@ -1158,15 +1269,14 @@ static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown +@@ -1029,15 +1140,14 @@ static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown hr = MF_E_MEDIA_SOURCE_WRONGSTATE; else if (stream->eos) hr = MF_E_END_OF_STREAM; @@ -294,7 +295,7 @@ index 5030838bf2c..4dd6db8c9f5 100644 IUnknown_Release(op); } -@@ -1201,9 +1311,11 @@ static HRESULT media_stream_create(IMFMediaSource *source, IMFStreamDescriptor * +@@ -1072,9 +1182,11 @@ static HRESULT media_stream_create(IMFMediaSource *source, IMFStreamDescriptor * return E_OUTOFMEMORY; object->IMFMediaStream_iface.lpVtbl = &media_stream_vtbl; @@ -307,7 +308,7 @@ index 5030838bf2c..4dd6db8c9f5 100644 { free(object); return hr; -@@ -1699,6 +1811,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -1575,6 +1687,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) struct media_stream *stream = source->streams[source->stream_count]; IMFStreamDescriptor_Release(source->descriptors[source->stream_count]); IMFMediaEventQueue_Shutdown(stream->event_queue); @@ -315,7 +316,7 @@ index 5030838bf2c..4dd6db8c9f5 100644 IMFMediaStream_Release(&stream->IMFMediaStream_iface); } free(source->descriptors); -@@ -1861,7 +1974,11 @@ fail: +@@ -1735,7 +1848,11 @@ fail: for (i = 0; i < stream_count; i++) { if (object->streams && object->streams[i]) @@ -328,11 +329,11 @@ index 5030838bf2c..4dd6db8c9f5 100644 for (i = 0; i < stream_count; i++) { diff --git a/dlls/winegstreamer/new_media_source.c b/dlls/winegstreamer/new_media_source.c -index efaf6a3e087..7444fc1c788 100644 +index a97d659e58d..06482fd36dc 100644 --- a/dlls/winegstreamer/new_media_source.c +++ b/dlls/winegstreamer/new_media_source.c -@@ -239,15 +239,37 @@ static HRESULT create_media_source_fallback(struct object_context *context, IUnk - return hr; +@@ -153,15 +153,37 @@ static HRESULT object_context_create(DWORD flags, IMFByteStream *stream, const W + return S_OK; } +enum stream_async_op @@ -369,7 +370,7 @@ index efaf6a3e087..7444fc1c788 100644 IUnknown **token_queue; LONG token_queue_count; LONG token_queue_cap; -@@ -261,7 +283,6 @@ enum source_async_op +@@ -175,7 +197,6 @@ enum source_async_op SOURCE_ASYNC_START, SOURCE_ASYNC_PAUSE, SOURCE_ASYNC_STOP, @@ -377,7 +378,7 @@ index efaf6a3e087..7444fc1c788 100644 }; struct source_async_command -@@ -277,11 +298,6 @@ struct source_async_command +@@ -191,11 +212,6 @@ struct source_async_command GUID format; PROPVARIANT position; } start; @@ -389,7 +390,7 @@ index efaf6a3e087..7444fc1c788 100644 } u; }; -@@ -326,6 +342,16 @@ static inline struct media_stream *impl_from_IMFMediaStream(IMFMediaStream *ifac +@@ -240,6 +256,16 @@ static inline struct media_stream *impl_from_IMFMediaStream(IMFMediaStream *ifac return CONTAINING_RECORD(iface, struct media_stream, IMFMediaStream_iface); } @@ -406,7 +407,7 @@ index efaf6a3e087..7444fc1c788 100644 static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *iface) { return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface); -@@ -356,7 +382,7 @@ static inline struct source_async_command *impl_from_async_command_IUnknown(IUnk +@@ -270,7 +296,7 @@ static inline struct source_async_command *impl_from_async_command_IUnknown(IUnk return CONTAINING_RECORD(iface, struct source_async_command, IUnknown_iface); } @@ -415,7 +416,7 @@ index efaf6a3e087..7444fc1c788 100644 { if (IsEqualIID(riid, &IID_IUnknown)) { -@@ -370,6 +396,52 @@ static HRESULT WINAPI source_async_command_QueryInterface(IUnknown *iface, REFII +@@ -284,6 +310,52 @@ static HRESULT WINAPI source_async_command_QueryInterface(IUnknown *iface, REFII return E_NOINTERFACE; } @@ -468,7 +469,7 @@ index efaf6a3e087..7444fc1c788 100644 static ULONG WINAPI source_async_command_AddRef(IUnknown *iface) { struct source_async_command *command = impl_from_async_command_IUnknown(iface); -@@ -388,11 +460,6 @@ static ULONG WINAPI source_async_command_Release(IUnknown *iface) +@@ -302,11 +374,6 @@ static ULONG WINAPI source_async_command_Release(IUnknown *iface) IMFPresentationDescriptor_Release(command->u.start.descriptor); PropVariantClear(&command->u.start.position); } @@ -480,7 +481,7 @@ index efaf6a3e087..7444fc1c788 100644 free(command); } -@@ -401,7 +468,7 @@ static ULONG WINAPI source_async_command_Release(IUnknown *iface) +@@ -315,7 +382,7 @@ static ULONG WINAPI source_async_command_Release(IUnknown *iface) static const IUnknownVtbl source_async_command_vtbl = { @@ -489,7 +490,7 @@ index efaf6a3e087..7444fc1c788 100644 source_async_command_AddRef, source_async_command_Release, }; -@@ -568,7 +635,6 @@ static BOOL enqueue_token(struct media_stream *stream, IUnknown *token) +@@ -452,7 +519,6 @@ static BOOL enqueue_token(struct media_stream *stream, IUnknown *token) static void flush_token_queue(struct media_stream *stream, BOOL send) { @@ -497,7 +498,7 @@ index efaf6a3e087..7444fc1c788 100644 LONG i; for (i = 0; i < stream->token_queue_count; i++) -@@ -578,13 +644,12 @@ static void flush_token_queue(struct media_stream *stream, BOOL send) +@@ -462,13 +528,12 @@ static void flush_token_queue(struct media_stream *stream, BOOL send) IUnknown *op; HRESULT hr; @@ -514,7 +515,7 @@ index efaf6a3e087..7444fc1c788 100644 IUnknown_Release(op); } if (FAILED(hr)) -@@ -844,15 +909,6 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA +@@ -734,15 +799,6 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA if (FAILED(hr = media_source_stop(source))) WARN("Failed to stop source %p, hr %#lx\n", source, hr); break; @@ -530,7 +531,7 @@ index efaf6a3e087..7444fc1c788 100644 } LeaveCriticalSection(&source->cs); -@@ -871,6 +927,61 @@ static const IMFAsyncCallbackVtbl source_async_commands_callback_vtbl = +@@ -761,6 +817,61 @@ static const IMFAsyncCallbackVtbl source_async_commands_callback_vtbl = source_async_commands_Invoke, }; @@ -592,7 +593,7 @@ index efaf6a3e087..7444fc1c788 100644 static HRESULT WINAPI media_stream_QueryInterface(IMFMediaStream *iface, REFIID riid, void **out) { struct media_stream *stream = impl_from_IMFMediaStream(iface); -@@ -1023,15 +1134,14 @@ static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown +@@ -913,15 +1024,14 @@ static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown hr = MF_E_MEDIA_SOURCE_WRONGSTATE; else if (stream->eos) hr = MF_E_END_OF_STREAM; @@ -611,7 +612,7 @@ index efaf6a3e087..7444fc1c788 100644 IUnknown_Release(op); } -@@ -1065,9 +1175,11 @@ static HRESULT media_stream_create(IMFMediaSource *source, IMFStreamDescriptor * +@@ -955,9 +1065,11 @@ static HRESULT media_stream_create(IMFMediaSource *source, IMFStreamDescriptor * return E_OUTOFMEMORY; object->IMFMediaStream_iface.lpVtbl = &media_stream_vtbl; @@ -624,7 +625,7 @@ index efaf6a3e087..7444fc1c788 100644 { free(object); return hr; -@@ -1517,6 +1629,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -1407,6 +1519,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) struct media_stream *stream = source->streams[source->stream_count]; IMFStreamDescriptor_Release(source->descriptors[source->stream_count]); IMFMediaEventQueue_Shutdown(stream->event_queue); @@ -632,7 +633,7 @@ index efaf6a3e087..7444fc1c788 100644 IMFMediaStream_Release(&stream->IMFMediaStream_iface); } free(source->stream_map); -@@ -1731,6 +1844,8 @@ fail: +@@ -1640,6 +1753,8 @@ fail: { struct media_stream *stream = object->streams[object->stream_count]; IMFStreamDescriptor_Release(object->descriptors[object->stream_count]); @@ -642,5 +643,5 @@ index efaf6a3e087..7444fc1c788 100644 } free(object->stream_map); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0031-mf-session-Ensure-that-the-command-callback-does-not.patch b/patches/wine-gst/0031-mf-session-Ensure-that-the-command-callback-does-not.patch index 411e8d8f1..8573eafc0 100644 --- a/patches/wine-gst/0031-mf-session-Ensure-that-the-command-callback-does-not.patch +++ b/patches/wine-gst/0031-mf-session-Ensure-that-the-command-callback-does-not.patch @@ -1,4 +1,4 @@ -From 05dcbdb7e95a3e2d8a9e16eb5712fd2743eedd7e Mon Sep 17 00:00:00 2001 +From 4933e5870be0176ed4595a161c33f135d029abdf Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 8 Jul 2024 10:30:50 +0200 Subject: [PATCH 31/49] mf/session: Ensure that the command callback does not @@ -11,15 +11,17 @@ Thus, it is never valid to leave the function without clearing the SESSION_FLAG_ This case can be hit by SESSION_CMD_START, and leaves the session unable to process any commands. Fix this by ensuring that SESSION_FLAG_PENDING_COMMAND is always cleared before the command callback returns. + +CW-Bug-Id: #24115 --- dlls/mf/session.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c -index 3f3be2b84b0..d43cede7874 100644 +index a5caad3c97a..752bdcf1c21 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c -@@ -2645,7 +2645,6 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, +@@ -2744,7 +2744,6 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, break; case SESSION_CMD_SET_TOPOLOGY: session_set_topology(session, op->set_topology.flags, op->set_topology.topology); @@ -27,7 +29,7 @@ index 3f3be2b84b0..d43cede7874 100644 break; case SESSION_CMD_START: session_start(session, &op->start.time_format, &op->start.start_position); -@@ -2668,12 +2667,14 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, +@@ -2767,12 +2766,14 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, break; case SESSION_CMD_SHUTDOWN: session_clear_command_list(session); @@ -44,5 +46,5 @@ index 3f3be2b84b0..d43cede7874 100644 IUnknown_Release(&op->IUnknown_iface); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0032-mf-session-Prevent-media-session-from-running-comman.patch b/patches/wine-gst/0032-mf-session-Prevent-media-session-from-running-comman.patch index 10ee2bd14..15cabd5f0 100644 --- a/patches/wine-gst/0032-mf-session-Prevent-media-session-from-running-comman.patch +++ b/patches/wine-gst/0032-mf-session-Prevent-media-session-from-running-comman.patch @@ -1,18 +1,19 @@ -From 5889f10d8679bf7c0d0d5492f72ef016f5144e49 Mon Sep 17 00:00:00 2001 +From c0a51e37cb3ce529f693d0732a836d758b71dd60 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 29 Jul 2024 04:21:03 +0200 Subject: [PATCH 32/49] mf/session: Prevent media session from running commands concurrently. +CW-Bug-Id: #24115 --- dlls/mf/session.c | 105 ++++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 41 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c -index d43cede7874..170a31ef2ad 100644 +index 752bdcf1c21..e119755f732 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c -@@ -219,6 +219,7 @@ enum presentation_flags +@@ -220,6 +220,7 @@ enum presentation_flags SESSION_FLAG_END_OF_PRESENTATION = 0x10, SESSION_FLAG_PENDING_RATE_CHANGE = 0x20, SESSION_FLAG_PENDING_COMMAND = 0x40, @@ -20,7 +21,7 @@ index d43cede7874..170a31ef2ad 100644 }; struct media_session -@@ -454,6 +455,33 @@ static HRESULT session_is_shut_down(struct media_session *session) +@@ -455,6 +456,33 @@ static HRESULT session_is_shut_down(struct media_session *session) return session->state == SESSION_STATE_SHUT_DOWN ? MF_E_SHUTDOWN : S_OK; } @@ -54,7 +55,7 @@ index d43cede7874..170a31ef2ad 100644 static HRESULT session_submit_command(struct media_session *session, struct session_op *op) { HRESULT hr; -@@ -463,13 +491,12 @@ static HRESULT session_submit_command(struct media_session *session, struct sess +@@ -464,13 +492,12 @@ static HRESULT session_submit_command(struct media_session *session, struct sess EnterCriticalSection(&session->cs); if (SUCCEEDED(hr = session_is_shut_down(session))) { @@ -69,7 +70,7 @@ index d43cede7874..170a31ef2ad 100644 } LeaveCriticalSection(&session->cs); -@@ -871,17 +898,9 @@ static struct topo_node *session_get_node_by_id(const struct media_session *sess +@@ -953,17 +980,9 @@ static struct topo_node *session_get_topo_node_output(const struct media_session static void session_command_complete(struct media_session *session) { @@ -89,7 +90,7 @@ index d43cede7874..170a31ef2ad 100644 } static void session_command_complete_with_event(struct media_session *session, MediaEventType event, -@@ -913,21 +932,11 @@ static HRESULT session_subscribe_sources(struct media_session *session) +@@ -995,21 +1014,11 @@ static HRESULT session_subscribe_sources(struct media_session *session) return hr; } @@ -115,7 +116,7 @@ index d43cede7874..170a31ef2ad 100644 } static void session_start(struct media_session *session, const GUID *time_format, const PROPVARIANT *start_position) -@@ -952,6 +961,9 @@ static void session_start(struct media_session *session, const GUID *time_format +@@ -1034,6 +1043,9 @@ static void session_start(struct media_session *session, const GUID *time_format /* fallthrough */ case SESSION_STATE_PAUSED: case SESSION_STATE_STARTED: @@ -125,7 +126,7 @@ index d43cede7874..170a31ef2ad 100644 if (session->state == SESSION_STATE_STARTED && !(session->caps & MFSESSIONCAP_SEEK)) { WARN("Seeking is not supported for this session.\n"); -@@ -985,6 +997,12 @@ static void session_start(struct media_session *session, const GUID *time_format +@@ -1067,6 +1079,12 @@ static void session_start(struct media_session *session, const GUID *time_format session_command_complete_with_event(session, MESessionStarted, hr, NULL); return; } @@ -138,7 +139,7 @@ index d43cede7874..170a31ef2ad 100644 } LIST_FOR_EACH_ENTRY(topo_node, &session->presentation.nodes, struct topo_node, entry) -@@ -997,6 +1015,11 @@ static void session_start(struct media_session *session, const GUID *time_format +@@ -1079,6 +1097,11 @@ static void session_start(struct media_session *session, const GUID *time_format stream->draining = FALSE; } } @@ -150,7 +151,7 @@ index d43cede7874..170a31ef2ad 100644 } if (session->state == SESSION_STATE_STARTED) -@@ -1010,11 +1033,11 @@ static void session_start(struct media_session *session, const GUID *time_format +@@ -1092,11 +1115,11 @@ static void session_start(struct media_session *session, const GUID *time_format else if (node->type == MF_TOPOLOGY_TRANSFORM_NODE) IMFTransform_ProcessMessage(node->object.transform, MFT_MESSAGE_COMMAND_FLUSH, 0); } @@ -165,7 +166,7 @@ index d43cede7874..170a31ef2ad 100644 default: session_command_complete_with_event(session, MESessionStarted, MF_E_INVALIDREQUEST, NULL); break; -@@ -1028,7 +1051,7 @@ static void session_set_started(struct media_session *session) +@@ -1110,7 +1133,7 @@ static void session_set_started(struct media_session *session) unsigned int caps; DWORD flags; @@ -174,7 +175,7 @@ index d43cede7874..170a31ef2ad 100644 caps = session->caps | MFSESSIONCAP_PAUSE; -@@ -1060,7 +1083,7 @@ static void session_set_paused(struct media_session *session, unsigned int state +@@ -1142,7 +1165,7 @@ static void session_set_paused(struct media_session *session, unsigned int state /* Failed event status could indicate a failure during normal transition to paused state, or an attempt to pause from invalid initial state. To finalize failed transition in the former case, state is still forced to PAUSED, otherwise previous state is retained. */ @@ -183,7 +184,7 @@ index d43cede7874..170a31ef2ad 100644 if (SUCCEEDED(status)) session_set_caps(session, session->caps & ~MFSESSIONCAP_PAUSE); session_command_complete_with_event(session, MESessionPaused, status, NULL); -@@ -1068,7 +1091,7 @@ static void session_set_paused(struct media_session *session, unsigned int state +@@ -1150,7 +1173,7 @@ static void session_set_paused(struct media_session *session, unsigned int state static void session_set_closed(struct media_session *session, HRESULT status) { @@ -192,7 +193,7 @@ index d43cede7874..170a31ef2ad 100644 if (SUCCEEDED(status)) session_set_caps(session, session->caps & ~(MFSESSIONCAP_START | MFSESSIONCAP_SEEK)); session_command_complete_with_event(session, MESessionClosed, status, NULL); -@@ -1085,7 +1108,7 @@ static void session_pause(struct media_session *session) +@@ -1167,7 +1190,7 @@ static void session_pause(struct media_session *session) /* Transition in two steps - pause the clock, wait for sinks, then pause sources. */ if (SUCCEEDED(hr = IMFPresentationClock_Pause(session->clock))) @@ -201,7 +202,7 @@ index d43cede7874..170a31ef2ad 100644 state = SESSION_STATE_PAUSED; break; -@@ -1123,7 +1146,7 @@ static void session_set_stopped(struct media_session *session, HRESULT status) +@@ -1205,7 +1228,7 @@ static void session_set_stopped(struct media_session *session, HRESULT status) MediaEventType event_type; IMFMediaEvent *event; @@ -210,7 +211,7 @@ index d43cede7874..170a31ef2ad 100644 event_type = session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION ? MESessionEnded : MESessionStopped; if (SUCCEEDED(MFCreateMediaEvent(event_type, &GUID_NULL, status, NULL, &event))) -@@ -1148,7 +1171,7 @@ static void session_stop(struct media_session *session) +@@ -1230,7 +1253,7 @@ static void session_stop(struct media_session *session) /* Transition in two steps - stop the clock, wait for sinks, then stop sources. */ IMFPresentationClock_GetTime(session->clock, &session->presentation.clock_stop_time); if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) @@ -219,7 +220,7 @@ index d43cede7874..170a31ef2ad 100644 else session_set_stopped(session, hr); -@@ -1170,7 +1193,7 @@ static HRESULT session_finalize_sinks(struct media_session *session) +@@ -1252,7 +1275,7 @@ static HRESULT session_finalize_sinks(struct media_session *session) HRESULT hr = S_OK; session->presentation.flags &= ~SESSION_FLAG_FINALIZE_SINKS; @@ -228,7 +229,7 @@ index d43cede7874..170a31ef2ad 100644 LIST_FOR_EACH_ENTRY(sink, &session->presentation.sinks, struct media_sink, entry) { -@@ -1206,7 +1229,7 @@ static void session_close(struct media_session *session) +@@ -1288,7 +1311,7 @@ static void session_close(struct media_session *session) case SESSION_STATE_PAUSED: session->presentation.flags |= SESSION_FLAG_FINALIZE_SINKS; if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) @@ -237,7 +238,7 @@ index d43cede7874..170a31ef2ad 100644 break; default: hr = MF_E_INVALIDREQUEST; -@@ -2303,7 +2326,7 @@ static HRESULT WINAPI mfsession_Shutdown(IMFMediaSession *iface) +@@ -2402,7 +2425,7 @@ static HRESULT WINAPI mfsession_Shutdown(IMFMediaSession *iface) EnterCriticalSection(&session->cs); if (SUCCEEDED(hr = session_is_shut_down(session))) { @@ -246,7 +247,7 @@ index d43cede7874..170a31ef2ad 100644 IMFMediaEventQueue_Shutdown(session->event_queue); if (session->quality_manager) IMFQualityManager_Shutdown(session->quality_manager); -@@ -3020,10 +3043,10 @@ static void session_set_source_object_state(struct media_session *session, IUnkn +@@ -3117,10 +3140,10 @@ static void session_set_source_object_state(struct media_session *session, IUnkn } } } @@ -259,7 +260,7 @@ index d43cede7874..170a31ef2ad 100644 break; case SESSION_STATE_PAUSING_SOURCES: -@@ -3085,7 +3108,7 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre +@@ -3182,7 +3205,7 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre break; if (SUCCEEDED(session_start_clock(session))) @@ -269,5 +270,5 @@ index d43cede7874..170a31ef2ad 100644 case SESSION_STATE_STARTING_SINKS: if (!session_is_output_nodes_state(session, OBJ_STATE_STARTED)) -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0033-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch b/patches/wine-gst/0033-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch index 462a30426..dab2aaaad 100644 --- a/patches/wine-gst/0033-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch +++ b/patches/wine-gst/0033-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch @@ -1,9 +1,10 @@ -From 2bf3e8934eec9d68a83a20bbbe4087c3e3b6f71d Mon Sep 17 00:00:00 2001 +From 8efb1727c87c3cfde55efbc9766bbefa032839cd Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 29 Jul 2024 10:41:23 +0200 Subject: [PATCH 33/49] mf/sar: Allow starting audio renderer again after pausing it. +CW-Bug-Id: #24115 --- dlls/mf/sar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -22,5 +23,5 @@ index 970063497b1..d588aa68871 100644 if (FAILED(hr = IAudioClient_Start(renderer->audio_client))) WARN("Failed to start audio client, hr %#lx.\n", hr); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0034-winegstreamer-Also-flush-token-queue-on-seek.patch b/patches/wine-gst/0034-winegstreamer-Also-flush-token-queue-on-seek.patch index 92c20704f..b5926d17b 100644 --- a/patches/wine-gst/0034-winegstreamer-Also-flush-token-queue-on-seek.patch +++ b/patches/wine-gst/0034-winegstreamer-Also-flush-token-queue-on-seek.patch @@ -1,19 +1,21 @@ -From 0047ead50debb434b20c06ffc56cbf592e9fe92c Mon Sep 17 00:00:00 2001 +From 2dd498b2dfb47e320fcdcd1a1745cc52beb003f1 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 6 Aug 2024 23:53:39 +0200 Subject: [PATCH 34/49] winegstreamer: Also flush token queue on seek. This is needed by video_frame_sink in mfmediaengine to properly restart playback after pausing if the unpausing operation is a seek. + +CW-Bug-Id: #24115 --- dlls/winegstreamer/media_source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 4dd6db8c9f5..ceaad05e2c0 100644 +index e8c3b8339a6..6a5fb57dbd3 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -759,7 +759,7 @@ static HRESULT media_source_start(struct media_source *source, IMFPresentationDe +@@ -630,7 +630,7 @@ static HRESULT media_source_start(struct media_source *source, IMFPresentationDe AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning); for (i = 0; i < source->stream_count; i++) @@ -23,5 +25,5 @@ index 4dd6db8c9f5..ceaad05e2c0 100644 return IMFMediaEventQueue_QueueEventParamVar(source->event_queue, seek_message ? MESourceSeeked : MESourceStarted, &GUID_NULL, S_OK, position); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0035-mf-session-Fix-pausing-a-media-session-when-the-medi.patch b/patches/wine-gst/0035-mf-session-Fix-pausing-a-media-session-when-the-medi.patch index 1740c6446..6a1d477e2 100644 --- a/patches/wine-gst/0035-mf-session-Fix-pausing-a-media-session-when-the-medi.patch +++ b/patches/wine-gst/0035-mf-session-Fix-pausing-a-media-session-when-the-medi.patch @@ -1,18 +1,19 @@ -From 54c89667f04907474169d104949b508e95f484c8 Mon Sep 17 00:00:00 2001 +From 9fec3ce721e930a22400f34063ce5c11b30d61eb Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 7 Aug 2024 02:09:31 +0200 Subject: [PATCH 35/49] mf/session: Fix pausing a media session when the media source sends buffering events. +CW-Bug-Id: #24115 --- dlls/mf/session.c | 125 +++++++++++++++++++++++++++++----------------- 1 file changed, 79 insertions(+), 46 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c -index 170a31ef2ad..c341a59f925 100644 +index e119755f732..eab36a88234 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c -@@ -261,6 +261,7 @@ struct media_session +@@ -262,6 +262,7 @@ struct media_session struct list commands; enum session_state state; DWORD caps; @@ -20,7 +21,7 @@ index 170a31ef2ad..c341a59f925 100644 CRITICAL_SECTION cs; }; -@@ -1097,6 +1098,38 @@ static void session_set_closed(struct media_session *session, HRESULT status) +@@ -1179,6 +1180,38 @@ static void session_set_closed(struct media_session *session, HRESULT status) session_command_complete_with_event(session, MESessionClosed, status, NULL); } @@ -59,7 +60,7 @@ index 170a31ef2ad..c341a59f925 100644 static void session_pause(struct media_session *session) { unsigned int state = ~0u; -@@ -1107,7 +1140,12 @@ static void session_pause(struct media_session *session) +@@ -1189,7 +1222,12 @@ static void session_pause(struct media_session *session) case SESSION_STATE_STARTED: /* Transition in two steps - pause the clock, wait for sinks, then pause sources. */ @@ -73,7 +74,7 @@ index 170a31ef2ad..c341a59f925 100644 session_set_state(session, SESSION_STATE_PAUSING_SINKS); state = SESSION_STATE_PAUSED; -@@ -1159,6 +1197,28 @@ static void session_set_stopped(struct media_session *session, HRESULT status) +@@ -1241,6 +1279,28 @@ static void session_set_stopped(struct media_session *session, HRESULT status) session_command_complete(session); } @@ -102,7 +103,7 @@ index 170a31ef2ad..c341a59f925 100644 static void session_stop(struct media_session *session) { HRESULT hr = MF_E_INVALIDREQUEST; -@@ -1170,7 +1230,12 @@ static void session_stop(struct media_session *session) +@@ -1252,7 +1312,12 @@ static void session_stop(struct media_session *session) /* Transition in two steps - stop the clock, wait for sinks, then stop sources. */ IMFPresentationClock_GetTime(session->clock, &session->presentation.clock_stop_time); @@ -116,7 +117,7 @@ index 170a31ef2ad..c341a59f925 100644 session_set_state(session, SESSION_STATE_STOPPING_SINKS); else session_set_stopped(session, hr); -@@ -1228,7 +1293,12 @@ static void session_close(struct media_session *session) +@@ -1310,7 +1375,12 @@ static void session_close(struct media_session *session) case SESSION_STATE_STARTED: case SESSION_STATE_PAUSED: session->presentation.flags |= SESSION_FLAG_FINALIZE_SINKS; @@ -130,7 +131,7 @@ index 170a31ef2ad..c341a59f925 100644 session_set_state(session, SESSION_STATE_STOPPING_SINKS); break; default: -@@ -2866,19 +2936,6 @@ static BOOL session_is_source_nodes_state(struct media_session *session, enum ob +@@ -2963,19 +3033,6 @@ static BOOL session_is_source_nodes_state(struct media_session *session, enum ob return TRUE; } @@ -150,7 +151,7 @@ index 170a31ef2ad..c341a59f925 100644 static enum object_state session_get_object_state_for_event(MediaEventType event) { switch (event) -@@ -2923,6 +2980,8 @@ static HRESULT session_start_clock(struct media_session *session) +@@ -3020,6 +3077,8 @@ static HRESULT session_start_clock(struct media_session *session) if (FAILED(hr = IMFPresentationClock_Start(session->clock, start_offset))) WARN("Failed to start session clock, hr %#lx.\n", hr); @@ -159,7 +160,7 @@ index 170a31ef2ad..c341a59f925 100644 return hr; } -@@ -3090,7 +3149,6 @@ static void session_set_source_object_state(struct media_session *session, IUnkn +@@ -3187,7 +3246,6 @@ static void session_set_source_object_state(struct media_session *session, IUnkn static void session_set_sink_stream_state(struct media_session *session, IMFStreamSink *stream, MediaEventType event_type) { @@ -167,7 +168,7 @@ index 170a31ef2ad..c341a59f925 100644 enum object_state state; HRESULT hr = S_OK; BOOL changed; -@@ -3117,38 +3175,12 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre +@@ -3214,38 +3272,12 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre session_set_started(session); break; case SESSION_STATE_PAUSING_SINKS: @@ -208,7 +209,7 @@ index 170a31ef2ad..c341a59f925 100644 break; default: ; -@@ -3814,8 +3846,9 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM +@@ -4138,8 +4170,9 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM { if (event_type == MEBufferingStarted) IMFPresentationClock_Pause(session->clock); @@ -220,5 +221,5 @@ index 170a31ef2ad..c341a59f925 100644 IMFMediaEventQueue_QueueEvent(session->event_queue, event); } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0036-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch b/patches/wine-gst/0036-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch index 9fc7ff454..95739f5b0 100644 --- a/patches/wine-gst/0036-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch +++ b/patches/wine-gst/0036-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch @@ -1,19 +1,28 @@ -From bf894a4e8cc7076b9d62a217c4ad00529ab8626c Mon Sep 17 00:00:00 2001 +From f4195d01c396612ab4eb63063cb30807687bc986 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 10 Jul 2024 22:50:17 +0200 Subject: [PATCH 36/49] winegstreamer: Do not force uridecodebin to expose uncompressed streams by failing autoplug-continue callbacks. Doing so makes uridecodebin expose pads that do not respond to CAPS queries correctly for HLS sources. + +CW-Bug-Id: #21644 --- - dlls/winegstreamer/wg_parser.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) + dlls/winegstreamer/wg_parser.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index b5acba93fdd..7915084ed5d 100644 +index a90d350ce55..57fd17c6051 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1366,10 +1366,19 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) +@@ -1446,15 +1446,26 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) + { + struct wg_parser_stream *stream; + struct wg_parser *parser = user; ++ GstCaps *caps; + + GST_LOG("parser %p, element %p, pad %p.", parser, element, pad); + if (gst_pad_is_linked(pad)) return; @@ -29,11 +38,20 @@ index b5acba93fdd..7915084ed5d 100644 + if (!(stream = create_stream(parser, gst_pad_get_stream_id(pad)))) return; +- stream->codec_caps = gst_pad_query_caps(pad, NULL); ++ stream->codec_caps = caps; + + /* For compressed stream, create an extra decodebin to decode it. */ + if (!parser->output_compressed && caps_is_compressed(stream->codec_caps)) +@@ -2415,7 +2426,7 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) -- caps = gst_pad_query_caps(pad, NULL); - wg_format_from_caps(&stream->codec_format, caps); - gst_caps_unref(caps); + if (!(element = create_element("uridecodebin", "base"))) + return FALSE; +- parser->output_compressed = true; ++ parser->output_compressed = false; + gst_bin_add(GST_BIN(parser->container), element); + parser->decodebin = element; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0037-mfmediaengine-Unstub-IMFMediaEngine-SetAutoPlay.patch b/patches/wine-gst/0037-mfmediaengine-Unstub-IMFMediaEngine-SetAutoPlay.patch index 58730c5b8..cbffce267 100644 --- a/patches/wine-gst/0037-mfmediaengine-Unstub-IMFMediaEngine-SetAutoPlay.patch +++ b/patches/wine-gst/0037-mfmediaengine-Unstub-IMFMediaEngine-SetAutoPlay.patch @@ -1,17 +1,18 @@ -From 2c05f8c49e928aa11d4b41e7b5de4862f1ebfcb0 Mon Sep 17 00:00:00 2001 +From 5d2b0ed33e7b8091f130dc46157b934b7d323adb Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 16 Aug 2024 02:29:05 +0200 Subject: [PATCH 37/49] mfmediaengine: Unstub IMFMediaEngine::SetAutoPlay. +CW-Bug-Id: #21644 --- dlls/mfmediaengine/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c -index a40f8d64f58..bd844bace6c 100644 +index cd68c122851..a0d041c35db 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c -@@ -1436,7 +1436,7 @@ static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface, +@@ -1407,7 +1407,7 @@ static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface, engine->network_state = MF_MEDIA_ENGINE_NETWORK_LOADING; IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_LOADSTART, 0, 0); @@ -20,7 +21,7 @@ index a40f8d64f58..bd844bace6c 100644 media_engine_set_flag(engine, FLAGS_ENGINE_SOURCE_PENDING | FLAGS_ENGINE_PLAY_PENDING, FALSE); if (SUCCEEDED(IMFAsyncResult_GetState(result, &state))) -@@ -2052,14 +2052,19 @@ static BOOL WINAPI media_engine_GetAutoPlay(IMFMediaEngineEx *iface) +@@ -2023,14 +2023,19 @@ static BOOL WINAPI media_engine_GetAutoPlay(IMFMediaEngineEx *iface) static HRESULT WINAPI media_engine_SetAutoPlay(IMFMediaEngineEx *iface, BOOL autoplay) { struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); @@ -44,5 +45,5 @@ index a40f8d64f58..bd844bace6c 100644 static BOOL WINAPI media_engine_GetLoop(IMFMediaEngineEx *iface) -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0038-mfmediaengine-Allow-video_frame_sink-to-continue-to-.patch b/patches/wine-gst/0038-mfmediaengine-Allow-video_frame_sink-to-continue-to-.patch new file mode 100644 index 000000000..db82e25fc --- /dev/null +++ b/patches/wine-gst/0038-mfmediaengine-Allow-video_frame_sink-to-continue-to-.patch @@ -0,0 +1,61 @@ +From a5fa8dd85bbcb19d73d1baff0345026fcf1888d7 Mon Sep 17 00:00:00 2001 +From: Torge Matthies +Date: Mon, 2 Sep 2024 09:06:24 +0200 +Subject: [PATCH 38/49] mfmediaengine: Allow video_frame_sink to continue to + work after receiving end-of-stream. + +CW-Bug-Id: #21644 +--- + dlls/mfmediaengine/main.c | 5 +++++ + dlls/mfmediaengine/mediaengine_private.h | 1 + + dlls/mfmediaengine/video_frame_sink.c | 8 +++++++- + 3 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c +index a0d041c35db..cf2944bb8b9 100644 +--- a/dlls/mfmediaengine/main.c ++++ b/dlls/mfmediaengine/main.c +@@ -976,6 +976,11 @@ static HRESULT WINAPI media_engine_session_events_Invoke(IMFAsyncCallback *iface + + IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_ENDED, 0, 0); + break; ++ case MEEndOfPresentation: ++ EnterCriticalSection(&engine->cs); ++ video_frame_sink_notify_end_of_presentation(engine->presentation.frame_sink); ++ LeaveCriticalSection(&engine->cs); ++ break; + } + + failed: +diff --git a/dlls/mfmediaengine/mediaengine_private.h b/dlls/mfmediaengine/mediaengine_private.h +index cdbdbdb90b0..50d3561a47f 100644 +--- a/dlls/mfmediaengine/mediaengine_private.h ++++ b/dlls/mfmediaengine/mediaengine_private.h +@@ -26,3 +26,4 @@ HRESULT video_frame_sink_query_iface(struct video_frame_sink *object, REFIID rii + ULONG video_frame_sink_release(struct video_frame_sink *sink); + int video_frame_sink_get_sample(struct video_frame_sink *sink, IMFSample **sample); + HRESULT video_frame_sink_get_pts(struct video_frame_sink *sink, MFTIME clocktime, LONGLONG *pts); ++void video_frame_sink_notify_end_of_presentation(struct video_frame_sink *sink); +diff --git a/dlls/mfmediaengine/video_frame_sink.c b/dlls/mfmediaengine/video_frame_sink.c +index 57d4172bda8..a26701f4e98 100644 +--- a/dlls/mfmediaengine/video_frame_sink.c ++++ b/dlls/mfmediaengine/video_frame_sink.c +@@ -1249,8 +1249,14 @@ HRESULT video_frame_sink_get_pts(struct video_frame_sink *sink, MFTIME clocktime + return hr; + } + ++void video_frame_sink_notify_end_of_presentation(struct video_frame_sink *sink) ++{ ++ /* At the end of presentation, the media source sends MEEndOfPresentation _instead of_ ++ MEMediaSample, so reset sample_request_pending here. */ ++ sink->sample_request_pending = FALSE; ++} ++ + ULONG video_frame_sink_release(struct video_frame_sink *sink) + { + return video_frame_sink_Release(&sink->IMFMediaSink_iface); + } +- +-- +2.47.0 + diff --git a/patches/wine-gst/0038-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch b/patches/wine-gst/0039-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch similarity index 78% rename from patches/wine-gst/0038-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch rename to patches/wine-gst/0039-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch index 3adf9e065..b5d35556f 100644 --- a/patches/wine-gst/0038-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch +++ b/patches/wine-gst/0039-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch @@ -1,18 +1,19 @@ -From 000f8b77e897bdacf3e4b89f84a33b242d422c80 Mon Sep 17 00:00:00 2001 +From a0a122ac3e8925f194c4be56507ea702cbf31a02 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:54 +0100 -Subject: [PATCH 38/49] [HACK] winegstreamer: Add a resampler to wg_parser for +Subject: [PATCH 39/49] [HACK] winegstreamer: Add a resampler to wg_parser for raw audio. +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 7915084ed5d..9e281c330b8 100644 +index 57fd17c6051..4f18a3aced0 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1291,6 +1291,10 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser +@@ -1378,6 +1378,10 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser if (!(element = create_element("audioconvert", "base")) || !append_element(parser->container, element, &first, &last)) return false; @@ -24,5 +25,5 @@ index 7915084ed5d..9e281c330b8 100644 if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink)) return false; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0039-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch b/patches/wine-gst/0040-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch similarity index 82% rename from patches/wine-gst/0039-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch rename to patches/wine-gst/0040-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch index 13f79d924..f7c45640d 100644 --- a/patches/wine-gst/0039-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch +++ b/patches/wine-gst/0040-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch @@ -1,18 +1,19 @@ -From 5c6edafba7ac309617a203ff3052929fa79bf2c2 Mon Sep 17 00:00:00 2001 +From 0743bab5b25d98ae3064ef57e1fcf935dd7bc046 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:54 +0100 -Subject: [PATCH 39/49] [HACK] winegstreamer: Add a videoscale element to +Subject: [PATCH 40/49] [HACK] winegstreamer: Add a videoscale element to wg_parser for raw video. +CW-Bug-Id: #21644 --- dlls/winegstreamer/wg_parser.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 9e281c330b8..8907159a6ac 100644 +index 4f18a3aced0..4aa06a44348 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1199,6 +1199,10 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser +@@ -1286,6 +1286,10 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser if (!(element = create_element("gldownload", "base")) || !append_element(parser->container, element, &first, &last)) return false; @@ -23,7 +24,7 @@ index 9e281c330b8..8907159a6ac 100644 if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink)) return false; -@@ -1279,6 +1283,11 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser +@@ -1366,6 +1370,11 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser /* Let GStreamer choose a default number of threads. */ gst_util_set_object_arg(G_OBJECT(element), "n-threads", "0"); @@ -36,5 +37,5 @@ index 9e281c330b8..8907159a6ac 100644 return false; } -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0040-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch b/patches/wine-gst/0041-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch similarity index 88% rename from patches/wine-gst/0040-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch rename to patches/wine-gst/0041-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch index da9341426..7eb45e9ab 100644 --- a/patches/wine-gst/0040-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch +++ b/patches/wine-gst/0041-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch @@ -1,7 +1,7 @@ -From 2e0f8ccdcf8de7e1706b9e8490588c46cfbee720 Mon Sep 17 00:00:00 2001 +From 22780ab7e02bd6803182da82e11fce3cb9c1458e Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Sat, 2 Mar 2024 21:19:25 +0100 -Subject: [PATCH 40/49] [HACK] mfmediaengine: Do not send +Subject: [PATCH 41/49] [HACK] mfmediaengine: Do not send MF_MEDIA_ENGINE_EVENT_ERROR for VRChat. Breaks AVPro Video (used by VRChat) when a IMFMediaEngine::GetError call inside the event handler doesn't return an @@ -10,15 +10,17 @@ which segfaults. I don't know why IMFMediaEngine::GetError returns a NULL instance inside the error callback. This should be fixed properly. In the meantime, this hack works around the problem. + +CW-Bug-Id: #21644 --- dlls/mfmediaengine/main.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c -index bd844bace6c..176ad38e1c1 100644 +index cf2944bb8b9..986c9fc293d 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c -@@ -1468,11 +1468,21 @@ static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface, +@@ -1444,11 +1444,21 @@ static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface, } else { @@ -46,5 +48,5 @@ index bd844bace6c..176ad38e1c1 100644 LeaveCriticalSection(&engine->cs); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0041-Marker-commit-do-not-put-into-MR.patch b/patches/wine-gst/0042-Marker-commit-do-not-put-into-MR.patch similarity index 54% rename from patches/wine-gst/0041-Marker-commit-do-not-put-into-MR.patch rename to patches/wine-gst/0042-Marker-commit-do-not-put-into-MR.patch index b6ef30ad4..5b9554aa4 100644 --- a/patches/wine-gst/0041-Marker-commit-do-not-put-into-MR.patch +++ b/patches/wine-gst/0042-Marker-commit-do-not-put-into-MR.patch @@ -1,21 +1,21 @@ -From 96f912f95de023a6810fba798c3307ec8a20cf14 Mon Sep 17 00:00:00 2001 +From b37e29cd5bd16e897f8f5b9d9e923643a9adee5b Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 25 Mar 2024 09:58:04 +0100 -Subject: [PATCH 41/49] === Marker commit, do not put into MR === +Subject: [PATCH 42/49] === Marker commit, do not put into MR === --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS -index ab42dff2884..f8890de4743 100644 +index a414cc846c8..8fe2ee79f1d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -438,3 +438,4 @@ P: Erich E. Hoover +@@ -437,3 +437,4 @@ P: Erich E. Hoover W: https://wine-staging.com/ seek +tmp -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch b/patches/wine-gst/0043-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch similarity index 89% rename from patches/wine-gst/0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch rename to patches/wine-gst/0043-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch index 13ab0b729..5a097ebb2 100644 --- a/patches/wine-gst/0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch +++ b/patches/wine-gst/0043-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch @@ -1,7 +1,7 @@ -From 933c1b42e16baf390ec45e30f43b868e66add60e Mon Sep 17 00:00:00 2001 +From aaa26551f8fc5804c5c1c0ab63d6f86479352a2e Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 24 Apr 2024 22:00:49 +0200 -Subject: [PATCH 42/49] ntdll: Use unixcall instead of syscall for +Subject: [PATCH 43/49] ntdll: Use unixcall instead of syscall for QueryPerformanceCounter. --- @@ -27,7 +27,7 @@ index 105a6cf5bc8..9bd182e4cb2 100644 /****************************************************************************** diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c -index f8695a70deb..04f3fda6d4d 100644 +index 1e75eff1595..0232474cf8c 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1203,6 +1203,7 @@ static const unixlib_entry_t unix_call_funcs[] = @@ -47,10 +47,10 @@ index f8695a70deb..04f3fda6d4d 100644 #endif /* _WIN64 */ diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index 23f17e72e08..355f4658fca 100644 +index 8361f12bb89..03154060119 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -1706,12 +1706,20 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou +@@ -1716,12 +1716,20 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou } @@ -73,10 +73,10 @@ index 23f17e72e08..355f4658fca 100644 return STATUS_SUCCESS; } diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 2b62d5c7754..02d6a8a0d41 100644 +index 9dc8ea627e0..3d917166df0 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -265,6 +265,8 @@ extern unsigned int alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, stru +@@ -268,6 +268,8 @@ extern unsigned int alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, stru data_size_t *ret_len ); extern NTSTATUS system_time_precise( void *args ); @@ -98,5 +98,5 @@ index e0870584a68..030801de407 100644 unix_is_pc_in_native_so, unix_debugstr_pc, -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0044-mfplat-Allocate-memory-buffers-using-calloc.patch b/patches/wine-gst/0044-mfplat-Allocate-memory-buffers-using-calloc.patch index 9306c5c0e..f2396d759 100644 --- a/patches/wine-gst/0044-mfplat-Allocate-memory-buffers-using-calloc.patch +++ b/patches/wine-gst/0044-mfplat-Allocate-memory-buffers-using-calloc.patch @@ -1,4 +1,4 @@ -From d19dc81ab7023ec68b0c1de410c14714da0caac3 Mon Sep 17 00:00:00 2001 +From e03822b0aed50898f8b3e9ec747cd4bd768f19ed Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 26 Aug 2024 19:12:39 +0200 Subject: [PATCH 44/49] mfplat: Allocate memory buffers using calloc. @@ -9,7 +9,7 @@ Skips the need to memset the allocated memory. 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c -index b7f32f12cdc..44048c8f4af 100644 +index d1fd2a99529..f3a34749d6f 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -18,6 +18,7 @@ @@ -46,7 +46,7 @@ index b7f32f12cdc..44048c8f4af 100644 free(buffer); } -@@ -1335,6 +1337,8 @@ static const IMFDXGIBufferVtbl dxgi_buffer_vtbl = +@@ -1336,6 +1338,8 @@ static const IMFDXGIBufferVtbl dxgi_buffer_vtbl = static HRESULT memory_buffer_init(struct buffer *buffer, DWORD max_length, DWORD alignment, const IMFMediaBufferVtbl *vtbl) { @@ -55,7 +55,7 @@ index b7f32f12cdc..44048c8f4af 100644 if (alignment < MF_16_BYTE_ALIGNMENT) alignment = MF_16_BYTE_ALIGNMENT; alignment++; -@@ -1350,9 +1354,13 @@ static HRESULT memory_buffer_init(struct buffer *buffer, DWORD max_length, DWORD +@@ -1351,9 +1355,13 @@ static HRESULT memory_buffer_init(struct buffer *buffer, DWORD max_length, DWORD alignment++; } @@ -72,5 +72,5 @@ index b7f32f12cdc..44048c8f4af 100644 buffer->IMFMediaBuffer_iface.lpVtbl = vtbl; buffer->refcount = 1; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0045-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch b/patches/wine-gst/0045-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch index 16819e1d0..04c2cdbdd 100644 --- a/patches/wine-gst/0045-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch +++ b/patches/wine-gst/0045-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch @@ -1,4 +1,4 @@ -From 0a188f9b782a562129db01122aa1ac0282898c38 Mon Sep 17 00:00:00 2001 +From 8353c974bf9b83ca73ef89932efcd0a8271d44d7 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 19 Mar 2024 10:20:49 +0100 Subject: [PATCH 45/49] [DEBUG] winegstreamer: GST_LOG -> GST_DEBUG. @@ -8,10 +8,10 @@ Subject: [PATCH 45/49] [DEBUG] winegstreamer: GST_LOG -> GST_DEBUG. 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 8907159a6ac..d80d6757774 100644 +index 4aa06a44348..949667f7121 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -627,7 +627,7 @@ static NTSTATUS wg_parser_stream_notify_qos(void *args) +@@ -710,7 +710,7 @@ static NTSTATUS wg_parser_stream_notify_qos(void *args) /* This can happen legitimately if the sample falls outside of the * segment bounds. GStreamer elements shouldn't present the sample in * that case, but DirectShow doesn't care. */ @@ -20,7 +20,7 @@ index 8907159a6ac..d80d6757774 100644 return S_OK; } if (!(event = gst_event_new_qos(params->underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW, -@@ -807,7 +807,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -928,7 +928,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) struct wg_parser_stream *stream = gst_pad_get_element_private(pad); struct wg_parser *parser = stream->parser; @@ -29,7 +29,7 @@ index 8907159a6ac..d80d6757774 100644 switch (event->type) { -@@ -923,7 +923,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -1042,7 +1042,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu struct wg_parser_stream *stream = gst_pad_get_element_private(pad); struct wg_parser *parser = stream->parser; @@ -38,7 +38,7 @@ index 8907159a6ac..d80d6757774 100644 pthread_mutex_lock(&parser->mutex); -@@ -949,7 +949,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -1068,7 +1068,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu if (!stream->enabled) { @@ -47,7 +47,7 @@ index 8907159a6ac..d80d6757774 100644 pthread_mutex_unlock(&parser->mutex); gst_buffer_unref(buffer); return GST_FLOW_OK; -@@ -980,7 +980,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -1099,7 +1099,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu * reference to the stream object, which will release it in * wg_parser_stream_release_buffer(). */ @@ -56,7 +56,7 @@ index 8907159a6ac..d80d6757774 100644 return GST_FLOW_OK; } -@@ -1026,7 +1026,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -1108,7 +1108,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) struct wg_parser_stream *stream = gst_pad_get_element_private(pad); struct wg_parser *parser = stream->parser; @@ -65,7 +65,7 @@ index 8907159a6ac..d80d6757774 100644 switch (query->type) { -@@ -1054,7 +1054,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -1140,7 +1140,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) gst_structure_remove_fields(gst_caps_get_structure(caps, i), "framerate", "pixel-aspect-ratio", NULL); @@ -74,7 +74,7 @@ index 8907159a6ac..d80d6757774 100644 if (filter) { -@@ -1334,7 +1334,7 @@ static void stream_decodebin_pad_added_cb(GstElement *element, GstPad *pad, gpoi +@@ -1421,7 +1421,7 @@ static void stream_decodebin_pad_added_cb(GstElement *element, GstPad *pad, gpoi struct wg_parser_stream *stream = user; struct wg_parser *parser = stream->parser; @@ -83,7 +83,7 @@ index 8907159a6ac..d80d6757774 100644 if (gst_pad_is_linked(pad)) return; -@@ -1348,7 +1348,7 @@ static bool stream_decodebin_create(struct wg_parser_stream *stream) +@@ -1435,7 +1435,7 @@ static bool stream_decodebin_create(struct wg_parser_stream *stream) { struct wg_parser *parser = stream->parser; @@ -92,7 +92,7 @@ index 8907159a6ac..d80d6757774 100644 if (!(stream->decodebin = create_element("decodebin", "base"))) return false; -@@ -1363,7 +1363,7 @@ static bool stream_decodebin_create(struct wg_parser_stream *stream) +@@ -1450,7 +1450,7 @@ static bool stream_decodebin_create(struct wg_parser_stream *stream) pthread_mutex_unlock(&parser->mutex); gst_element_sync_state_with_parent(stream->decodebin); @@ -101,7 +101,7 @@ index 8907159a6ac..d80d6757774 100644 return true; } -@@ -1374,7 +1374,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) +@@ -1461,7 +1461,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) struct wg_parser *parser = user; GstCaps *caps; @@ -110,7 +110,7 @@ index 8907159a6ac..d80d6757774 100644 if (gst_pad_is_linked(pad)) return; -@@ -1423,7 +1423,7 @@ static void pad_removed_cb(GstElement *element, GstPad *pad, gpointer user) +@@ -1508,7 +1508,7 @@ static void pad_removed_cb(GstElement *element, GstPad *pad, gpointer user) unsigned int i; char *name; @@ -119,7 +119,7 @@ index 8907159a6ac..d80d6757774 100644 for (i = 0; i < parser->stream_count; ++i) { -@@ -1482,7 +1482,7 @@ static GstFlowReturn issue_read_request(struct wg_parser *parser, guint64 offset +@@ -1567,7 +1567,7 @@ static GstFlowReturn issue_read_request(struct wg_parser *parser, guint64 offset pthread_mutex_unlock(&parser->mutex); @@ -128,7 +128,7 @@ index 8907159a6ac..d80d6757774 100644 return ret; } -@@ -1591,7 +1591,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, +@@ -1676,7 +1676,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, { struct wg_parser *parser = gst_pad_get_element_private(pad); @@ -137,7 +137,7 @@ index 8907159a6ac..d80d6757774 100644 if (offset == GST_BUFFER_OFFSET_NONE) offset = parser->next_pull_offset; -@@ -1605,7 +1605,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, +@@ -1690,7 +1690,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, if (!*buffer) *buffer = gst_buffer_new_and_alloc(0); gst_buffer_set_size(*buffer, 0); @@ -146,7 +146,7 @@ index 8907159a6ac..d80d6757774 100644 return GST_FLOW_OK; } -@@ -1626,7 +1626,7 @@ static gboolean src_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -1711,7 +1711,7 @@ static gboolean src_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) struct wg_parser *parser = gst_pad_get_element_private(pad); GstFormat format; @@ -155,7 +155,7 @@ index 8907159a6ac..d80d6757774 100644 switch (GST_QUERY_TYPE(query)) { -@@ -1930,7 +1930,7 @@ static gboolean src_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -2015,7 +2015,7 @@ static gboolean src_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) struct wg_parser *parser = gst_pad_get_element_private(pad); gboolean ret = TRUE; @@ -165,5 +165,5 @@ index 8907159a6ac..d80d6757774 100644 switch (event->type) { -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0046-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch b/patches/wine-gst/0046-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch index 45c37f2ce..1bdcaebda 100644 --- a/patches/wine-gst/0046-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch +++ b/patches/wine-gst/0046-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch @@ -1,4 +1,4 @@ -From d9c2cacdaa98534ec969baf4e361d5ba7004d308 Mon Sep 17 00:00:00 2001 +From 227aa1a62098daa8c44b840143e235b8cf9253d0 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Thu, 28 Mar 2024 16:43:07 +0100 Subject: [PATCH 46/49] [HACK] kernelbase: yt-dlp.exe redirection and cmdline @@ -78,5 +78,5 @@ index abf789d6033..163e15d920a 100644 if (flags & (IDLE_PRIORITY_CLASS | HIGH_PRIORITY_CLASS | REALTIME_PRIORITY_CLASS | -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0047-mf-Schedule-stored-timers-for-the-original-time-inst.patch b/patches/wine-gst/0047-mf-Schedule-stored-timers-for-the-original-time-inst.patch index c07f37305..af98eb14a 100644 --- a/patches/wine-gst/0047-mf-Schedule-stored-timers-for-the-original-time-inst.patch +++ b/patches/wine-gst/0047-mf-Schedule-stored-timers-for-the-original-time-inst.patch @@ -1,4 +1,4 @@ -From 85969d22ab64e0dcdeb33e0354ad7a1617c765c1 Mon Sep 17 00:00:00 2001 +From bb9623eef8959840161e4f27f53fa942e96ce498 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 23 Feb 2024 21:45:44 +0100 Subject: [PATCH 47/49] mf: Schedule stored timers for the original time @@ -68,5 +68,5 @@ index e6be05d2794..474874330bf 100644 EnterCriticalSection(&clock->cs); -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0048-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch b/patches/wine-gst/0048-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch index a9de91586..6e7680467 100644 --- a/patches/wine-gst/0048-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch +++ b/patches/wine-gst/0048-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch @@ -1,4 +1,4 @@ -From d29981a70cf0633884153b3d454463844131d0ed Mon Sep 17 00:00:00 2001 +From 6ad017721032dd3906e7aca58f6dca6877470bdb Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 23 Feb 2024 21:50:22 +0100 Subject: [PATCH 48/49] mf: Start forwarding samples only at the PTS of the @@ -6,22 +6,28 @@ Subject: [PATCH 48/49] mf: Start forwarding samples only at the PTS of the Hides desynchronization in applications that ignore the PTS, e.g. VRChat. --- - dlls/mf/session.c | 179 ++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 172 insertions(+), 7 deletions(-) + dlls/mf/session.c | 182 ++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 177 insertions(+), 5 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c -index c341a59f925..4da68960e7e 100644 +index eab36a88234..250dd461512 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c -@@ -163,6 +163,7 @@ enum topo_node_flags +@@ -164,6 +164,13 @@ enum topo_node_flags { TOPO_NODE_END_OF_STREAM = 0x1, TOPO_NODE_SCRUB_SAMPLE_COMPLETE = 0x2, + TOPO_NODE_HAS_WAITED_FOR_PTS = 0x4, ++}; ++ ++struct sample ++{ ++ struct list entry; ++ IMFSample *sample; }; struct topo_node -@@ -188,6 +189,9 @@ struct topo_node +@@ -189,6 +196,9 @@ struct topo_node { IMFMediaSource *source; DWORD stream_id; @@ -31,7 +37,7 @@ index c341a59f925..4da68960e7e 100644 } source; struct { -@@ -238,6 +242,7 @@ struct media_session +@@ -239,6 +249,7 @@ struct media_session IMFPresentationClock *clock; IMFPresentationTimeSource *system_time_source; IMFRateControl *clock_rate_control; @@ -39,7 +45,7 @@ index c341a59f925..4da68960e7e 100644 IMFTopoLoader *topo_loader; IMFQualityManager *quality_manager; struct -@@ -315,6 +320,11 @@ static struct session_op *impl_op_from_IUnknown(IUnknown *iface) +@@ -316,6 +327,11 @@ static struct session_op *impl_op_from_IUnknown(IUnknown *iface) return CONTAINING_RECORD(iface, struct session_op, IUnknown_iface); } @@ -51,8 +57,8 @@ index c341a59f925..4da68960e7e 100644 static struct topo_node *impl_node_from_IMFVideoSampleAllocatorNotify(IMFVideoSampleAllocatorNotify *iface) { return CONTAINING_RECORD(iface, struct topo_node, u.sink.notify_cb); -@@ -740,6 +750,29 @@ static void transform_stream_drop_samples(struct transform_stream *stream) - IMFSample_Release(sample); +@@ -788,6 +804,29 @@ static void transform_stream_drop_events(struct transform_stream *stream) + IMFMediaEvent_Release(event); } +static HRESULT topo_node_sourcestream_pop_sample(struct topo_node *source_node, IMFSample **sample) @@ -81,7 +87,7 @@ index c341a59f925..4da68960e7e 100644 static void release_topo_node(struct topo_node *node) { unsigned int i; -@@ -749,6 +782,12 @@ static void release_topo_node(struct topo_node *node) +@@ -797,6 +836,12 @@ static void release_topo_node(struct topo_node *node) case MF_TOPOLOGY_SOURCESTREAM_NODE: if (node->u.source.source) IMFMediaSource_Release(node->u.source.source); @@ -94,7 +100,7 @@ index c341a59f925..4da68960e7e 100644 break; case MF_TOPOLOGY_TRANSFORM_NODE: for (i = 0; i < node->u.transform.input_count; ++i) -@@ -1733,6 +1772,68 @@ static HRESULT session_get_stream_sink_type(IMFStreamSink *sink, IMFMediaType ** +@@ -1815,6 +1860,68 @@ static HRESULT session_get_stream_sink_type(IMFStreamSink *sink, IMFMediaType ** return hr; } @@ -163,7 +169,7 @@ index c341a59f925..4da68960e7e 100644 static HRESULT WINAPI node_sample_allocator_cb_QueryInterface(IMFVideoSampleAllocatorNotify *iface, REFIID riid, void **obj) { -@@ -1830,6 +1931,9 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod +@@ -1929,6 +2036,9 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod break; case MF_TOPOLOGY_SOURCESTREAM_NODE: @@ -173,7 +179,7 @@ index c341a59f925..4da68960e7e 100644 if (FAILED(IMFTopologyNode_GetUnknown(node, &MF_TOPONODE_SOURCE, &IID_IMFMediaSource, (void **)&topo_node->u.source.source))) { -@@ -2132,6 +2236,8 @@ static ULONG WINAPI mfsession_Release(IMFMediaSession *iface) +@@ -2231,6 +2341,8 @@ static ULONG WINAPI mfsession_Release(IMFMediaSession *iface) IMFPresentationTimeSource_Release(session->system_time_source); if (session->clock_rate_control) IMFRateControl_Release(session->clock_rate_control); @@ -182,8 +188,8 @@ index c341a59f925..4da68960e7e 100644 if (session->topo_loader) IMFTopoLoader_Release(session->topo_loader); if (session->quality_manager) -@@ -3566,11 +3672,41 @@ static void session_request_sample(struct media_session *session, IMFStreamSink - IMFTopologyNode_Release(upstream_node); +@@ -3893,10 +4005,40 @@ static void session_request_sample(struct media_session *session, IMFStreamSink + sink_node->u.sink.requests--; } +static HRESULT topo_node_sourcestream_push_sample(struct topo_node *source_node, IMFSample *sample) @@ -203,30 +209,28 @@ index c341a59f925..4da68960e7e 100644 +static void session_deliver_sample_from_source(struct media_session *session, struct topo_node *source_node, + IMFSample *sample) +{ -+ IMFTopologyNode *downstream_node; -+ DWORD downstream_input; -+ HRESULT hr; ++ struct topo_node *node; ++ DWORD input; + -+ if (FAILED(hr = IMFTopologyNode_GetOutput(source_node->node, 0, &downstream_node, &downstream_input))) ++ if (!(node = session_get_topo_node_output(session, source_node, 0, &input))) + { -+ WARN("Failed to get downstream node connection, hr %#lx.\n", hr); ++ WARN("Failed to node %p/%u output.\n", source_node, 0); + return; + } + -+ session_deliver_sample_to_node(session, downstream_node, downstream_input, sample); -+ IMFTopologyNode_Release(downstream_node); ++ session_deliver_sample_to_node(session, node, input, sample); +} + static void session_deliver_sample(struct media_session *session, IMFMediaStream *stream, const PROPVARIANT *value) { struct topo_node *source_node = NULL, *node; -- IMFTopologyNode *downstream_node; -- DWORD downstream_input; +- DWORD input; + IMFSample *sample; - HRESULT hr; ++ HRESULT hr; if (value && (value->vt != VT_UNKNOWN || !value->punkVal)) -@@ -3591,17 +3727,42 @@ static void session_deliver_sample(struct media_session *session, IMFMediaStream + { +@@ -3916,16 +4058,42 @@ static void session_deliver_sample(struct media_session *session, IMFMediaStream if (!source_node) return; @@ -235,10 +239,10 @@ index c341a59f925..4da68960e7e 100644 if (!value) source_node->flags |= TOPO_NODE_END_OF_STREAM; - -- if (FAILED(hr = IMFTopologyNode_GetOutput(source_node->node, 0, &downstream_node, &downstream_input))) +- if (!(node = session_get_topo_node_output(session, source_node, 0, &input))) + else if (!(source_node->flags & TOPO_NODE_HAS_WAITED_FOR_PTS)) { -- WARN("Failed to get downstream node connection, hr %#lx.\n", hr); +- WARN("Failed to node %p/%u output.\n", source_node, 0); + LONGLONG sampletime; + + source_node->flags |= TOPO_NODE_HAS_WAITED_FOR_PTS; @@ -268,13 +272,12 @@ index c341a59f925..4da68960e7e 100644 return; } -- session_deliver_sample_to_node(session, downstream_node, downstream_input, value ? (IMFSample *)value->punkVal : NULL); -- IMFTopologyNode_Release(downstream_node); -+ session_deliver_sample_from_source(session, source_node, sample); +- session_deliver_sample_to_node(session, node, input, value ? (IMFSample *)value->punkVal : NULL); ++ session_deliver_sample_from_source(session, node, sample); } static void session_sink_invalidated(struct media_session *session, IMFMediaEvent *event, IMFStreamSink *sink) -@@ -4396,6 +4557,10 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses +@@ -4720,6 +4888,10 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses goto failed; } @@ -286,5 +289,5 @@ index c341a59f925..4da68960e7e 100644 { GUID clsid; -- -2.46.0 +2.47.0 diff --git a/patches/wine-gst/0049-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch b/patches/wine-gst/0049-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch index ad9b123bd..e45435aec 100644 --- a/patches/wine-gst/0049-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch +++ b/patches/wine-gst/0049-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch @@ -1,4 +1,4 @@ -From 80c2e192ecb2c3aeccb387f7d2f7a92d46fe5451 Mon Sep 17 00:00:00 2001 +From a1975484f860600b5dbdb87daa94e4cdc08e82de Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Thu, 25 Jul 2024 00:17:20 +0200 Subject: [PATCH 49/49] [HACK] kernelbase: Replace stderr of yt-dlp process. @@ -48,5 +48,5 @@ index 163e15d920a..dc03d6d121c 100644 app_name = name; -- -2.46.0 +2.47.0