diff options
Diffstat (limited to 'agent')
-rw-r--r-- | agent/agent.c | 31 | ||||
-rw-r--r-- | agent/agent.h | 22 | ||||
-rw-r--r-- | agent/iostream.h | 1 |
3 files changed, 53 insertions, 1 deletions
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 |