Commit c95c57e2 authored by Olivier Crête's avatar Olivier Crête

agent: Add function to retrieve the current component state

parent 8b5528a1
...@@ -5866,3 +5866,20 @@ agent_socket_send (NiceSocket *sock, const NiceAddress *addr, gsize len, ...@@ -5866,3 +5866,20 @@ agent_socket_send (NiceSocket *sock, const NiceAddress *addr, gsize len,
return ret; return ret;
} }
} }
NiceComponentState
nice_agent_get_component_state (NiceAgent *agent,
guint stream_id, guint component_id)
{
NiceComponentState state = NICE_COMPONENT_STATE_FAILED;
Component *component;
agent_lock ();
if (agent_find_component (agent, stream_id, component_id, NULL, &component))
state = component->state;
agent_unlock ();
return state;
}
...@@ -1487,6 +1487,24 @@ nice_agent_forget_relays (NiceAgent *agent, ...@@ -1487,6 +1487,24 @@ nice_agent_forget_relays (NiceAgent *agent,
guint stream_id, guint stream_id,
guint component_id); guint component_id);
/**
* nice_agent_get_component_state:
* @agent: The #NiceAgent Object
* @stream_id: The ID of the stream
* @component_id: The ID of the component
*
* Retrieves the current state of a component.
*
* Returns: the #NiceComponentState of the component and
* %NICE_COMPONENT_STATE_FAILED if the component was invalid.
*
* Since: 0.1.7
*/
NiceComponentState
nice_agent_get_component_state (NiceAgent *agent,
guint stream_id,
guint component_id);
G_END_DECLS G_END_DECLS
#endif /* _AGENT_H */ #endif /* _AGENT_H */
......
...@@ -27,6 +27,7 @@ nice_agent_gather_candidates ...@@ -27,6 +27,7 @@ nice_agent_gather_candidates
nice_agent_generate_local_candidate_sdp nice_agent_generate_local_candidate_sdp
nice_agent_generate_local_sdp nice_agent_generate_local_sdp
nice_agent_generate_local_stream_sdp nice_agent_generate_local_stream_sdp
nice_agent_get_component_state
nice_agent_get_default_local_candidate nice_agent_get_default_local_candidate
nice_agent_get_io_stream nice_agent_get_io_stream
nice_agent_get_local_candidates nice_agent_get_local_candidates
......
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