[farsight2/master] Add a parameter to the _new() function to specify the number of parameters

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


---
 gst-libs/gst/farsight/fs-transmitter.c |    7 ++++---
 gst-libs/gst/farsight/fs-transmitter.h |    3 ++-
 tests/check/base/fstransmitter.c       |    2 +-
 tests/check/transmitter/rawudp.c       |    4 ++--
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-transmitter.c b/gst-libs/gst/farsight/fs-transmitter.c
index dc3b122..6ebb5f5 100644
--- a/gst-libs/gst/farsight/fs-transmitter.c
+++ b/gst-libs/gst/farsight/fs-transmitter.c
@@ -287,6 +287,7 @@ fs_transmitter_new_stream_transmitter (FsTransmitter *transmitter,
 /**
  * fs_transmitter_new:
  * @type: The type of transmitter to create
+ * @components: The number of components to create
  * @error: location of a #GError, or NULL if no error occured
  *
  * This function creates a new transmitter of the requested type.
@@ -297,14 +298,14 @@ fs_transmitter_new_stream_transmitter (FsTransmitter *transmitter,
  */
 
 FsTransmitter *
-fs_transmitter_new (gchar *type, GError **error)
+fs_transmitter_new (gchar *type, guint components, GError **error)
 {
   FsTransmitter *self = NULL;
 
   g_return_val_if_fail (type != NULL, NULL);
 
-  self = FS_TRANSMITTER(fs_plugin_create_valist(type, "transmitter", error,
-      NULL, NULL));
+  self = FS_TRANSMITTER(fs_plugin_create(type, "transmitter", error,
+      "components", components, NULL));
 
   if (!self)
     return NULL;
diff --git a/gst-libs/gst/farsight/fs-transmitter.h b/gst-libs/gst/farsight/fs-transmitter.h
index 584a158..26b1d29 100644
--- a/gst-libs/gst/farsight/fs-transmitter.h
+++ b/gst-libs/gst/farsight/fs-transmitter.h
@@ -101,7 +101,8 @@ FsStreamTransmitter *fs_transmitter_new_stream_transmitter (
     FsTransmitter *transmitter, FsParticipant *participant,
     guint n_parameters, GParameter *parameters, GError **error);
 
-FsTransmitter *fs_transmitter_new (gchar *type, GError **error);
+FsTransmitter *fs_transmitter_new (gchar *type, guint components,
+  GError **error);
 
 G_END_DECLS
 
diff --git a/tests/check/base/fstransmitter.c b/tests/check/base/fstransmitter.c
index 8c40d0e..4e1192a 100644
--- a/tests/check/base/fstransmitter.c
+++ b/tests/check/base/fstransmitter.c
@@ -33,7 +33,7 @@ GST_START_TEST (test_fstransmitter_new_fail)
   GError *error = NULL;
   FsTransmitter *transmitter = NULL;
 
-  transmitter = fs_transmitter_new ("invalidname", &error);
+  transmitter = fs_transmitter_new ("invalidname", 1,  &error);
 
   fail_if (transmitter);
 
diff --git a/tests/check/transmitter/rawudp.c b/tests/check/transmitter/rawudp.c
index f132a39..8acb588 100644
--- a/tests/check/transmitter/rawudp.c
+++ b/tests/check/transmitter/rawudp.c
@@ -50,7 +50,7 @@ GST_START_TEST (test_rawudptransmitter_new)
   GstElement *pipeline;
   GstElement *trans_sink, *trans_src;
 
-  trans = fs_transmitter_new ("rawudp", &error);
+  trans = fs_transmitter_new ("rawudp", 2, &error);
 
   if (error) {
     fail("Error creating transmitter: (%s:%d) %s",
@@ -229,7 +229,7 @@ run_rawudp_transmitter_test (gint n_parameters, GParameter *params,
   GstElement *trans_sink, *trans_src;
 
   loop = g_main_loop_new (NULL, FALSE);
-  trans = fs_transmitter_new ("rawudp", &error);
+  trans = fs_transmitter_new ("rawudp", 2, &error);
 
   if (error) {
     fail("Error creating transmitter: (%s:%d) %s",
-- 
1.5.6.5




More information about the farsight-commits mailing list