[farsight2/master] fstransmitter: Pass the ToS in the _new function

Olivier Crête olivier.crete at collabora.co.uk
Wed Jul 22 14:28:11 PDT 2009


---
 gst-libs/gst/farsight/fs-transmitter.c |   11 +++++++++--
 gst-libs/gst/farsight/fs-transmitter.h |    6 ++++--
 gst/fsrtpconference/fs-rtp-session.c   |    2 +-
 tests/check/base/fstransmitter.c       |    3 ++-
 tests/check/transmitter/generic.c      |    2 +-
 tests/check/transmitter/multicast.c    |    2 +-
 tests/check/transmitter/nice.c         |    6 +++---
 tests/check/transmitter/rawudp.c       |    6 ++----
 8 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-transmitter.c b/gst-libs/gst/farsight/fs-transmitter.c
index 5306887..12e5d51 100644
--- a/gst-libs/gst/farsight/fs-transmitter.c
+++ b/gst-libs/gst/farsight/fs-transmitter.c
@@ -283,6 +283,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
+ * @tos: The Type of Service of the socket, max is 255
  * @error: location of a #GError, or NULL if no error occured
  *
  * This function creates a new transmitter of the requested type.
@@ -293,14 +294,20 @@ fs_transmitter_new_stream_transmitter (FsTransmitter *transmitter,
  */
 
 FsTransmitter *
-fs_transmitter_new (const gchar *type, guint components, GError **error)
+fs_transmitter_new (const gchar *type,
+    guint components,
+    guint tos,
+    GError **error)
 {
   FsTransmitter *self = NULL;
 
   g_return_val_if_fail (type != NULL, NULL);
+  g_return_val_if_fail (tos >= 0 && tos <= 255, NULL);
 
   self = FS_TRANSMITTER (fs_plugin_create (type, "transmitter", error,
-      "components", components, NULL));
+          "components", components,
+          "tos", tos,
+          NULL));
 
   if (!self)
     return NULL;
diff --git a/gst-libs/gst/farsight/fs-transmitter.h b/gst-libs/gst/farsight/fs-transmitter.h
index 3483dd1..6891ec0 100644
--- a/gst-libs/gst/farsight/fs-transmitter.h
+++ b/gst-libs/gst/farsight/fs-transmitter.h
@@ -104,8 +104,10 @@ FsStreamTransmitter *fs_transmitter_new_stream_transmitter (
     FsTransmitter *transmitter, FsParticipant *participant,
     guint n_parameters, GParameter *parameters, GError **error);
 
-FsTransmitter *fs_transmitter_new (const gchar *type, guint components,
-  GError **error);
+FsTransmitter *fs_transmitter_new (const gchar *type,
+    guint components,
+    guint tos,
+    GError **error);
 
 GType fs_transmitter_get_stream_transmitter_type (FsTransmitter *transmitter);
 
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 670d0dd..19fc528 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -1913,7 +1913,7 @@ fs_rtp_session_get_transmitter (FsRtpSession *self,
   }
   FS_RTP_SESSION_UNLOCK (self);
 
-  transmitter = fs_transmitter_new (transmitter_name, 2, error);
+  transmitter = fs_transmitter_new (transmitter_name, 2, 0, error);
   if (!transmitter)
     return NULL;
 
diff --git a/tests/check/base/fstransmitter.c b/tests/check/base/fstransmitter.c
index 255d36a..10d2d25 100644
--- a/tests/check/base/fstransmitter.c
+++ b/tests/check/base/fstransmitter.c
@@ -12,6 +12,7 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
+
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
@@ -32,7 +33,7 @@ GST_START_TEST (test_fstransmitter_new_fail)
   GError *error = NULL;
   FsTransmitter *transmitter = NULL;
 
-  transmitter = fs_transmitter_new ("invalidname", 1,  &error);
+  transmitter = fs_transmitter_new ("invalidname", 1,  0, &error);
 
   fail_if (transmitter);
 
diff --git a/tests/check/transmitter/generic.c b/tests/check/transmitter/generic.c
index 445ac29..715953e 100644
--- a/tests/check/transmitter/generic.c
+++ b/tests/check/transmitter/generic.c
@@ -183,7 +183,7 @@ test_transmitter_creation (gchar *transmitter_name)
   GstElement *pipeline;
   GstElement *trans_sink, *trans_src;
 
-  trans = fs_transmitter_new (transmitter_name, 2, &error);
+  trans = fs_transmitter_new (transmitter_name, 2, 0, &error);
 
   if (error) {
     ts_fail ("Error creating transmitter: (%s:%d) %s",
diff --git a/tests/check/transmitter/multicast.c b/tests/check/transmitter/multicast.c
index c44af8f..c1e9bf9 100644
--- a/tests/check/transmitter/multicast.c
+++ b/tests/check/transmitter/multicast.c
@@ -139,7 +139,7 @@ run_multicast_transmitter_test (gint n_parameters, GParameter *params,
     fail_unless (fs_fake_filter_register ());
 
   loop = g_main_loop_new (NULL, FALSE);
-  trans = fs_transmitter_new ("multicast", 2, &error);
+  trans = fs_transmitter_new ("multicast", 2, 0, &error);
 
   if (error) {
     ts_fail ("Error creating transmitter: (%s:%d) %s",
diff --git a/tests/check/transmitter/nice.c b/tests/check/transmitter/nice.c
index 8734246..bd063fb 100644
--- a/tests/check/transmitter/nice.c
+++ b/tests/check/transmitter/nice.c
@@ -398,7 +398,7 @@ run_nice_transmitter_test (gint n_parameters, GParameter *params,
 
   loop = g_main_loop_new (NULL, FALSE);
 
-  trans = fs_transmitter_new ("nice", 2, &error);
+  trans = fs_transmitter_new ("nice", 2, 0, &error);
   if (error) {
     ts_fail ("Error creating transmitter: (%s:%d) %s",
         g_quark_to_string (error->domain), error->code, error->message);
@@ -409,7 +409,7 @@ run_nice_transmitter_test (gint n_parameters, GParameter *params,
     ts_fail_unless (g_signal_connect (trans, "get-recvonly-filter",
             G_CALLBACK (_get_recvonly_filter), NULL));
 
-  trans2 = fs_transmitter_new ("nice", 2, &error);
+  trans2 = fs_transmitter_new ("nice", 2, 0, &error);
   if (error) {
     ts_fail ("Error creating transmitter: (%s:%d) %s",
         g_quark_to_string (error->domain), error->code, error->message);
@@ -641,7 +641,7 @@ GST_START_TEST (test_nicetransmitter_invalid_arguments)
 
   memset (params, 0, sizeof(GParameter) * 1);
 
-  trans = fs_transmitter_new ("nice", 3, &error);
+  trans = fs_transmitter_new ("nice", 3, 0, &error);
   ts_fail_if (trans == NULL);
   ts_fail_unless (error == NULL);
 
diff --git a/tests/check/transmitter/rawudp.c b/tests/check/transmitter/rawudp.c
index d4fc7e4..6be180b 100644
--- a/tests/check/transmitter/rawudp.c
+++ b/tests/check/transmitter/rawudp.c
@@ -297,7 +297,7 @@ run_rawudp_transmitter_test (gint n_parameters, GParameter *params,
   }
 
   loop = g_main_loop_new (NULL, FALSE);
-  trans = fs_transmitter_new ("rawudp", 2, &error);
+  trans = fs_transmitter_new ("rawudp", 2, 0, &error);
 
   if (error) {
     ts_fail ("Error creating transmitter: (%s:%d) %s",
@@ -586,7 +586,7 @@ GST_START_TEST (test_rawudptransmitter_stop_stream)
   has_stun = FALSE;
 
   loop = g_main_loop_new (NULL, FALSE);
-  trans = fs_transmitter_new ("rawudp", 2, &error);
+  trans = fs_transmitter_new ("rawudp", 2, 0, &error);
 
   if (error) {
     ts_fail ("Error creating transmitter: (%s:%d) %s",
@@ -638,8 +638,6 @@ GST_START_TEST (test_rawudptransmitter_stop_stream)
 
   gst_element_set_state (pipeline, GST_STATE_NULL);
 
-  gst_element_get_state (pipeline, NULL, NULL, GST_CLOCK_TIME_NONE);
-
   g_object_unref (trans);
 
   gst_object_unref (pipeline);
-- 
1.5.6.5




More information about the farsight-commits mailing list