Commit 24bceaa9 authored by Dafydd Harries's avatar Dafydd Harries

make _add_stream take number of components but not callback/callback data

darcs-hash:20070209185348-c9803-ceb078324e8794c152ceb2db09646b723acb3f89.gz
parent 878ca74d
...@@ -214,16 +214,14 @@ nice_agent_add_local_host_candidate ( ...@@ -214,16 +214,14 @@ nice_agent_add_local_host_candidate (
guint guint
nice_agent_add_stream ( nice_agent_add_stream (
NiceAgent *agent, NiceAgent *agent,
NiceAgentRecvFunc handle_recv, guint n_components)
gpointer handle_recv_data)
{ {
Stream *stream; Stream *stream;
GSList *i; GSList *i;
g_assert (n_components == 1);
stream = stream_new (); stream = stream_new ();
stream->id = agent->next_stream_id++; stream->id = agent->next_stream_id++;
stream->handle_recv = handle_recv;
stream->handle_recv_data = handle_recv_data;
agent->streams = g_slist_append (agent->streams, stream); agent->streams = g_slist_append (agent->streams, stream);
/* generate a local host candidate for each local address */ /* generate a local host candidate for each local address */
......
...@@ -43,8 +43,7 @@ nice_agent_add_local_address (NiceAgent *agent, NiceAddress *addr); ...@@ -43,8 +43,7 @@ nice_agent_add_local_address (NiceAgent *agent, NiceAddress *addr);
guint guint
nice_agent_add_stream ( nice_agent_add_stream (
NiceAgent *agent, NiceAgent *agent,
NiceAgentRecvFunc recv_func, guint n_components);
gpointer handle_recv_data);
void void
nice_agent_remove_stream ( nice_agent_remove_stream (
......
...@@ -29,9 +29,9 @@ main (void) ...@@ -29,9 +29,9 @@ main (void)
agent = nice_agent_new (&factory); agent = nice_agent_new (&factory);
nice_agent_add_local_address (agent, &addr); nice_agent_add_local_address (agent, &addr);
g_assert (nice_agent_add_stream (agent, handle_recv, NULL) == 1); g_assert (nice_agent_add_stream (agent, 1) == 1);
g_assert (nice_agent_add_stream (agent, handle_recv, NULL) == 2); g_assert (nice_agent_add_stream (agent, 1) == 2);
g_assert (nice_agent_add_stream (agent, handle_recv, NULL) == 3); g_assert (nice_agent_add_stream (agent, 1) == 3);
g_assert (NULL != agent->streams); g_assert (NULL != agent->streams);
g_assert (NULL != agent->local_candidates); g_assert (NULL != agent->local_candidates);
......
...@@ -44,7 +44,7 @@ main (void) ...@@ -44,7 +44,7 @@ main (void)
nice_udp_fake_socket_factory_init (&factory); nice_udp_fake_socket_factory_init (&factory);
agent = nice_agent_new (&factory); agent = nice_agent_new (&factory);
nice_agent_add_local_address (agent, &addr); nice_agent_add_local_address (agent, &addr);
nice_agent_add_stream (agent, handle_recv, NULL); nice_agent_add_stream (agent, 1);
candidate = agent->local_candidates->data; candidate = agent->local_candidates->data;
sock = &candidate->sock; sock = &candidate->sock;
......
...@@ -29,7 +29,7 @@ main (void) ...@@ -29,7 +29,7 @@ main (void)
agent = nice_agent_new (&factory); agent = nice_agent_new (&factory);
g_assert (nice_address_set_ipv4_from_string (&addr, "192.168.0.1")); g_assert (nice_address_set_ipv4_from_string (&addr, "192.168.0.1"));
nice_agent_add_local_address (agent, &addr); nice_agent_add_local_address (agent, &addr);
nice_agent_add_stream (agent, handle_recv, NULL); nice_agent_add_stream (agent, 1);
g_assert (agent->local_candidates != NULL); g_assert (agent->local_candidates != NULL);
/* recieve an RTP packet */ /* recieve an RTP packet */
......
...@@ -104,7 +104,7 @@ main (void) ...@@ -104,7 +104,7 @@ main (void)
g_assert_not_reached (); g_assert_not_reached ();
nice_agent_add_local_address (agent, &local_addr); nice_agent_add_local_address (agent, &local_addr);
nice_agent_add_stream (agent, NULL, NULL); nice_agent_add_stream (agent, 1);
if (!nice_address_set_ipv4_from_string (&remote_addr, "192.168.0.2")) if (!nice_address_set_ipv4_from_string (&remote_addr, "192.168.0.2"))
g_assert_not_reached (); g_assert_not_reached ();
......
...@@ -5,18 +5,6 @@ ...@@ -5,18 +5,6 @@
#include "udp-fake.h" #include "udp-fake.h"
#include "agent.h" #include "agent.h"
static void
handle_recv (
NiceAgent *agent,
guint stream_id,
guint component_id,
guint len,
gchar *buf,
gpointer data)
{
g_assert_not_reached ();
}
static void static void
test_stun_no_password ( test_stun_no_password (
NiceAgent *agent, NiceAgent *agent,
...@@ -212,7 +200,7 @@ main (void) ...@@ -212,7 +200,7 @@ main (void)
/* set up agent */ /* set up agent */
agent = nice_agent_new (&factory); agent = nice_agent_new (&factory);
nice_agent_add_local_address (agent, &local_addr); nice_agent_add_local_address (agent, &local_addr);
nice_agent_add_stream (agent, handle_recv, NULL); nice_agent_add_stream (agent, 1);
nice_agent_add_remote_candidate (agent, 1, 1, NICE_CANDIDATE_TYPE_HOST, nice_agent_add_remote_candidate (agent, 1, 1, NICE_CANDIDATE_TYPE_HOST,
&remote_addr, "username", "password"); &remote_addr, "username", "password");
g_assert (agent->local_candidates != NULL); g_assert (agent->local_candidates != NULL);
......
...@@ -45,8 +45,8 @@ main (void) ...@@ -45,8 +45,8 @@ main (void)
/* no candidates should be generated until we have a stream */ /* no candidates should be generated until we have a stream */
g_assert (agent->local_candidates == NULL); g_assert (agent->local_candidates == NULL);
/* add an audio stream */ /* add a stream */
nice_agent_add_stream (agent, handle_recv, NULL); nice_agent_add_stream (agent, 1);
/* adding a stream should cause host candidates to be generated */ /* adding a stream should cause host candidates to be generated */
g_assert (agent->local_candidates != NULL); g_assert (agent->local_candidates != NULL);
......
...@@ -76,7 +76,7 @@ main (gint argc, gchar *argv[]) ...@@ -76,7 +76,7 @@ main (gint argc, gchar *argv[])
// remove // remove
addr.port = 0; addr.port = 0;
nice_agent_add_local_address (agent, &addr); nice_agent_add_local_address (agent, &addr);
nice_agent_add_stream (agent, NULL, NULL); nice_agent_add_stream (agent, 1);
// accept incoming handshake // accept incoming handshake
......
...@@ -39,7 +39,7 @@ make_agent ( ...@@ -39,7 +39,7 @@ make_agent (
g_assert_not_reached (); g_assert_not_reached ();
nice_agent_add_local_address (agent, &addr_local); nice_agent_add_local_address (agent, &addr_local);
nice_agent_add_stream (agent, handle_recv, NULL); nice_agent_add_stream (agent, 1);
g_assert (agent->local_candidates != NULL); g_assert (agent->local_candidates != NULL);
candidate = agent->local_candidates->data; candidate = agent->local_candidates->data;
......
...@@ -33,7 +33,7 @@ make_agent (NiceUDPSocketFactory *factory) ...@@ -33,7 +33,7 @@ make_agent (NiceUDPSocketFactory *factory)
g_assert_not_reached (); g_assert_not_reached ();
nice_agent_add_local_address (agent, &addr); nice_agent_add_local_address (agent, &addr);
nice_agent_add_stream (agent, recv_cb, NULL); nice_agent_add_stream (agent, 1);
return agent; return agent;
} }
......
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