Commit 80334dc8 authored by Youness Alaoui's avatar Youness Alaoui

Add nice_agent_get_selected_pair API to NiceAgent

parent 4b835a81
......@@ -2843,6 +2843,32 @@ nice_agent_set_selected_pair (
return ret;
}
NICEAPI_EXPORT gboolean
nice_agent_get_selected_pair (NiceAgent *agent, guint stream_id,
guint component_id, NiceCandidate **local, NiceCandidate **remote)
{
Component *component;
Stream *stream;
gboolean ret = FALSE;
agent_lock();
/* step: check that params specify an existing pair */
if (!agent_find_component (agent, stream_id, component_id,
&stream, &component))
goto done;
if (component->selected_pair.local && component->selected_pair.remote) {
*local = component->selected_pair.local;
*remote = component->selected_pair.remote;
ret = TRUE;
}
done:
agent_unlock();
return ret;
}
GSource* agent_timeout_add_with_context (NiceAgent *agent, guint interval,
GSourceFunc function, gpointer data)
......
......@@ -689,6 +689,27 @@ nice_agent_set_selected_pair (
const gchar *lfoundation,
const gchar *rfoundation);
/**
* nice_agent_get_selected_pair:
* @agent: The #NiceAgent Object
* @stream_id: The ID of the stream
* @component_id: The ID of the component
* @local: The local selected candidate
* @remote: The remote selected candidate
*
* Retreive the selected candidate pair for media transmission
* for a given stream's component.
*
* Returns: %TRUE on success, %FALSE if there is no selected candidate pair
*/
gboolean
nice_agent_get_selected_pair (
NiceAgent *agent,
guint stream_id,
guint component_id,
NiceCandidate **local,
NiceCandidate **remote);
/**
* nice_agent_set_selected_remote_candidate:
* @agent: The #NiceAgent Object
......
......@@ -21,6 +21,7 @@ nice_agent_gather_candidates
nice_agent_get_local_candidates
nice_agent_get_local_credentials
nice_agent_get_remote_candidates
nice_agent_get_selected_pair
nice_agent_get_type
nice_agent_new
nice_agent_new_reliable
......
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