Commit 3be5b428 authored by Philip Withnall's avatar Philip Withnall Committed by Olivier Crête

agent: Eliminate redundant arguments from component_emit_io_callback()

parent 68a9632e
...@@ -1049,10 +1049,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data) ...@@ -1049,10 +1049,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
len = 0; len = 0;
if (len > 0) { if (len > 0) {
gint sid = stream->id; component_emit_io_callback (component, buf, len);
gint cid = component->id;
component_emit_io_callback (component, agent, sid, cid, buf, len);
if (sock == NULL) { if (sock == NULL) {
nice_debug ("PseudoTCP socket got destroyed in readable callback!"); nice_debug ("PseudoTCP socket got destroyed in readable callback!");
break; break;
...@@ -2700,10 +2697,7 @@ nice_agent_g_source_cb ( ...@@ -2700,10 +2697,7 @@ nice_agent_g_source_cb (
ctx->agent, ctx->socket); ctx->agent, ctx->socket);
component_detach_socket_source (component, ctx->socket); component_detach_socket_source (component, ctx->socket);
} else if (len > 0 && component->io_callback) { } else if (len > 0 && component->io_callback) {
gint sid = stream->id; component_emit_io_callback (component, buf, len);
gint cid = component->id;
component_emit_io_callback (component, agent, sid, cid, buf, len);
} }
agent_unlock (); agent_unlock ();
......
...@@ -473,24 +473,29 @@ component_set_io_callback (Component *component, NiceAgentRecvFunc func, ...@@ -473,24 +473,29 @@ component_set_io_callback (Component *component, NiceAgentRecvFunc func,
/* This must be called with the agent lock *held*. */ /* This must be called with the agent lock *held*. */
void void
component_emit_io_callback (Component *component, NiceAgent *agent, component_emit_io_callback (Component *component,
gint stream_id, gint component_id, const guint8 *buf, gsize buf_len) const guint8 *buf, gsize buf_len)
{ {
NiceAgent *agent;
guint stream_id, component_id;
NiceAgentRecvFunc io_callback; NiceAgentRecvFunc io_callback;
gpointer io_user_data; gpointer io_user_data;
g_assert (component != NULL); g_assert (component != NULL);
g_assert (NICE_IS_AGENT (agent));
g_assert (stream_id > 0);
g_assert (component_id > 0);
g_assert (buf != NULL); g_assert (buf != NULL);
g_assert (buf_len > 0); g_assert (buf_len > 0);
g_assert (component->io_callback != NULL); agent = component->agent;
stream_id = component->stream->id;
component_id = component->id;
io_callback = component->io_callback; io_callback = component->io_callback;
io_user_data = component->io_user_data; io_user_data = component->io_user_data;
g_assert (NICE_IS_AGENT (agent));
g_assert (stream_id > 0);
g_assert (component_id > 0);
g_assert (io_callback != NULL);
agent_unlock (); agent_unlock ();
io_callback (agent, stream_id, component_id, io_callback (agent, stream_id, component_id,
......
...@@ -174,8 +174,8 @@ void ...@@ -174,8 +174,8 @@ void
component_set_io_callback (Component *component, NiceAgentRecvFunc func, component_set_io_callback (Component *component, NiceAgentRecvFunc func,
gpointer user_data, GMainContext *context); gpointer user_data, GMainContext *context);
void void
component_emit_io_callback (Component *component, NiceAgent *agent, component_emit_io_callback (Component *component,
gint stream_id, gint component_id, const guint8 *buf, gsize buf_len); const guint8 *buf, gsize buf_len);
G_END_DECLS G_END_DECLS
......
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