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