[farsight2/master] Connect all the stream signals at the same place, re-order some functions
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:21:19 PST 2008
---
tests/check/main/rtpconference.c | 102 ++++++++++++++++++--------------------
1 files changed, 49 insertions(+), 53 deletions(-)
diff --git a/tests/check/main/rtpconference.c b/tests/check/main/rtpconference.c
index 1046ae8..e2fa299 100644
--- a/tests/check/main/rtpconference.c
+++ b/tests/check/main/rtpconference.c
@@ -373,6 +373,51 @@ _new_active_candidate_pair (FsStream *stream, FsCandidate *local,
setup_fakesrc (st->dat);
}
+static struct SimpleTestStream *
+find_pointback_stream (
+ struct SimpleTestConference *dat,
+ struct SimpleTestConference *target)
+{
+ GList *item = NULL;
+
+ for (item = g_list_first (dat->streams);
+ item;
+ item = g_list_next (item))
+ {
+ struct SimpleTestStream *st = item->data;
+
+ if (st->target == target)
+ return st;
+ }
+
+ ts_fail ("We did not find a return stream for %d in %d", target->id, dat->id);
+ return NULL;
+}
+
+static void
+_new_local_candidate (FsStream *stream, FsCandidate *candidate,
+ gpointer user_data)
+{
+ struct SimpleTestStream *st = user_data;
+ gboolean ret;
+ GError *error = NULL;
+ struct SimpleTestStream *other_st = find_pointback_stream (st->target,
+ st->dat);
+
+ g_debug ("%d:%d: Setting remote candidate for component %d",
+ other_st->dat->id,
+ other_st->target->id,
+ candidate->component_id);
+
+ ret = fs_stream_add_remote_candidate (other_st->stream, candidate, &error);
+
+ if (error)
+ ts_fail ("Error while adding candidate: (%s:%d) %s",
+ g_quark_to_string (error->domain), error->code, error->message);
+
+ ts_fail_unless(ret == TRUE, "No detailed error from add_remote_candidate");
+
+}
static void
rtpconference_connect_signals (struct SimpleTestConference *dat)
@@ -390,11 +435,12 @@ rtpconference_connect_signals (struct SimpleTestConference *dat)
static void
rtpconference_connect_streams_signals (struct SimpleTestStream *st)
{
- g_signal_connect (st->stream, "src-pad-added", G_CALLBACK (_src_pad_added),
- st);
-
+ g_signal_connect (st->stream, "src-pad-added",
+ G_CALLBACK (_src_pad_added), st);
g_signal_connect (st->stream, "new-active-candidate-pair",
G_CALLBACK (_new_active_candidate_pair), st);
+ g_signal_connect (st->stream, "new-local-candidate",
+ G_CALLBACK (_new_local_candidate), st);
}
@@ -413,28 +459,6 @@ _start_pipeline (gpointer user_data)
return FALSE;
}
-static struct SimpleTestStream *
-find_pointback_stream (
- struct SimpleTestConference *dat,
- struct SimpleTestConference *target)
-{
- GList *item = NULL;
-
- for (item = g_list_first (dat->streams);
- item;
- item = g_list_next (item))
- {
- struct SimpleTestStream *st = item->data;
-
- if (st->target == target)
- return st;
- }
-
- ts_fail ("We did not find a return stream for %d in %d", target->id, dat->id);
- return NULL;
-}
-
-
static gboolean
_compare_codec_lists (GList *list1, GList *list2)
{
@@ -510,31 +534,6 @@ _new_negotiated_codecs (FsSession *session, gpointer user_data)
static void
-_new_local_candidate (FsStream *stream, FsCandidate *candidate,
- gpointer user_data)
-{
- struct SimpleTestStream *st = user_data;
- gboolean ret;
- GError *error = NULL;
- struct SimpleTestStream *other_st = find_pointback_stream (st->target,
- st->dat);
-
- g_debug ("%d:%d: Setting remote candidate for component %d",
- other_st->dat->id,
- other_st->target->id,
- candidate->component_id);
-
- ret = fs_stream_add_remote_candidate (other_st->stream, candidate, &error);
-
- if (error)
- ts_fail ("Error while adding candidate: (%s:%d) %s",
- g_quark_to_string (error->domain), error->code, error->message);
-
- ts_fail_unless(ret == TRUE, "No detailed error from add_remote_candidate");
-
-}
-
-static void
set_initial_codecs (
struct SimpleTestConference *from,
struct SimpleTestStream *to)
@@ -628,9 +627,6 @@ nway_test (int in_count)
st = simple_conference_add_stream (dats[i], dats[j]);
rtpconference_connect_streams_signals (st);
-
- g_signal_connect (st->stream, "new-local-candidate",
- G_CALLBACK (_new_local_candidate), st);
}
for (i = 1; i < count; i++)
--
1.5.6.5
More information about the farsight-commits
mailing list