[farsight2/master] Dont link add/link fakesrc at pipeline creation
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:19:29 PST 2008
---
tests/check/transmitter/generic.c | 12 ++++--------
tests/check/transmitter/generic.h | 2 +-
tests/check/transmitter/rawudp.c | 5 ++++-
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/tests/check/transmitter/generic.c b/tests/check/transmitter/generic.c
index abfa6b1..82ab6cc 100644
--- a/tests/check/transmitter/generic.c
+++ b/tests/check/transmitter/generic.c
@@ -39,10 +39,9 @@ _transmitter_error (FsTransmitter *transmitter, gint errorno, gchar *error_msg,
}
GstElement *
-setup_pipeline (FsTransmitter *trans)
+setup_pipeline (FsTransmitter *trans, GstElement **fakesrc)
{
GstElement *pipeline;
- GstElement *fakesrc;
GstElement *fakesink;
GstElement *trans_sink, *trans_src;
@@ -50,7 +49,7 @@ setup_pipeline (FsTransmitter *trans)
G_CALLBACK (_transmitter_error), NULL), "Could not connect signal");
pipeline = gst_pipeline_new ("pipeline");
- fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
+ *fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
fakesink = gst_element_factory_make ("fakesink", "fakesink");
g_object_get (trans, "gst-sink", &trans_sink, "gst-src", &trans_src, NULL);
@@ -58,11 +57,7 @@ setup_pipeline (FsTransmitter *trans)
fail_if (trans_sink == NULL, "No transmitter sink");
fail_if (trans_src == NULL, "No transmitter src");
- gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink,
- trans_sink, trans_src, NULL);
-
- fail_unless (gst_element_link (fakesrc, trans_sink),
- "Coult not link fakesrc and transmitter sink");
+ gst_bin_add_many (GST_BIN (pipeline), fakesink, trans_sink, trans_src, NULL);
fail_unless (gst_element_link (trans_src, fakesink),
"Coult not link transmitter src and fakesink");
@@ -70,5 +65,6 @@ setup_pipeline (FsTransmitter *trans)
g_object_unref (trans_src);
g_object_unref (trans_sink);
+
return pipeline;
}
diff --git a/tests/check/transmitter/generic.h b/tests/check/transmitter/generic.h
index e3d5bd7..423f385 100644
--- a/tests/check/transmitter/generic.h
+++ b/tests/check/transmitter/generic.h
@@ -26,7 +26,7 @@
#ifndef __GENERIC_H__
#define __GENERIC_H__
-GstElement * setup_pipeline (FsTransmitter *trans);
+GstElement * setup_pipeline (FsTransmitter *trans, GstElement **fakesrc);
#endif /* __GENERIC_H__ */
diff --git a/tests/check/transmitter/rawudp.c b/tests/check/transmitter/rawudp.c
index bc76a13..5c16e5b 100644
--- a/tests/check/transmitter/rawudp.c
+++ b/tests/check/transmitter/rawudp.c
@@ -34,6 +34,7 @@ GST_START_TEST (test_rawudptransmitter_new)
GError *error = NULL;
FsTransmitter *trans;
GstElement *pipeline;
+ GstElement *fakesrc;
GstElement *trans_sink, *trans_src;
trans = fs_transmitter_new ("rawudp", &error);
@@ -44,10 +45,12 @@ GST_START_TEST (test_rawudptransmitter_new)
fail_if (trans == NULL, "No transmitter create, yet error is still NULL");
- pipeline = setup_pipeline (trans);
+ pipeline = setup_pipeline (trans, &fakesrc);
g_object_get (trans, "gst-sink", &trans_sink, "gst-src", &trans_src, NULL);
+ gst_object_unref (fakesrc);
+
g_object_unref (trans);
gst_object_unref (pipeline);
--
1.5.6.5
More information about the farsight-commits
mailing list