[Pkg-telepathy-commits] [libnice] 82/265: agent: Add nice_agent_build_io_stream() API

Simon McVittie smcv at debian.org
Wed May 14 12:04:55 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 11f04d6cbd3772f4fafc503b477de6517bab1e68
Author: Philip Withnall <philip.withnall at collabora.co.uk>
Date:   Thu Dec 12 11:49:09 2013 +0000

    agent: Add nice_agent_build_io_stream() API
    
    This allows creation of a NiceIOStream from an existing NiceAgent
    instance.
---
 agent/agent.c                               | 31 +++++++++++++++++++++++++++++
 agent/agent.h                               | 22 ++++++++++++++++++++
 agent/iostream.h                            |  1 -
 docs/reference/libnice/libnice-sections.txt |  1 +
 4 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/agent/agent.c b/agent/agent.c
index 020e60c..231f5b4 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -3826,3 +3826,34 @@ nice_agent_parse_remote_candidate_sdp (NiceAgent *agent, guint stream_id,
 
   return candidate;
 }
+
+/**
+ * nice_agent_build_io_stream:
+ * @agent: A reliable #NiceAgent
+ * @stream_id: The ID of the agent’s stream to wrap
+ * @component_id: The ID of the agent’s component to wrap
+ *
+ * Create a new #NiceIOStream wrapping the given stream/component from @agent,
+ * which must be a reliable #NiceAgent. The given stream/component must be
+ * created using nice_agent_add_stream() before any I/O operations are performed
+ * on the #NiceIOStream.
+ *
+ * Note that if multiple I/O streams are created for a single stream/component,
+ * only one of them may be used at any time.
+ *
+ * Returns: (transfer full): The new #NiceIOStream object
+ *
+ * Since: 0.1.5
+ */
+NICEAPI_EXPORT GIOStream *
+nice_agent_build_io_stream (NiceAgent *agent, guint stream_id,
+    guint component_id)
+{
+  g_return_val_if_fail (NICE_IS_AGENT (agent), NULL);
+  g_return_val_if_fail (stream_id >= 1, NULL);
+  g_return_val_if_fail (component_id >= 1, NULL);
+
+  g_return_val_if_fail (agent->reliable, NULL);
+
+  return nice_io_stream_new (agent, stream_id, component_id);
+}
diff --git a/agent/agent.h b/agent/agent.h
index d888148..f7e808b 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -1113,6 +1113,28 @@ nice_agent_parse_remote_candidate_sdp (
     guint stream_id,
     const gchar *sdp);
 
+/**
+ * nice_agent_build_io_stream:
+ * @agent: A #NiceAgent
+ * @stream_id: The ID of the stream to wrap
+ * @component_id: The ID of the component to wrap
+ *
+ * Build a #GIOStream wrapper around the given stream and component in
+ * @agent. The I/O stream will be valid for as long as @stream_id is valid.
+ *
+ * This function may only be called on reliable #NiceAgents. It is an error to
+ * try and create an I/O stream wrapper for an unreliable stream.
+ *
+ * Returns: (transfer full): A new #GIOStream.
+ *
+ * Since: 0.1.5
+ */
+GIOStream *
+nice_agent_build_io_stream (
+    NiceAgent *agent,
+    guint stream_id,
+    guint component_id);
+
 G_END_DECLS
 
 #endif /* _AGENT_H */
diff --git a/agent/iostream.h b/agent/iostream.h
index 88f42c0..ad5b959 100644
--- a/agent/iostream.h
+++ b/agent/iostream.h
@@ -75,7 +75,6 @@ GType nice_io_stream_get_type (void);
 struct _NiceIOStreamClass
 {
   GIOStreamClass parent_class;
-
 };
 
 struct _NiceIOStream
diff --git a/docs/reference/libnice/libnice-sections.txt b/docs/reference/libnice/libnice-sections.txt
index 57fed70..74fdb24 100644
--- a/docs/reference/libnice/libnice-sections.txt
+++ b/docs/reference/libnice/libnice-sections.txt
@@ -40,6 +40,7 @@ nice_agent_generate_local_candidate_sdp
 nice_agent_parse_remote_sdp
 nice_agent_parse_remote_stream_sdp
 nice_agent_parse_remote_candidate_sdp
+nice_agent_build_io_stream
 <SUBSECTION Standard>
 NICE_AGENT
 NICE_IS_AGENT

-- 
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