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

Bump to GStreamer 1.24.11 #88

Merged
merged 1 commit into from
Jan 21, 2025
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 8edcb3957601ba1237d3f60bbfc0f115a614aa75 Mon Sep 17 00:00:00 2001
From e194b6bb173a95dcfb84c328fff426e60e6ab8f9 Mon Sep 17 00:00:00 2001
From: Carlos Bentzen <cadubentzen@igalia.com>
Date: Wed, 10 Jul 2024 10:34:19 +0200
Subject: [PATCH 1/9] webrtcbin: create and associate transceivers earlier in
Subject: [PATCH 1/8] webrtcbin: create and associate transceivers earlier in
negotation

According to https://w3c.github.io/webrtc-pc/#set-the-session-description
Expand All @@ -24,14 +24,14 @@ associated after every session description is set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7156>
---
.../gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 495 ++++++++++--------
.../gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 477 +++++++++++-------
.../gst-plugins-bad/ext/webrtc/webrtcsdp.c | 11 +
.../gst-plugins-bad/ext/webrtc/webrtcsdp.h | 2 +
.../tests/check/elements/webrtcbin.c | 120 ++++-
4 files changed, 388 insertions(+), 240 deletions(-)
4 files changed, 388 insertions(+), 222 deletions(-)

diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
index f170f512bf..b4196e3435 100644
index dce4820a6d..225d246576 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 @@ -169,8 +169,8 @@ index f170f512bf..b4196e3435 100644
- }
- rtp_trans = NULL;
- }
}
- }
-
- if (rtp_trans) {
- answer_dir = rtp_trans->direction;
- g_assert (answer_caps != NULL);
Expand All @@ -180,8 +180,8 @@ index f170f512bf..b4196e3435 100644
- answer_dir = GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY;
- GST_WARNING_OBJECT (webrtc, "did not find compatible transceiver for "
- "offer caps %" GST_PTR_FORMAT ", will only receive", offer_caps);
- }
-
}
- if (!rtp_trans) {
- GstCaps *trans_caps;
- GstWebRTCKind kind = GST_WEBRTC_KIND_UNKNOWN;
Expand Down Expand Up @@ -253,40 +253,15 @@ index f170f512bf..b4196e3435 100644
}
}

@@ -6079,24 +6006,6 @@ _update_data_channel_from_sdp_media (GstWebRTCBin * webrtc,
transport_receive_bin_set_receive_state (receive, RECEIVE_STATE_PASS);
}

-static gboolean
-_find_compatible_unassociated_transceiver (GstWebRTCRTPTransceiver * p1,
- gconstpointer data)
-{
- GstWebRTCKind kind = GPOINTER_TO_INT (data);
-
- if (p1->mid)
- return FALSE;
- if (p1->mline != -1)
- return FALSE;
- if (p1->stopped)
- return FALSE;
- if (p1->kind != GST_WEBRTC_KIND_UNKNOWN && p1->kind != kind)
- return FALSE;
-
- return TRUE;
-}
-
static void
_connect_rtpfunnel (GstWebRTCBin * webrtc, guint session_id)
{
@@ -6179,7 +6088,6 @@ _update_transceivers_from_sdp (GstWebRTCBin * webrtc, SDPSource source,
@@ -6185,7 +6112,6 @@ _update_transceivers_from_sdp (GstWebRTCBin * webrtc, SDPSource source,
for (i = 0; i < gst_sdp_message_medias_len (sdp->sdp); i++) {
const GstSDPMedia *media = gst_sdp_message_get_media (sdp->sdp, i);
TransportStream *stream;
- GstWebRTCRTPTransceiver *trans;
guint transport_idx;

/* skip rejected media */
@@ -6191,8 +6099,6 @@ _update_transceivers_from_sdp (GstWebRTCBin * webrtc, SDPSource source,
@@ -6197,8 +6123,6 @@ _update_transceivers_from_sdp (GstWebRTCBin * webrtc, SDPSource source,
else
transport_idx = i;

Expand All @@ -295,7 +270,7 @@ index f170f512bf..b4196e3435 100644
stream = _get_or_create_transport_stream (webrtc, transport_idx,
_message_media_is_datachannel (sdp->sdp, transport_idx));
if (!bundled) {
@@ -6203,60 +6109,28 @@ _update_transceivers_from_sdp (GstWebRTCBin * webrtc, SDPSource source,
@@ -6209,60 +6133,28 @@ _update_transceivers_from_sdp (GstWebRTCBin * webrtc, SDPSource source,
ensure_rtx_hdr_ext (stream);
}

Expand All @@ -310,10 +285,7 @@ index f170f512bf..b4196e3435 100644
- if (g_strcmp0 (gst_sdp_media_get_media (media), "audio") == 0 ||
- g_strcmp0 (gst_sdp_media_get_media (media), "video") == 0) {
- GstWebRTCKind kind = GST_WEBRTC_KIND_UNKNOWN;
+ if (g_strcmp0 (gst_sdp_media_get_media (media), "audio") == 0 ||
+ g_strcmp0 (gst_sdp_media_get_media (media), "video") == 0) {
+ GstWebRTCRTPTransceiver *trans;

-
- /* No existing transceiver, find an unused one */
- if (!trans) {
- if (g_strcmp0 (gst_sdp_media_get_media (media), "audio") == 0)
Expand Down Expand Up @@ -343,7 +315,10 @@ index f170f512bf..b4196e3435 100644
- gst_webrtc_bin_signals[ON_NEW_TRANSCEIVER_SIGNAL], 0, trans);
- PC_LOCK (webrtc);
- }
-
+ if (g_strcmp0 (gst_sdp_media_get_media (media), "audio") == 0 ||
+ g_strcmp0 (gst_sdp_media_get_media (media), "video") == 0) {
+ GstWebRTCRTPTransceiver *trans;

- _update_transceiver_from_sdp_media (webrtc, sdp->sdp, i, stream,
- trans, bundled, bundle_idx, error);
- if (error && *error)
Expand Down Expand Up @@ -376,7 +351,7 @@ index f170f512bf..b4196e3435 100644
}
}

@@ -6406,6 +6280,210 @@ get_last_generated_description (GstWebRTCBin * webrtc, SDPSource source,
@@ -6412,6 +6304,210 @@ get_last_generated_description (GstWebRTCBin * webrtc, SDPSource source,
return NULL;
}

Expand Down Expand Up @@ -587,7 +562,7 @@ index f170f512bf..b4196e3435 100644

/* http://w3c.github.io/webrtc-pc/#set-description */
static GstStructure *
@@ -6568,21 +6646,8 @@ _set_description_task (GstWebRTCBin * webrtc, struct set_description *sd)
@@ -6574,21 +6670,8 @@ _set_description_task (GstWebRTCBin * webrtc, struct set_description *sd)
}
}

Expand All @@ -611,7 +586,7 @@ index f170f512bf..b4196e3435 100644

if (webrtc->signaling_state != new_signaling_state) {
webrtc->signaling_state = new_signaling_state;
@@ -6642,6 +6707,12 @@ _set_description_task (GstWebRTCBin * webrtc, struct set_description *sd)
@@ -6648,6 +6731,12 @@ _set_description_task (GstWebRTCBin * webrtc, struct set_description *sd)
continue;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8615a8ac712bc173c0c3585392683053b7b8ee94 Mon Sep 17 00:00:00 2001
From 2e69c18ecb12a66ce92f7e3c591343916856c1b1 Mon Sep 17 00:00:00 2001
From: Carlos Bentzen <cadubentzen@igalia.com>
Date: Fri, 2 Aug 2024 11:19:56 +0200
Subject: [PATCH 2/9] webrtcbin: reverse direction from remote media
Subject: [PATCH 2/8] 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,10 +12,10 @@ 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 b4196e3435..5ad6550d88 100644
index 225d246576..bc5ebb1909 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,
@@ -6304,6 +6304,22 @@ get_last_generated_description (GstWebRTCBin * webrtc, SDPSource source,
return NULL;
}

Expand All @@ -38,7 +38,7 @@ index b4196e3435..5ad6550d88 100644
/* https://w3c.github.io/webrtc-pc/#set-description (steps in 4.6.10.) */
static gboolean
_create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
@@ -6328,12 +6344,14 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
@@ -6352,12 +6368,14 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
const gchar *mid;
guint transport_idx;
TransportStream *stream;
Expand All @@ -53,7 +53,7 @@ index b4196e3435..5ad6550d88 100644

/* XXX: not strictly required but a lot of functionality requires a mid */
if (!mid) {
@@ -6390,8 +6408,6 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
@@ -6414,8 +6432,6 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
* that were added to the PeerConnection by addTrack and are not associated with any "m=" section
* and are not stopped, find the first (according to the canonical order described in Section 5.2.1)
* such RtpTransceiver. */
Expand All @@ -62,7 +62,7 @@ index b4196e3435..5ad6550d88 100644
if (direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV
|| direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY) {
int j;
@@ -6464,11 +6480,18 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
@@ -6488,11 +6504,18 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
trans->mid = g_strdup (mid);
g_object_notify (G_OBJECT (trans), "mid");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cd27befcb7a75a1cca00027a195c1f40aa8f0c26 Mon Sep 17 00:00:00 2001
From 5bd0033bc9683610a74f668e67672fc524628fb2 Mon Sep 17 00:00:00 2001
From: Carlos Bentzen <cadubentzen@igalia.com>
Date: Fri, 2 Aug 2024 11:21:13 +0200
Subject: [PATCH 3/9] webrtcbin: connect output stream on recv transceivers
Subject: [PATCH 3/8] 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 @@ -19,10 +19,10 @@ Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/72
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 5ad6550d88..ec8fc47490 100644
index bc5ebb1909..02652c0362 100644
--- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
+++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
@@ -6500,6 +6500,12 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
@@ -6524,6 +6524,12 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc,
webrtc_transceiver_set_transport (wtrans, stream);
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From aaf06f221975d4ef771e81438da7179b4b3bdd00 Mon Sep 17 00:00:00 2001
From 11d381a3d77848e62189df20ba4e7fe8c9dadd45 Mon Sep 17 00:00:00 2001
From: Jan Schmidt <jan@centricular.com>
Date: Wed, 24 Jul 2024 20:59:51 +1000
Subject: [PATCH 4/9] webrtc: Fixes for matching pads to unassociated
Subject: [PATCH 4/8] webrtc: Fixes for matching pads to unassociated
transceivers

Fix an inverted condition when checking if sink pad caps match
Expand All @@ -17,10 +17,10 @@ Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/72
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
index 02652c0362..6fa560b554 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,
@@ -8379,9 +8379,9 @@ gst_webrtc_bin_request_new_pad (GstElement * element, GstPadTemplate * templ,
GstWebRTCBinPad *pad2;
gboolean has_matching_caps;

Expand All @@ -32,7 +32,7 @@ index ec8fc47490..6a9484a2bc 100644
continue;

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

GST_OBJECT_LOCK (tmptrans);
has_matching_caps = (caps && tmptrans->codec_preferences &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 22e49d68ab4095379df2f0e3fa09ee61f3fb5624 Mon Sep 17 00:00:00 2001
From 8be67d014ff50275ad0dd0a70f81bb93b24033c6 Mon Sep 17 00:00:00 2001
From: Jan Schmidt <jan@centricular.com>
Date: Thu, 1 Aug 2024 13:42:52 +1000
Subject: [PATCH 5/9] webrtcbin: Fix renegotiation checks
Subject: [PATCH 5/8] webrtcbin: Fix renegotiation checks

When checking for renegotiation against a local offer,
reverse the remote direction in the corresponding answer
Expand All @@ -27,7 +27,7 @@ Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/73
2 files changed, 151 insertions(+), 32 deletions(-)

diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
index 6a9484a2bc..d8cf348f99 100644
index 6fa560b554..6fb42da6f4 100644
--- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
+++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
@@ -1772,6 +1772,22 @@ done:
Expand Down Expand Up @@ -109,7 +109,7 @@ index 6a9484a2bc..d8cf348f99 100644
gst_webrtc_rtp_transceiver_direction_to_string (remote_dir));
return TRUE;
}
@@ -6280,22 +6302,6 @@ get_last_generated_description (GstWebRTCBin * webrtc, SDPSource source,
@@ -6304,22 +6326,6 @@ get_last_generated_description (GstWebRTCBin * webrtc, SDPSource source,
return NULL;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e2db93c386bb133ca7e4d3641007771de573695b Mon Sep 17 00:00:00 2001
From 41fa9831893c9ee434840b4d1bf1150ab124f762 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= <francois@centricular.com>
Date: Thu, 7 Mar 2024 17:36:33 +0100
Subject: [PATCH 6/9] webrtc: add all SSRC attributes getting CAPS for a PT
Subject: [PATCH 6/8] webrtc: add all SSRC attributes getting CAPS for a PT

The transport stream only returned the CAPS for the first matching PT entry
from the `ptmap`. Other SSRC with the same PT where not included. For a stream
Expand All @@ -24,7 +24,7 @@ Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/61
3 files changed, 57 insertions(+), 6 deletions(-)

diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
index d8cf348f99..2b920313d6 100644
index 6fb42da6f4..8ac9850a62 100644
--- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
+++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
@@ -5080,6 +5080,8 @@ _set_internal_rtpbin_element_props_from_stream (GstWebRTCBin * webrtc,
Expand All @@ -36,7 +36,7 @@ index d8cf348f99..2b920313d6 100644
}

GST_DEBUG_OBJECT (stream, "setting payload map on %" GST_PTR_FORMAT " : %"
@@ -7562,8 +7564,7 @@ on_rtpbin_request_pt_map (GstElement * rtpbin, guint session_id, guint pt,
@@ -7586,8 +7588,7 @@ on_rtpbin_request_pt_map (GstElement * rtpbin, guint session_id, guint pt,
if (!stream)
goto unknown_session;

Expand Down
Loading