mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
webrtc: handle an ice-lite remote offer
When the remote peer offers an ice-lite SDP, we need to configure our ICE negotiation to be in controlling mode as the peer will not be. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1304>
This commit is contained in:
parent
06f3a0ed2c
commit
67ae885d4c
3 changed files with 25 additions and 7 deletions
|
@ -2756,9 +2756,6 @@ _create_offer_task (GstWebRTCBin * webrtc, const GstStructure * options)
|
|||
|
||||
/* FIXME: pre-emptively setup receiving elements when needed */
|
||||
|
||||
/* XXX: only true for the initial offerer */
|
||||
g_object_set (webrtc->priv->ice, "controller", TRUE, NULL);
|
||||
|
||||
g_list_free (seen_transceivers);
|
||||
|
||||
if (webrtc->priv->last_generated_answer)
|
||||
|
@ -4465,7 +4462,25 @@ _set_description_task (GstWebRTCBin * webrtc, struct set_description *sd)
|
|||
signalling_state_changed = TRUE;
|
||||
}
|
||||
|
||||
if (webrtc->signaling_state == GST_WEBRTC_SIGNALING_STATE_STABLE) {
|
||||
{
|
||||
gboolean ice_controller = FALSE;
|
||||
|
||||
/* we control ice negotiation if we send the initial offer */
|
||||
ice_controller |=
|
||||
new_signaling_state == GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER
|
||||
&& webrtc->current_remote_description == NULL;
|
||||
/* or, if the remote is an ice-lite peer */
|
||||
ice_controller |= new_signaling_state == GST_WEBRTC_SIGNALING_STATE_STABLE
|
||||
&& webrtc->current_remote_description->type == GST_WEBRTC_SDP_TYPE_OFFER
|
||||
&& _message_has_attribute_key (webrtc->current_remote_description->sdp,
|
||||
"ice-lite");
|
||||
|
||||
GST_DEBUG_OBJECT (webrtc, "we are in ice controlling mode: %s",
|
||||
ice_controller ? "true" : "false");
|
||||
g_object_set (webrtc->priv->ice, "controller", ice_controller, NULL);
|
||||
}
|
||||
|
||||
if (new_signaling_state == GST_WEBRTC_SIGNALING_STATE_STABLE) {
|
||||
GList *tmp;
|
||||
|
||||
/* media modifications */
|
||||
|
|
|
@ -144,9 +144,8 @@ _check_sdp_crypto (SDPSource source, GstWebRTCSessionDescription * sdp,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static gboolean
|
||||
_session_has_attribute_key (const GstSDPMessage * msg, const gchar * key)
|
||||
gboolean
|
||||
_message_has_attribute_key (const GstSDPMessage * msg, const gchar * key)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < gst_sdp_message_attributes_len (msg); i++) {
|
||||
|
@ -159,6 +158,7 @@ _session_has_attribute_key (const GstSDPMessage * msg, const gchar * key)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static gboolean
|
||||
_session_has_attribute_key_value (const GstSDPMessage * msg, const gchar * key,
|
||||
const gchar * value)
|
||||
|
|
|
@ -91,6 +91,9 @@ gboolean _message_media_is_datachannel (con
|
|||
guint media_id);
|
||||
G_GNUC_INTERNAL
|
||||
guint _message_get_datachannel_index (const GstSDPMessage * msg);
|
||||
G_GNUC_INTERNAL
|
||||
gboolean _message_has_attribute_key (const GstSDPMessage * msg,
|
||||
const gchar * key);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
gboolean _get_bundle_index (GstSDPMessage * sdp,
|
||||
|
|
Loading…
Reference in a new issue