forked from GloriousEggroll/proton-ge-custom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d711782
commit ce59c51
Showing
39 changed files
with
790 additions
and
536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
patches/wine-gst/0001-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From 294c85000c51d7562eef31175487a096ac87179a Mon Sep 17 00:00:00 2001 | ||
From: Torge Matthies <[email protected]> | ||
Date: Mon, 25 Mar 2024 09:19:18 +0100 | ||
Subject: [PATCH 01/32] winegstreamer: Do not create a read thread for | ||
uridecodebin-based media sources. | ||
|
||
--- | ||
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 83ab880f8ef..6d58d51045a 100644 | ||
--- a/dlls/winegstreamer/media_source.c | ||
+++ b/dlls/winegstreamer/media_source.c | ||
@@ -1614,9 +1614,12 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) | ||
|
||
wg_parser_disconnect(source->wg_parser); | ||
|
||
- source->read_thread_shutdown = true; | ||
- WaitForSingleObject(source->read_thread, INFINITE); | ||
- CloseHandle(source->read_thread); | ||
+ if (source->read_thread) | ||
+ { | ||
+ source->read_thread_shutdown = true; | ||
+ WaitForSingleObject(source->read_thread, INFINITE); | ||
+ CloseHandle(source->read_thread); | ||
+ } | ||
|
||
IMFMediaEventQueue_Shutdown(source->event_queue); | ||
IMFByteStream_Close(source->byte_stream); | ||
@@ -1711,7 +1714,8 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc | ||
} | ||
object->wg_parser = parser; | ||
|
||
- object->read_thread = CreateThread(NULL, 0, read_thread, object, 0, NULL); | ||
+ if (context->type != WG_PARSER_URIDECODEBIN) | ||
+ object->read_thread = CreateThread(NULL, 0, read_thread, object, 0, NULL); | ||
|
||
object->state = SOURCE_OPENING; | ||
|
||
-- | ||
2.44.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
From 566e91a7df1968c79786fb94d67ddd1b466f8640 Mon Sep 17 00:00:00 2001 | ||
From d7061741bdb93e8d06ba60102d33bd01cb797b27 Mon Sep 17 00:00:00 2001 | ||
From: Torge Matthies <[email protected]> | ||
Date: Tue, 19 Mar 2024 04:06:37 +0100 | ||
Subject: [PATCH 22/29] winegstreamer: Ignore assert in wg_parser. | ||
Subject: [PATCH 02/32] winegstreamer: Ignore an assert in wg_parser. | ||
|
||
I don't know why this gets hit but it does. | ||
|
||
EDIT: I think 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. | ||
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. | ||
--- | ||
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 c8f173df6ac..5c75776f523 100644 | ||
index 2d00f4247e0..8f45f49b012 100644 | ||
--- a/dlls/winegstreamer/wg_parser.c | ||
+++ b/dlls/winegstreamer/wg_parser.c | ||
@@ -422,11 +422,12 @@ static NTSTATUS wg_parser_stream_release_buffer(void *args) | ||
@@ -409,11 +409,12 @@ static NTSTATUS wg_parser_stream_release_buffer(void *args) | ||
|
||
pthread_mutex_lock(&parser->mutex); | ||
|
||
|
@@ -32,8 +30,8 @@ index c8f173df6ac..5c75776f523 100644 | |
+ stream->buffer = NULL; | ||
+ } | ||
|
||
if (stream->buffer_queue && stream->buffer_queue_length) | ||
{ | ||
pthread_mutex_unlock(&parser->mutex); | ||
pthread_cond_signal(&stream->event_empty_cond); | ||
-- | ||
2.44.0 | ||
|
8 changes: 4 additions & 4 deletions
8
...Fixate-caps-in-autoplug_continue_cb.patch → ...Fixate-caps-in-autoplug_continue_cb.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
From 8352bf2c8624c3015d54169868b6df6ef6a87484 Mon Sep 17 00:00:00 2001 | ||
From dd85cdadb0ab69640e5d3116774ca9d7b090dbfd Mon Sep 17 00:00:00 2001 | ||
From: Torge Matthies <[email protected]> | ||
Date: Tue, 19 Mar 2024 10:19:09 +0100 | ||
Subject: [PATCH 28/29] winegstreamer: Fixate caps in autoplug_continue_cb. | ||
Subject: [PATCH 03/32] winegstreamer: Fixate caps in autoplug_continue_cb. | ||
|
||
Not strictly necessary but avoids an assert in gstreamer code. | ||
--- | ||
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 4c4ee4bcc2a..3bee51ed518 100644 | ||
index 8f45f49b012..20009d6f269 100644 | ||
--- a/dlls/winegstreamer/wg_parser.c | ||
+++ b/dlls/winegstreamer/wg_parser.c | ||
@@ -577,7 +577,9 @@ static gboolean autoplug_continue_cb(GstElement * decodebin, GstPad *pad, GstCap | ||
@@ -527,7 +527,9 @@ static gboolean autoplug_continue_cb(GstElement * decodebin, GstPad *pad, GstCap | ||
{ | ||
struct wg_format format; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,34 @@ | ||
From c61856ab6b81f6f654ec0fe2a194fa87c5b75f5f Mon Sep 17 00:00:00 2001 | ||
From e27afb77ed05d69fa8515a1e821e1341c1a04b42 Mon Sep 17 00:00:00 2001 | ||
From: Torge Matthies <[email protected]> | ||
Date: Tue, 20 Feb 2024 23:17:28 +0100 | ||
Subject: [PATCH 13/29] winegstreamer: Make wg_parser report the exact | ||
Subject: [PATCH 04/32] winegstreamer: Make wg_parser report the exact | ||
supported formats to gstreamer instead of just ANY. | ||
|
||
--- | ||
dlls/winegstreamer/wg_parser.c | 47 +++++++++++++++++++++++++++++++++- | ||
1 file changed, 46 insertions(+), 1 deletion(-) | ||
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 9cabc0d899b..962cc136173 100644 | ||
index 20009d6f269..1d3314c582e 100644 | ||
--- a/dlls/winegstreamer/wg_parser.c | ||
+++ b/dlls/winegstreamer/wg_parser.c | ||
@@ -935,6 +935,48 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu | ||
@@ -835,6 +835,43 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu | ||
return GST_FLOW_OK; | ||
} | ||
|
||
+static GstCaps *get_supported_formats(void) | ||
+{ | ||
+ static const GstAudioChannelPosition dummy_positions[] = | ||
+ { | ||
+ GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, | ||
+ GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, | ||
+ }; | ||
+ GstCaps *caps = gst_caps_new_empty(), *temp; | ||
+ GstAudioInfo ainfo; | ||
+ GstVideoInfo vinfo; | ||
+ gsize i; | ||
+ | ||
+ /* video/x-raw */ | ||
+ gst_video_info_set_format(&vinfo, WG_VIDEO_FORMAT_BGRA, 1920, 1080); | ||
+ 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", NULL); | ||
+ "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")); | ||
|
@@ -43,7 +38,7 @@ index 9cabc0d899b..962cc136173 100644 | |
+ 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, 48000, 2, dummy_positions); | ||
+ 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), | ||
|
@@ -61,7 +56,7 @@ index 9cabc0d899b..962cc136173 100644 | |
static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) | ||
{ | ||
struct wg_parser_stream *stream = gst_pad_get_element_private(pad); | ||
@@ -952,7 +994,10 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) | ||
@@ -852,7 +889,10 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) | ||
gst_query_parse_caps(query, &filter); | ||
|
||
pthread_mutex_lock(&parser->mutex); | ||
|
6 changes: 3 additions & 3 deletions
6
...-more-RTSP-based-formats-to-GStream.patch → ...-more-RTSP-based-URI-schemes-to-GSt.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
From d241727d56653caaa71b24243132ef8f21857e76 Mon Sep 17 00:00:00 2001 | ||
From 71789e7d80746468414cb14c18e9b885b11fc157 Mon Sep 17 00:00:00 2001 | ||
From: Torge Matthies <[email protected]> | ||
Date: Wed, 31 Jan 2024 17:42:54 +0100 | ||
Subject: [PATCH 06/29] winegstreamer: Add more RTSP-based formats to GStreamer | ||
scheme handler. | ||
Subject: [PATCH 05/32] winegstreamer: Add more RTSP-based URI schemes to | ||
GStreamer scheme handler. | ||
|
||
--- | ||
dlls/winegstreamer/winegstreamer.rgs | 32 ++++++++++++++++++++++++++++ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 3acfeb18e113122b20b6d6a7eb527a3037f01a72 Mon Sep 17 00:00:00 2001 | ||
From f674a8869be9b25f33d507a81fc13c85a6b38046 Mon Sep 17 00:00:00 2001 | ||
From: Torge Matthies <[email protected]> | ||
Date: Wed, 31 Jan 2024 17:42:55 +0100 | ||
Subject: [PATCH 08/29] winegstreamer: Set a clock for the wg_parser pipeline. | ||
Subject: [PATCH 06/32] 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. | ||
|
@@ -10,10 +10,10 @@ GstPipeline does this so let's do this too. | |
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c | ||
index 854597c73eb..696c24d0059 100644 | ||
index 1d3314c582e..f4ec803f14f 100644 | ||
--- a/dlls/winegstreamer/wg_parser.c | ||
+++ b/dlls/winegstreamer/wg_parser.c | ||
@@ -2015,6 +2015,8 @@ static NTSTATUS wg_parser_connect(void *args) | ||
@@ -1872,6 +1872,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); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
From 3aaef1bb825952738a1bc3b4b4dea77abd75c8b4 Mon Sep 17 00:00:00 2001 | ||
From 5126ef2fd83557b3a6a0886d577809607ebae4e9 Mon Sep 17 00:00:00 2001 | ||
From: Torge Matthies <[email protected]> | ||
Date: Wed, 31 Jan 2024 17:42:55 +0100 | ||
Subject: [PATCH 09/29] winegstreamer: Set base time on wg_parser bin while | ||
Subject: [PATCH 07/32] winegstreamer: Set base time on wg_parser bin while | ||
connecting. | ||
|
||
--- | ||
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 696c24d0059..886f3420119 100644 | ||
index f4ec803f14f..f2570211ffd 100644 | ||
--- a/dlls/winegstreamer/wg_parser.c | ||
+++ b/dlls/winegstreamer/wg_parser.c | ||
@@ -1980,6 +1980,7 @@ static NTSTATUS wg_parser_connect(void *args) | ||
@@ -1837,6 +1837,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; | ||
+ GstClock *clock; | ||
unsigned int i; | ||
int ret; | ||
|
||
@@ -2015,7 +2016,8 @@ static NTSTATUS wg_parser_connect(void *args) | ||
@@ -1872,7 +1873,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 +30,7 @@ index 696c24d0059..886f3420119 100644 | |
|
||
parser->start_offset = parser->next_offset = parser->stop_offset = 0; | ||
parser->next_pull_offset = 0; | ||
@@ -2024,6 +2026,7 @@ static NTSTATUS wg_parser_connect(void *args) | ||
@@ -1881,6 +1883,7 @@ static NTSTATUS wg_parser_connect(void *args) | ||
if (!parser->init_gst(parser)) | ||
goto out; | ||
|
||
|
32 changes: 32 additions & 0 deletions
32
patches/wine-gst/0008-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 4731071325d686ecf35913f071f74081803d082c Mon Sep 17 00:00:00 2001 | ||
From: Torge Matthies <[email protected]> | ||
Date: Wed, 31 Jan 2024 17:42:55 +0100 | ||
Subject: [PATCH 08/32] 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. | ||
--- | ||
dlls/winegstreamer/wg_parser.c | 7 +++++++ | ||
1 file changed, 7 insertions(+) | ||
|
||
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c | ||
index f2570211ffd..f77330a1410 100644 | ||
--- a/dlls/winegstreamer/wg_parser.c | ||
+++ b/dlls/winegstreamer/wg_parser.c | ||
@@ -1901,6 +1901,13 @@ static NTSTATUS wg_parser_connect(void *args) | ||
|
||
pthread_mutex_lock(&parser->mutex); | ||
|
||
+ if (parser->uri) | ||
+ { | ||
+ gst_element_set_state(parser->container, GST_STATE_PLAYING); | ||
+ ret = gst_element_get_state(parser->container, NULL, NULL, -1); | ||
+ if (ret == GST_STATE_CHANGE_FAILURE) | ||
+ goto out; | ||
+ } | ||
while (!parser_no_more_pads(parser) && !parser->error) | ||
pthread_cond_wait(&parser->init_cond, &parser->mutex); | ||
if (parser->error) | ||
-- | ||
2.44.0 | ||
|
Oops, something went wrong.