[Pkg-telepathy-commits] [libnice] 221/265: add nice_component_state_to_string()

Simon McVittie smcv at debian.org
Wed May 14 12:05:10 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 bf8ba839a88f253a7e875937c8739ecb069f76b8
Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Wed Apr 23 14:39:59 2014 +0200

    add nice_component_state_to_string()
    
    Nice to make debug logs more friendly to read.
---
 agent/agent.c                               | 12 ++++++------
 agent/agent.h                               | 13 +++++++++++++
 docs/reference/libnice/libnice-sections.txt |  1 +
 nice/libnice.sym                            |  1 +
 win32/vs9/libnice.def                       |  1 +
 5 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/agent/agent.c b/agent/agent.c
index a7a8564..0f60e47 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -1652,8 +1652,8 @@ void agent_signal_new_remote_candidate (NiceAgent *agent, NiceCandidate *candida
       candidate->stream_id, candidate->component_id, candidate->foundation);
 }
 
-static const gchar *
-component_state_to_string (NiceComponentState state)
+NICEAPI_EXPORT const gchar *
+nice_component_state_to_string (NiceComponentState state)
 {
   switch (state)
     {
@@ -1686,16 +1686,16 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
 
   if (agent->reliable && component->tcp == NULL &&
       state != NICE_COMPONENT_STATE_FAILED) {
-    nice_debug ("Agent %p: not changing component state for s%d:%d to %d "
+    nice_debug ("Agent %p: not changing component state for s%d:%d to %s "
         "because pseudo tcp socket does not exist in reliable mode", agent,
-        stream->id, component->id, state);
+        stream->id, component->id, nice_component_state_to_string (state));
     return;
   }
 
   if (component->state != state && state < NICE_COMPONENT_STATE_LAST) {
     nice_debug ("Agent %p : stream %u component %u STATE-CHANGE %s -> %s.", agent,
-        stream_id, component_id, component_state_to_string (component->state),
-        component_state_to_string (state));
+        stream_id, component_id, nice_component_state_to_string (component->state),
+        nice_component_state_to_string (state));
 
     component->state = state;
 
diff --git a/agent/agent.h b/agent/agent.h
index 588100e..eee835c 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -1412,6 +1412,19 @@ nice_agent_get_io_stream (
     guint stream_id,
     guint component_id);
 
+/**
+ * nice_component_state_to_string:
+ * @state: a #NiceComponentState
+ *
+ * Returns a string representation of the state, generally to use in debug
+ * messages.
+ *
+ * Returns: (transfer none): a string representation of @state
+ * Since: UNRELEASED
+ */
+const gchar *
+nice_component_state_to_string (NiceComponentState state);
+
 G_END_DECLS
 
 #endif /* _AGENT_H */
diff --git a/docs/reference/libnice/libnice-sections.txt b/docs/reference/libnice/libnice-sections.txt
index 223dd75..5288625 100644
--- a/docs/reference/libnice/libnice-sections.txt
+++ b/docs/reference/libnice/libnice-sections.txt
@@ -47,6 +47,7 @@ nice_agent_parse_remote_stream_sdp
 nice_agent_parse_remote_candidate_sdp
 nice_agent_get_io_stream
 nice_agent_get_selected_socket
+nice_component_state_to_string
 <SUBSECTION Standard>
 NICE_AGENT
 NICE_IS_AGENT
diff --git a/nice/libnice.sym b/nice/libnice.sym
index d083d9e..d45c29b 100644
--- a/nice/libnice.sym
+++ b/nice/libnice.sym
@@ -55,6 +55,7 @@ nice_agent_set_stream_tos
 nice_candidate_copy
 nice_candidate_free
 nice_candidate_new
+nice_component_state_to_string
 nice_debug_disable
 nice_debug_enable
 nice_interfaces_get_ip_for_interface
diff --git a/win32/vs9/libnice.def b/win32/vs9/libnice.def
index abb7732..1ab1317 100644
--- a/win32/vs9/libnice.def
+++ b/win32/vs9/libnice.def
@@ -53,6 +53,7 @@ nice_agent_set_stream_tos
 nice_candidate_copy
 nice_candidate_free
 nice_candidate_new
+nice_component_state_to_string
 nice_debug_disable
 nice_debug_enable
 nice_interfaces_get_ip_for_interface

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