Commit 5bbed7e4 authored by Olivier Crête's avatar Olivier Crête

agent: Add nice_agent_restart_stream() to restart a single stream

parent 28ab0b50
......@@ -3689,7 +3689,6 @@ nice_agent_get_remote_candidates (
return ret;
}
gboolean
nice_agent_restart (
NiceAgent *agent)
......@@ -3713,6 +3712,32 @@ nice_agent_restart (
return TRUE;
}
gboolean
nice_agent_restart_stream (
NiceAgent *agent,
guint stream_id)
{
gboolean res = FALSE;
Stream *stream;
agent_lock();
stream = agent_find_stream (agent, stream_id);
if (!stream) {
g_warning ("Could not find stream %u", stream_id);
goto done;
}
/* step: reset local credentials for the stream and
* clean up the list of remote candidates */
stream_restart (agent, stream, agent->rng);
res = TRUE;
done:
agent_unlock_and_emit (agent);
return res;
}
static void
nice_agent_dispose (GObject *object)
......
......@@ -787,6 +787,28 @@ gboolean
nice_agent_restart (
NiceAgent *agent);
/**
* nice_agent_restart_stream:
* @agent: The #NiceAgent Object
* @stream_id: The ID of the stream
*
* Restarts a single stream as defined in RFC 5245. This function
* needs to be called both when initiating (ICE spec section 9.1.1.1.
* "ICE Restarts"), as well as when reacting (spec section 9.2.1.1.
* "Detecting ICE Restart") to a restart.
*
* Unlike nice_agent_restart(), this applies to a single stream. It also
* does not generate a new tie breaker.
*
* Returns: %TRUE on success %FALSE on error
*
* Since: 0.1.6
**/
gboolean
nice_agent_restart_stream (
NiceAgent *agent,
guint stream_id);
/**
* nice_agent_attach_recv:
......
......@@ -36,6 +36,7 @@ nice_agent_set_selected_remote_candidate
nice_agent_set_stream_tos
nice_agent_set_software
nice_agent_restart
nice_agent_restart_stream
nice_agent_set_stream_name
nice_agent_get_stream_name
nice_agent_get_default_local_candidate
......
......@@ -41,6 +41,7 @@ nice_agent_parse_remote_sdp
nice_agent_parse_remote_stream_sdp
nice_agent_remove_stream
nice_agent_restart
nice_agent_restart_stream
nice_agent_send
nice_agent_send_messages_nonblocking
nice_agent_set_port_range
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment