[Pkg-telepathy-commits] [libnice] 233/265: agent: Add nice_agent_restart_stream() to restart a single stream

Simon McVittie smcv at debian.org
Wed May 14 12:05:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository libnice.

commit 5bbed7e436df89c04d05657b510a60867c222e06
Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Tue Apr 15 20:19:18 2014 -0400

    agent: Add nice_agent_restart_stream() to restart a single stream
---
 agent/agent.c                               | 27 ++++++++++++++++++++++++++-
 agent/agent.h                               | 22 ++++++++++++++++++++++
 docs/reference/libnice/libnice-sections.txt |  1 +
 nice/libnice.sym                            |  1 +
 4 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/agent/agent.c b/agent/agent.c
index 09e9d9d..c60ca47 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -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)
diff --git a/agent/agent.h b/agent/agent.h
index eee835c..8ffa3a0 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -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:
diff --git a/docs/reference/libnice/libnice-sections.txt b/docs/reference/libnice/libnice-sections.txt
index 5288625..edbdeef 100644
--- a/docs/reference/libnice/libnice-sections.txt
+++ b/docs/reference/libnice/libnice-sections.txt
@@ -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
diff --git a/nice/libnice.sym b/nice/libnice.sym
index d45c29b..b2c92ca 100644
--- a/nice/libnice.sym
+++ b/nice/libnice.sym
@@ -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git



More information about the Pkg-telepathy-commits mailing list