Skip to content

Commit

Permalink
update rtsp
Browse files Browse the repository at this point in the history
  • Loading branch information
SpookySkeletons committed Feb 23, 2024
1 parent cba63a7 commit 7021039
Show file tree
Hide file tree
Showing 19 changed files with 588 additions and 68 deletions.
6 changes: 5 additions & 1 deletion patches/protonprep-valve-staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,11 @@
patch -Np1 < ../patches/wine-gst/0011-winegstreamer-Reorder-parser-initialization-code-a-b.patch
patch -Np1 < ../patches/wine-gst/0012-winegstreamer-Temporarily-put-pipeline-into-PLAYING-.patch
patch -Np1 < ../patches/wine-gst/0013-winegstreamer-Convert-buffer-presentation-timestamps.patch
patch -Np1 < ../patches/wine-gst/0014-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch
patch -Np1 < ../patches/wine-gst/0015-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch
patch -Np1 < ../patches/wine-gst/0016-winegstreamer-Schedule-stored-timers-for-the-origina.patch
patch -Np1 < ../patches/wine-gst/0017-winegstreamer-Start-forwarding-samples-only-at-the-P.patch
patch -Np1 < ../patches/wine-gst/0018-winegstreamer-HACK-Pretend-that-we-have-a-discontinu.patch
patch -Np1 < ../patches/wine-gst/0019-fixup-winegstreamer-Pass-all-uridecodebin-output-str.patch


popd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0d3f838b2747c070edea39d77188b717868abc9d Mon Sep 17 00:00:00 2001
From 157615fd20d43eb35e7620d0a4b3a22f619c6247 Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:54 +0100
Subject: [PATCH 01/13] winegstreamer: Unlock media source while waiting for a
Subject: [PATCH 01/19] winegstreamer: Unlock media source while waiting for a
sample in the new implementation too.

---
Expand Down Expand Up @@ -40,5 +40,5 @@ index 3cb57e94384..776c74888f7 100644

static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result)
--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7b8556074b4fdd7633f91651d8656008b35c9f04 Mon Sep 17 00:00:00 2001
From 9c975b729cfd2b910c49805f9cdaf4ac7ec5c629 Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:54 +0100
Subject: [PATCH 02/13] winegstreamer: Wait for samples in a dedicated work
Subject: [PATCH 02/19] winegstreamer: Wait for samples in a dedicated work
queue.

---
Expand Down Expand Up @@ -131,5 +131,5 @@ index b76809f794a..69950ce25ff 100644
MFUnlockWorkQueue(object->async_commands_queue);
if (object->event_queue)
--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From edfc8f36bd4cc51a5487efba322d838ce3378638 Mon Sep 17 00:00:00 2001
From 2b4b7965f622d270533b0becdc239e82ef2d85d8 Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:54 +0100
Subject: [PATCH 03/13] winegstreamer: Add a resampler to wg_parser for raw
Subject: [PATCH 03/19] winegstreamer: Add a resampler to wg_parser for raw
audio.

---
Expand All @@ -24,5 +24,5 @@ index 456112affe7..8c2012e8602 100644
if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink))
goto out;
--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
From 2ca3ab16b6e607091721e778b1b0cede73c6a8f8 Mon Sep 17 00:00:00 2001
From 871baef7dc527772612a0928fdaed028440cd77d Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:54 +0100
Subject: [PATCH 04/13] winegstreamer: Add a videoscale element to wg_parser
Subject: [PATCH 04/19] winegstreamer: Add a videoscale element to wg_parser
for raw video.

---
dlls/winegstreamer/wg_parser.c | 5 +++++
1 file changed, 5 insertions(+)
dlls/winegstreamer/wg_parser.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index 8c2012e8602..1f21c7258a6 100644
index 8c2012e8602..f6a44232e23 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -1018,6 +1018,11 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
@@ -938,6 +938,9 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
if (!(element = create_element("glcolorconvert", "base"))
|| !append_element(parser->container, element, &first, &last))
goto out;
+ if (!(element = create_element("glcolorscale", "base"))
+ || !append_element(parser->container, element, &first, &last))
+ goto out;
if (!(element = create_element("gldownload", "base"))
|| !append_element(parser->container, element, &first, &last))
goto out;
@@ -1018,6 +1021,11 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
|| !append_element(parser->container, element, &first, &last))
goto out;

Expand All @@ -25,5 +35,5 @@ index 8c2012e8602..1f21c7258a6 100644
goto out;
}
--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cf12d2c8bb800cda2613d09f13333fd50fbf0772 Mon Sep 17 00:00:00 2001
From 1c23e89e7895af62ace8584dfe568ad967c35b1c Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:54 +0100
Subject: [PATCH 05/13] winegstreamer: Do away with the per-stream condvars and
Subject: [PATCH 05/19] winegstreamer: Do away with the per-stream condvars and
use one parser-wide condvar instead.

This is required because the next commit checks conditions on all streams.
Expand All @@ -10,7 +10,7 @@ This is required because the next commit checks conditions on all streams.
1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index 1f21c7258a6..7667ed7aa05 100644
index f6a44232e23..21bc5cc0ebe 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -80,6 +80,7 @@ struct wg_parser
Expand Down Expand Up @@ -112,7 +112,7 @@ index 1f21c7258a6..7667ed7aa05 100644
for (i = 0; i < ARRAY_SIZE(stream->tags); ++i)
{
if (stream->tags[i])
@@ -1670,10 +1664,8 @@ static NTSTATUS wg_parser_disconnect(void *args)
@@ -1673,10 +1667,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)
Expand All @@ -124,7 +124,7 @@ index 1f21c7258a6..7667ed7aa05 100644
pthread_mutex_unlock(&parser->mutex);

gst_element_set_state(parser->container, GST_STATE_NULL);
@@ -1864,6 +1856,7 @@ static NTSTATUS wg_parser_create(void *args)
@@ -1867,6 +1859,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);
Expand All @@ -133,5 +133,5 @@ index 1f21c7258a6..7667ed7aa05 100644
parser->err_on = params->err_on;
parser->warn_on = params->warn_on;
--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From fcb588b170ea3ca4c464ff1784d08740c1b90d86 Mon Sep 17 00:00:00 2001
From 03e4ecc250d93907a76645b905f1e147d4b7657c Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:54 +0100
Subject: [PATCH 06/13] winegstreamer: Implement buffering in wg_parser.
Subject: [PATCH 06/19] winegstreamer: Implement buffering in wg_parser.

Buffer up to 64 buffers, 5 seconds, or while behind other streams.

Expand All @@ -11,7 +11,7 @@ TODO: Adjust buffering conditions so that it will not buffer endlessly.
1 file changed, 113 insertions(+), 8 deletions(-)

diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index 7667ed7aa05..ab9f156d329 100644
index 21bc5cc0ebe..f70d357cb90 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -110,6 +110,8 @@ struct wg_parser_stream
Expand Down Expand Up @@ -187,5 +187,5 @@ index 7667ed7aa05..ab9f156d329 100644
for (i = 0; i < ARRAY_SIZE(stream->tags); ++i)
{
--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 4cce2788b973de2a9c8386a255839b4e5cd7d216 Mon Sep 17 00:00:00 2001
From 4d64d1e52dc003c4a847fbbec57fe61cfe0824b9 Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:54 +0100
Subject: [PATCH 07/13] winegstreamer: Add more RTSP-based formats to GStreamer
Subject: [PATCH 07/19] winegstreamer: Add more RTSP-based formats to GStreamer
scheme handler.

---
Expand Down Expand Up @@ -52,5 +52,5 @@ index c50d3a05747..d0c0265f65a 100644
}
}
--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From c41340fe4f0d8c1c0032a1f76ccf36ecc4d420d9 Mon Sep 17 00:00:00 2001
From 3b3eaa91ece1ca5200f318b7ff0153d8b4c54f1f Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:54 +0100
Subject: [PATCH 08/13] winegstreamer: Pass all uridecodebin output streams
Subject: [PATCH 08/19] winegstreamer: Pass all uridecodebin output streams
through a multiqueue.

---
dlls/winegstreamer/wg_parser.c | 91 +++++++++++++++++++++++++++++++++-
1 file changed, 90 insertions(+), 1 deletion(-)

diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index ab9f156d329..d33d39f1c6e 100644
index f70d357cb90..b7d6273243f 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -62,7 +62,7 @@ struct wg_parser
Expand Down Expand Up @@ -98,7 +98,7 @@ index ab9f156d329..d33d39f1c6e 100644
static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
{
GstElement *first = NULL, *last = NULL;
@@ -1041,6 +1111,9 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
@@ -1044,6 +1114,9 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
|| !append_element(parser->container, element, &first, &last))
goto out;

Expand All @@ -108,7 +108,7 @@ index ab9f156d329..d33d39f1c6e 100644
if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink))
goto out;
}
@@ -1122,6 +1195,9 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
@@ -1125,6 +1198,9 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
|| !append_element(parser->container, element, &first, &last))
goto out;

Expand All @@ -118,7 +118,7 @@ index ab9f156d329..d33d39f1c6e 100644
if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink))
goto out;
}
@@ -1139,6 +1215,9 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
@@ -1142,6 +1218,9 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
|| !append_element(parser->container, element, &first, &last))
goto out;

Expand All @@ -128,7 +128,7 @@ index ab9f156d329..d33d39f1c6e 100644
if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink))
goto out;
}
@@ -1829,6 +1908,16 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser)
@@ -1832,6 +1911,16 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser)
{
GstElement *element;

Expand All @@ -146,5 +146,5 @@ index ab9f156d329..d33d39f1c6e 100644
return FALSE;

--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ac4013c490bab6210aa92697e8dd6c101c1b5c10 Mon Sep 17 00:00:00 2001
From dd660aa08ed5f8e2b2c01c313d7322578204af70 Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:55 +0100
Subject: [PATCH 09/13] winegstreamer: Set a clock for the wg_parser pipeline.
Subject: [PATCH 09/19] 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.
Expand All @@ -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 d33d39f1c6e..e91fbf2bdf8 100644
index b7d6273243f..4f863d40bfc 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -1685,6 +1685,8 @@ static NTSTATUS wg_parser_connect(void *args)
@@ -1688,6 +1688,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);

Expand All @@ -23,5 +23,5 @@ index d33d39f1c6e..e91fbf2bdf8 100644
parser->next_pull_offset = 0;
parser->error = false;
--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
From 355492406f6401f270441d8f3b9ab7f7e3093194 Mon Sep 17 00:00:00 2001
From 05993457227e1e9aa4f7018bddfb152d122efd43 Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:55 +0100
Subject: [PATCH 10/13] winegstreamer: Set base time on wg_parser bin while
Subject: [PATCH 10/19] 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 e91fbf2bdf8..2ccfcdc909f 100644
index 4f863d40bfc..fef8ae883b3 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -1652,6 +1652,7 @@ static NTSTATUS wg_parser_connect(void *args)
@@ -1655,6 +1655,7 @@ static NTSTATUS wg_parser_connect(void *args)
struct wg_parser *parser = params->parser;
const WCHAR *uri = params->uri;
bool use_mediaconv = false;
+ GstClock *clock;
unsigned int i;
int ret;

@@ -1685,7 +1686,8 @@ static NTSTATUS wg_parser_connect(void *args)
@@ -1688,7 +1689,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);

Expand All @@ -30,7 +30,7 @@ index e91fbf2bdf8..2ccfcdc909f 100644

parser->start_offset = parser->next_offset = parser->stop_offset = 0;
parser->next_pull_offset = 0;
@@ -1694,6 +1696,7 @@ static NTSTATUS wg_parser_connect(void *args)
@@ -1697,6 +1699,7 @@ static NTSTATUS wg_parser_connect(void *args)
if (!parser->init_gst(parser))
goto out;

Expand All @@ -39,5 +39,5 @@ index e91fbf2bdf8..2ccfcdc909f 100644
ret = gst_element_get_state(parser->container, NULL, NULL, -1);

--
2.43.0
2.43.2

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
From 7810ab1a86de8824f910d2ca746bfa58ffbb28ec Mon Sep 17 00:00:00 2001
From 1afb6753faa32efe1aa1d49b716b6e7fc4ccd34a Mon Sep 17 00:00:00 2001
From: Torge Matthies <[email protected]>
Date: Wed, 31 Jan 2024 17:42:55 +0100
Subject: [PATCH 11/13] winegstreamer: Reorder parser initialization code a bit
Subject: [PATCH 11/19] winegstreamer: Reorder parser initialization code a bit
to prevent race conditions.

---
dlls/winegstreamer/wg_parser.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index 2ccfcdc909f..64ebc5f42a8 100644
index fef8ae883b3..f9f63002df8 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -1891,17 +1891,17 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
@@ -1894,17 +1894,17 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
gst_bin_add(GST_BIN(parser->container), element);
parser->decodebin = element;

Expand All @@ -35,7 +35,7 @@ index 2ccfcdc909f..64ebc5f42a8 100644

if (!link_src_to_element(parser->my_src, element))
return FALSE;
@@ -1929,17 +1929,18 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser)
@@ -1932,17 +1932,18 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser)
gst_bin_add(GST_BIN(parser->container), element);
parser->decodebin = element;

Expand All @@ -60,7 +60,7 @@ index 2ccfcdc909f..64ebc5f42a8 100644

return TRUE;
}
@@ -1953,14 +1954,14 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser)
@@ -1956,14 +1957,14 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser)

gst_bin_add(GST_BIN(parser->container), element);

Expand All @@ -80,5 +80,5 @@ index 2ccfcdc909f..64ebc5f42a8 100644
return FALSE;

--
2.43.0
2.43.2

Loading

0 comments on commit 7021039

Please sign in to comment.