summaryrefslogtreecommitdiff
path: root/agent
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2014-10-05 13:34:22 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2014-10-09 16:26:07 -0400
commitc95c57e2069473825935defdbf02d2831c1979f6 (patch)
tree3340df03d4340acc7b4de33dceec8c906ce8877d /agent
parent8b5528a1b645e5d1c9e12ca498d31978b031566c (diff)
agent: Add function to retrieve the current component state
Diffstat (limited to 'agent')
-rw-r--r--agent/agent.c17
-rw-r--r--agent/agent.h18
2 files changed, 35 insertions, 0 deletions
diff --git a/agent/agent.c b/agent/agent.c
index a11f55b..d17f3d2 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -5866,3 +5866,20 @@ agent_socket_send (NiceSocket *sock, const NiceAddress *addr, gsize len,
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;
+}
diff --git a/agent/agent.h b/agent/agent.h
index da59b45..501933f 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -1487,6 +1487,24 @@ nice_agent_forget_relays (NiceAgent *agent,
guint stream_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
#endif /* _AGENT_H */