Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gstreamer: Include additional patches #73

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 48ae40f477523bed4cd709d163f541e748356071 Mon Sep 17 00:00:00 2001
From 8edcb3957601ba1237d3f60bbfc0f115a614aa75 Mon Sep 17 00:00:00 2001
From: Carlos Bentzen <[email protected]>
Date: Wed, 10 Jul 2024 10:34:19 +0200
Subject: [PATCH] webrtcbin: create and associate transceivers earlier in
Subject: [PATCH 1/9] webrtcbin: create and associate transceivers earlier in
negotation

According to https://w3c.github.io/webrtc-pc/#set-the-session-description
Expand Down Expand Up @@ -31,7 +31,7 @@ Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/71
4 files changed, 388 insertions(+), 240 deletions(-)

diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
index 9b84fa317d..7cb0eb6ffc 100644
index f170f512bf..b4196e3435 100644
--- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
+++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
@@ -748,6 +748,13 @@ transceiver_match_for_mid (GstWebRTCRTPTransceiver * trans, const gchar * mid)
Expand Down Expand Up @@ -69,7 +69,7 @@ index 9b84fa317d..7cb0eb6ffc 100644
typedef gboolean (*FindTransportFunc) (TransportStream * p1,
gconstpointer data);

@@ -4543,146 +4564,51 @@ _create_answer_task (GstWebRTCBin * webrtc, const GstStructure * options,
@@ -4553,146 +4574,51 @@ _create_answer_task (GstWebRTCBin * webrtc, const GstStructure * options,

_remove_optional_offer_fields (offer_caps);

Expand Down Expand Up @@ -660,7 +660,7 @@ index 80d21203c2..abeb5dba33 100644
GstWebRTCRTPTransceiverDirection answer);
G_GNUC_INTERNAL
diff --git a/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c b/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c
index 8fa8eeaf76..1dd2ddf3c2 100644
index 7fa337e9ba..adf5014e02 100644
--- a/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c
+++ b/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c
@@ -50,9 +50,11 @@ typedef enum
Expand Down Expand Up @@ -890,7 +890,7 @@ index 8fa8eeaf76..1dd2ddf3c2 100644

p = gst_promise_new_with_change_func (_on_stats, t, NULL);
g_signal_emit_by_name (t->webrtc1, "get-stats", NULL, p);
@@ -5905,7 +5968,7 @@ GST_START_TEST (test_sdp_session_setup_attribute)
@@ -5955,7 +6018,7 @@ GST_START_TEST (test_sdp_session_setup_attribute)
fail_if (gst_element_set_state (t->webrtc2, GST_STATE_READY) ==
GST_STATE_CHANGE_FAILURE);
test_webrtc_create_offer (t);
Expand All @@ -899,7 +899,7 @@ index 8fa8eeaf76..1dd2ddf3c2 100644

test_webrtc_wait_for_ice_gathering_complete (t);

@@ -5943,6 +6006,7 @@ webrtcbin_suite (void)
@@ -5993,6 +6056,7 @@ webrtcbin_suite (void)
tcase_add_test (tc, test_media_direction);
tcase_add_test (tc, test_add_transceiver);
tcase_add_test (tc, test_get_transceivers);
Expand All @@ -908,5 +908,5 @@ index 8fa8eeaf76..1dd2ddf3c2 100644
tcase_add_test (tc, test_recvonly_sendonly);
tcase_add_test (tc, test_payload_types);
--
2.46.0
2.47.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cad3e63546b17570e284b544afebb5566d75c6d7 Mon Sep 17 00:00:00 2001
From 8615a8ac712bc173c0c3585392683053b7b8ee94 Mon Sep 17 00:00:00 2001
From: Carlos Bentzen <[email protected]>
Date: Fri, 2 Aug 2024 11:19:56 +0200
Subject: [PATCH] webrtcbin: reverse direction from remote media
Subject: [PATCH 2/9] webrtcbin: reverse direction from remote media

This had been overlooked from the spec. We need to reverse
the remote media direction when setting the transceiver direction.
Expand All @@ -12,7 +12,7 @@ Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/72
1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
index 7cb0eb6ffc..6433d123b2 100644
index b4196e3435..5ad6550d88 100644
--- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
+++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
@@ -6280,6 +6280,22 @@ get_last_generated_description (GstWebRTCBin * webrtc, SDPSource source,
Expand Down Expand Up @@ -83,5 +83,5 @@ index 7cb0eb6ffc..6433d123b2 100644
/* Let transport be the RTCDtlsTransport object representing the RTP/RTCP component of the media transport
* used by transceiver's associated media description, according to [RFC8843]. */
--
2.46.0
2.47.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f3bf3ae53c7705823a9179f4df1f279d0342bd63 Mon Sep 17 00:00:00 2001
From cd27befcb7a75a1cca00027a195c1f40aa8f0c26 Mon Sep 17 00:00:00 2001
From: Carlos Bentzen <[email protected]>
Date: Fri, 2 Aug 2024 11:21:13 +0200
Subject: [PATCH] webrtcbin: connect output stream on recv transceivers
Subject: [PATCH 3/9] webrtcbin: connect output stream on recv transceivers

With MR 7156, transceivers and transports are created earlier,
but for sendrecv media we could get `not-linked` errors due to
Expand All @@ -15,14 +15,14 @@ adds a test for this, so that this doesn't regress anymore.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7294>
---
.../gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 6 ++
.../tests/check/elements/webrtcbin.c | 64 +++++++++++++++++++
2 files changed, 70 insertions(+)
.../tests/check/elements/webrtcbin.c | 62 +++++++++++++++++++
2 files changed, 68 insertions(+)

diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
index 8c8a6ab563..6861b50845 100644
index 5ad6550d88..ec8fc47490 100644
--- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
+++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
@@ -6490,6 +6490,12 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
@@ -6500,6 +6500,12 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
webrtc_transceiver_set_transport (wtrans, stream);
}
}
Expand All @@ -36,12 +36,12 @@ index 8c8a6ab563..6861b50845 100644

ret = TRUE;
diff --git a/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c b/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c
index adf5014e02..bb13887422 100644
index adf5014e02..2272943a27 100644
--- a/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c
+++ b/subprojects/gst-plugins-bad/tests/check/elements/webrtcbin.c
@@ -4653,6 +4653,69 @@ a=group:BUNDLE \r\n\

GST_END_TEST;
@@ -4651,6 +4651,67 @@ a=group:BUNDLE \r\n\
test_webrtc_free (t);
}

+GST_START_TEST (test_audio_sendrecv)
+{
Expand Down Expand Up @@ -104,12 +104,10 @@ index adf5014e02..bb13887422 100644
+ test_webrtc_free (t);
+}
+
+GST_END_TEST;
+
GST_END_TEST;
static void
new_jitterbuffer_set_fast_start (GstElement * rtpbin,
GstElement * rtpjitterbuffer, guint session_id, guint ssrc,
@@ -6051,6 +6114,7 @@ webrtcbin_suite (void)
@@ -6051,6 +6112,7 @@ webrtcbin_suite (void)
tcase_add_test (tc, test_session_stats);
tcase_add_test (tc, test_stats_with_stream);
tcase_add_test (tc, test_audio);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From aaf06f221975d4ef771e81438da7179b4b3bdd00 Mon Sep 17 00:00:00 2001
From: Jan Schmidt <[email protected]>
Date: Wed, 24 Jul 2024 20:59:51 +1000
Subject: [PATCH 4/9] webrtc: Fixes for matching pads to unassociated
transceivers

Fix an inverted condition when checking if sink pad caps match
the codec-preference of an unassociated transceiver, and
fix a condition check for transceiver media kind to
avoid matching sinkpad requests where caps aren't provided
against unassociated transceivers where the caps might
not match later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7237>
---
subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
index ec8fc47490..6a9484a2bc 100644
--- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
+++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
@@ -8355,9 +8355,9 @@ gst_webrtc_bin_request_new_pad (GstElement * element, GstPadTemplate * templ,
GstWebRTCBinPad *pad2;
gboolean has_matching_caps;

- /* Ignore transceivers with a non-matching kind */
+ /* Ignore transceivers with a non-matching kind or where we don't know the kind we want */
if (tmptrans->kind != GST_WEBRTC_KIND_UNKNOWN &&
- kind != GST_WEBRTC_KIND_UNKNOWN && tmptrans->kind != kind)
+ (kind == GST_WEBRTC_KIND_UNKNOWN || tmptrans->kind != kind))
continue;

/* Ignore stopped transmitters */
@@ -8379,7 +8379,7 @@ gst_webrtc_bin_request_new_pad (GstElement * element, GstPadTemplate * templ,

GST_OBJECT_LOCK (tmptrans);
has_matching_caps = (caps && tmptrans->codec_preferences &&
- !gst_caps_can_intersect (caps, tmptrans->codec_preferences));
+ gst_caps_can_intersect (caps, tmptrans->codec_preferences));
GST_OBJECT_UNLOCK (tmptrans);
/* Ignore transceivers with non-matching caps */
if (!has_matching_caps)
--
2.47.0

Loading