[farsight2/master] Use notify::negotiated-codecs signal in tests

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:22:00 PST 2008


---
 tests/check/main/rtpcodecs.c     |   13 +++++++------
 tests/check/main/rtpconference.c |    8 +++++---
 tests/gui/fs2-gui.py             |    6 +++---
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/tests/check/main/rtpcodecs.c b/tests/check/main/rtpcodecs.c
index b1463ce..e3694f4 100644
--- a/tests/check/main/rtpcodecs.c
+++ b/tests/check/main/rtpcodecs.c
@@ -132,7 +132,8 @@ GST_END_TEST;
 static gboolean has_negotiated = FALSE;
 
 static void
-_new_negotiated_codecs (FsSession *session, gpointer user_data)
+_negotiated_codecs_notify (GObject *object, GParamSpec *paramspec,
+    gpointer user_data)
 {
   has_negotiated = TRUE;
 }
@@ -147,8 +148,8 @@ GST_START_TEST (test_rtpcodecs_two_way_negotiation)
   dat = setup_simple_conference (1, "fsrtpconference", "bob at 127.0.0.1");
   st = simple_conference_add_stream (dat, dat);
 
-  g_signal_connect (dat->session, "new-negotiated-codecs",
-      G_CALLBACK (_new_negotiated_codecs), dat);
+  g_signal_connect (dat->session, "notify::negotiated-codecs",
+      G_CALLBACK (_negotiated_codecs_notify), dat);
 
   codecs = g_list_append (codecs,
       fs_codec_new (
@@ -180,7 +181,7 @@ GST_START_TEST (test_rtpcodecs_two_way_negotiation)
       "Could not set remote PCMU codec");
 
   fail_unless (has_negotiated == TRUE,
-      "Did not receive the new_negotiated_codecs signal");
+      "Did not receive the notify::negotiated-codecs signal");
 
   g_object_get (dat->session, "negotiated-codecs", &codecs2, NULL);
   fail_unless (g_list_length (codecs2) == 1, "Too many negotiated codecs");
@@ -194,8 +195,8 @@ GST_START_TEST (test_rtpcodecs_two_way_negotiation)
       "Could not re-set remote PCMU codec");
 
   fail_if (has_negotiated == TRUE,
-      "We received the new_negotiated_codecs signal even though codecs haven't"
-      " changed");
+      "We received the notify::negotiated-codecs signal even though codecs"
+      " have not changed");
 
   fs_codec_list_destroy (codecs);
 
diff --git a/tests/check/main/rtpconference.c b/tests/check/main/rtpconference.c
index fe9a083..67f4e20 100644
--- a/tests/check/main/rtpconference.c
+++ b/tests/check/main/rtpconference.c
@@ -478,9 +478,11 @@ _compare_codec_lists (GList *list1, GList *list2)
 }
 
 static void
-_new_negotiated_codecs (FsSession *session, gpointer user_data)
+_negotiated_codecs_notify (GObject *object, GParamSpec *paramspec,
+    gpointer user_data)
 {
   struct SimpleTestConference *dat = user_data;
+  FsSession *session = FS_SESSION (object);
   GList *codecs = NULL;
   GError *error = NULL;
   GList *item = NULL;
@@ -620,8 +622,8 @@ nway_test (int in_count, extra_init extrainit)
     setup_fakesrc (dats[i]);
 
     if (i != 0)
-      g_signal_connect (dats[i]->session, "new-negotiated-codecs",
-          G_CALLBACK (_new_negotiated_codecs), dats[i]);
+      g_signal_connect (dats[i]->session, "notify::negotiated-codecs",
+          G_CALLBACK (_negotiated_codecs_notify), dats[i]);
   }
 
   for (i = 0; i < count; i++)
diff --git a/tests/gui/fs2-gui.py b/tests/gui/fs2-gui.py
index d792f73..3bed8cb 100644
--- a/tests/gui/fs2-gui.py
+++ b/tests/gui/fs2-gui.py
@@ -344,8 +344,8 @@ class FsUISession:
                                                       "PCMU",
                                                       farsight.MEDIA_TYPE_AUDIO,
                                                       0)])
-        self.fssession.connect("new-negotiated-codecs",
-                             self.__new_negotiated_codecs)
+        self.fssession.connect("notify::negotiated-codecs",
+                             self.__negotiated_codecs_notify)
         self.sourcepad = self.source.get_src_pad()
         self.sourcepad.link(self.fssession.get_property("sink-pad"))
 
@@ -353,7 +353,7 @@ class FsUISession:
         self.sourcepad(unlink)
         self.source.put_src_pad(self.sourcepad)
         
-    def __new_negotiated_codecs(self, session):
+    def __negotiated_codecs_notify(self, session, paramspec):
         "Callback from FsSession"
         for s in self.streams.valuerefs():
             try:
-- 
1.5.6.5




More information about the farsight-commits mailing list