[farsight2/master] tests: Take rtpsession lock during message emissions
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 22 12:55:41 PST 2009
This ensures that it is not held across message emissions.
---
tests/check/rtp/conference.c | 1 +
tests/check/rtp/generic.c | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/tests/check/rtp/conference.c b/tests/check/rtp/conference.c
index 1c266bb..8ca60ad 100644
--- a/tests/check/rtp/conference.c
+++ b/tests/check/rtp/conference.c
@@ -1450,6 +1450,7 @@ static void unref_stream_init (void)
{
GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (dats[i]->pipeline));
+ gst_bus_set_sync_handler (bus, NULL, NULL);
gst_bus_set_sync_handler (bus, unref_stream_sync_handler, dats[i]);
gst_object_unref (bus);
}
diff --git a/tests/check/rtp/generic.c b/tests/check/rtp/generic.c
index 1446474..5d6c97e 100644
--- a/tests/check/rtp/generic.c
+++ b/tests/check/rtp/generic.c
@@ -28,6 +28,22 @@
#include <gst/check/gstcheck.h>
#include <gst/farsight/fs-conference-iface.h>
+
+static GstBusSyncReply
+default_sync_handler (GstBus *bus, GstMessage *message, gpointer data)
+{
+ struct SimpleTestConference *dat = data;
+ gboolean ready;
+
+ /* Get the codecs-ready property which takes the session lock to make sure
+ * it is not held across signal emissions
+ */
+ if (dat->session)
+ g_object_get (dat->session, "codecs-ready", &ready, NULL);
+
+ return GST_BUS_PASS;
+}
+
struct SimpleTestConference *
setup_simple_conference (
gint id,
@@ -37,6 +53,7 @@ setup_simple_conference (
struct SimpleTestConference *dat = g_new0 (struct SimpleTestConference, 1);
GError *error = NULL;
guint tos;
+ GstBus *bus;
dat->id = id;
dat->cname = g_strdup (cname);
@@ -44,6 +61,11 @@ setup_simple_conference (
dat->pipeline = gst_pipeline_new ("pipeline");
fail_if (dat->pipeline == NULL);
+ bus = gst_pipeline_get_bus (GST_PIPELINE (dat->pipeline));
+ fail_if (bus == NULL);
+ gst_bus_set_sync_handler (bus, default_sync_handler, dat);
+ gst_object_unref (bus);
+
dat->conference = gst_element_factory_make (conference_elem, NULL);
fail_if (dat->conference == NULL, "Could not build %s", conference_elem);
fail_unless (gst_bin_add (GST_BIN (dat->pipeline), dat->conference),
--
1.5.6.5
More information about the farsight-commits
mailing list