Commit e6b4f9cf authored by Dafydd Harries's avatar Dafydd Harries

add component ID parameter to media recv callback

darcs-hash:20070125171756-c9803-25d4c93a98e158e519376b6436da93986fb663b5.gz
parent 45b389f3
...@@ -95,7 +95,8 @@ struct _stream ...@@ -95,7 +95,8 @@ struct _stream
guint id; guint id;
/* XXX: streams can have multiple components */ /* XXX: streams can have multiple components */
Component *component; Component *component;
void (*handle_recv) (Agent *agent, guint stream_id, guint len, gchar *buf); void (*handle_recv) (
Agent *agent, guint stream_id, guint component_id, guint len, gchar *buf);
}; };
...@@ -281,7 +282,8 @@ guint ...@@ -281,7 +282,8 @@ guint
ice_agent_add_stream ( ice_agent_add_stream (
Agent *agent, Agent *agent,
MediaType type, MediaType type,
void (*handle_recv) (Agent *agent, guint stream_id, guint len, gchar *buf)) void (*handle_recv) (
Agent *agent, guint stream_id, guint component_id, guint len, gchar *buf))
{ {
Stream *stream; Stream *stream;
GSList *i; GSList *i;
...@@ -447,7 +449,8 @@ ice_agent_recv ( ...@@ -447,7 +449,8 @@ ice_agent_recv (
/* XXX: should a NULL data handler be permitted? */ /* XXX: should a NULL data handler be permitted? */
g_assert (stream->handle_recv != NULL); g_assert (stream->handle_recv != NULL);
stream->handle_recv (agent, candidate->stream_id, len, buf); stream->handle_recv (agent, candidate->stream_id,
candidate->component_id, len, buf);
} }
else if ((buf[0] & 0xc0) == 0) else if ((buf[0] & 0xc0) == 0)
{ {
......
...@@ -116,7 +116,8 @@ guint ...@@ -116,7 +116,8 @@ guint
ice_agent_add_stream ( ice_agent_add_stream (
Agent *agent, Agent *agent,
MediaType type, MediaType type,
void (*handle_recv) (Agent *agent, guint stream_id, guint len, gchar *buf)); void (*handle_recv) (
Agent *agent, guint stream_id, guint component_id, guint len, gchar *buf));
void void
ice_agent_free (Agent *agent); ice_agent_free (Agent *agent);
void void
......
...@@ -8,7 +8,12 @@ ...@@ -8,7 +8,12 @@
#include <agent.h> #include <agent.h>
void void
handle_recv (Agent *agent, guint stream_id, guint len, gchar *buf) handle_recv (
Agent *agent,
guint stream_id,
guint component_id,
guint len,
gchar *buf)
{ {
g_assert_not_reached (); g_assert_not_reached ();
} }
......
...@@ -13,10 +13,16 @@ ...@@ -13,10 +13,16 @@
static gboolean cb_called = FALSE; static gboolean cb_called = FALSE;
void void
handle_recv (Agent *agent, guint stream_id, guint len, gchar *buf) handle_recv (
Agent *agent,
guint stream_id,
guint component_id,
guint len,
gchar *buf)
{ {
g_assert (cb_called == FALSE); g_assert (cb_called == FALSE);
g_assert (stream_id == 1); g_assert (stream_id == 1);
g_assert (component_id == 1);
g_assert (len == 7); g_assert (len == 7);
g_assert (0 == strncmp (buf, "\x80lalala", 7)); g_assert (0 == strncmp (buf, "\x80lalala", 7));
cb_called = TRUE; cb_called = TRUE;
......
...@@ -12,7 +12,12 @@ ...@@ -12,7 +12,12 @@
#include <agent.h> #include <agent.h>
void void
handle_recv (Agent *agent, guint stream_id, guint len, gchar *buf) handle_recv (
Agent *agent,
guint stream_id,
guint component_id,
guint len,
gchar *buf)
{ {
g_assert_not_reached (); g_assert_not_reached ();
} }
......
...@@ -9,7 +9,12 @@ ...@@ -9,7 +9,12 @@
#include <agent.h> #include <agent.h>
void void
handle_recv (Agent *agent, guint stream_id, guint len, gchar *buf) handle_recv (
Agent *agent,
guint stream_id,
guint component_id,
guint len,
gchar *buf)
{ {
g_assert_not_reached (); g_assert_not_reached ();
} }
......
...@@ -14,7 +14,12 @@ ...@@ -14,7 +14,12 @@
#include <util.h> #include <util.h>
static void static void
handle_recv (Agent *agent, guint stream_id, guint len, gchar *buf) handle_recv (
Agent *agent,
guint stream_id,
guint component_id,
guint len,
gchar *buf)
{ {
g_debug ("got media"); g_debug ("got media");
} }
......
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