Commit 80c10c5c authored by Guillaume Desmottes's avatar Guillaume Desmottes Committed by Youness Alaoui

agent: display NiceComponentState as strings in debug message

https://bugs.freedesktop.org/show_bug.cgi?id=49219
parent 2ac9bb6d
......@@ -1300,6 +1300,30 @@ void agent_signal_new_remote_candidate (NiceAgent *agent, NiceCandidate *candida
candidate->foundation);
}
static const gchar *
component_state_to_string (NiceComponentState state)
{
switch (state)
{
case NICE_COMPONENT_STATE_DISCONNECTED:
return "disconnected";
case NICE_COMPONENT_STATE_GATHERING:
return "gathering";
case NICE_COMPONENT_STATE_CONNECTING:
return "connecting";
case NICE_COMPONENT_STATE_CONNECTED:
return "connected";
case NICE_COMPONENT_STATE_READY:
return "ready";
case NICE_COMPONENT_STATE_FAILED:
return "failed";
case NICE_COMPONENT_STATE_LAST:
break;
}
return "invalid";
}
void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, guint component_id, NiceComponentState state)
{
Component *component;
......@@ -1318,8 +1342,9 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
}
if (component->state != state && state < NICE_COMPONENT_STATE_LAST) {
nice_debug ("Agent %p : stream %u component %u STATE-CHANGE %u -> %u.", agent,
stream_id, component_id, component->state, state);
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));
component->state = state;
......
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