[farsight2/master] Make multicast transmitter respect the TTL in the candidate

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


---
 tests/check/transmitter/multicast.c                |    4 +-
 .../multicast/fs-multicast-stream-transmitter.c    |  119 ++++++++---
 transmitters/multicast/fs-multicast-transmitter.c  |  217 ++++++++++----------
 transmitters/multicast/fs-multicast-transmitter.h  |   39 +---
 4 files changed, 199 insertions(+), 180 deletions(-)

diff --git a/tests/check/transmitter/multicast.c b/tests/check/transmitter/multicast.c
index f21ee0e..875913a 100644
--- a/tests/check/transmitter/multicast.c
+++ b/tests/check/transmitter/multicast.c
@@ -170,6 +170,7 @@ run_multicast_transmitter_test (gint n_parameters, GParameter *params,
   tmpcand = fs_candidate_new ("L1", FS_COMPONENT_RTP,
       FS_CANDIDATE_TYPE_MULTICAST, FS_NETWORK_PROTOCOL_UDP,
       "224.0.0.33", 2322);
+  tmpcand->ttl = 1;
   if (!fs_stream_transmitter_add_remote_candidate (st, tmpcand, &error))
     ts_fail ("Error setting the remote candidate: %p %s", error,
         error ? error->message : "NO ERROR SET");
@@ -179,7 +180,8 @@ run_multicast_transmitter_test (gint n_parameters, GParameter *params,
 
   tmpcand = fs_candidate_new ("L2", FS_COMPONENT_RTCP,
       FS_CANDIDATE_TYPE_MULTICAST, FS_NETWORK_PROTOCOL_UDP,
-      "224.0.0.33", 2323);
+      "224.0.024", 2323);
+  tmpcand->ttl = 1;
   if (!fs_stream_transmitter_add_remote_candidate (st, tmpcand, &error))
     ts_fail ("Error setting the remote candidate: %p %s", error,
         error ? error->message : "NO ERROR SET");
diff --git a/transmitters/multicast/fs-multicast-stream-transmitter.c b/transmitters/multicast/fs-multicast-stream-transmitter.c
index c59578e..6bbb90c 100644
--- a/transmitters/multicast/fs-multicast-stream-transmitter.c
+++ b/transmitters/multicast/fs-multicast-stream-transmitter.c
@@ -85,7 +85,8 @@ struct _FsMulticastStreamTransmitterPrivate
   FsCandidate **remote_candidate;
   FsCandidate **local_candidate;
 
-  UdpMulticastGroup **mcasts;
+  UdpMulticastGroup **recvmcasts;
+  UdpMulticastGroup **sendmcasts;
 
   GList *preferred_local_candidates;
 
@@ -188,20 +189,35 @@ fs_multicast_stream_transmitter_dispose (GObject *object)
   FsMulticastStreamTransmitter *self = FS_MULTICAST_STREAM_TRANSMITTER (object);
   gint c;
 
-  if (self->priv->disposed) {
+  if (self->priv->disposed)
     /* If dispose did already run, return. */
     return;
-  }
 
-  if (self->priv->mcasts) {
-    for (c = 1; c <= self->priv->transmitter->components; c++) {
-      if (self->priv->mcasts[c]) {
+  if (self->priv->sendmcasts)
+  {
+    for (c = 1; c <= self->priv->transmitter->components; c++)
+    {
+      if (self->priv->sendmcasts[c])
+      {
         if (self->priv->sending)
-          fs_multicast_transmitter_set_group_sending (self->priv->mcasts[c],
-              FALSE);
+          fs_multicast_transmitter_group_dec_sending (
+              self->priv->sendmcasts[c]);
         fs_multicast_transmitter_put_group (self->priv->transmitter,
-            self->priv->mcasts[c]);
-        self->priv->mcasts[c] = NULL;
+            self->priv->sendmcasts[c]);
+        self->priv->sendmcasts[c] = NULL;
+      }
+    }
+  }
+
+  if (self->priv->recvmcasts)
+  {
+    for (c = 1; c <= self->priv->transmitter->components; c++)
+    {
+      if (self->priv->recvmcasts[c])
+      {
+        fs_multicast_transmitter_put_group (self->priv->transmitter,
+            self->priv->recvmcasts[c]);
+        self->priv->recvmcasts[c] = NULL;
       }
     }
   }
@@ -236,8 +252,11 @@ fs_multicast_stream_transmitter_finalize (GObject *object)
     self->priv->remote_candidate = NULL;
   }
 
-  g_free (self->priv->mcasts);
-  self->priv->mcasts = NULL;
+  g_free (self->priv->sendmcasts);
+  self->priv->sendmcasts = NULL;
+
+  g_free (self->priv->recvmcasts);
+  self->priv->recvmcasts = NULL;
 
   parent_class->finalize (object);
 }
@@ -250,7 +269,8 @@ fs_multicast_stream_transmitter_get_property (GObject *object,
 {
   FsMulticastStreamTransmitter *self = FS_MULTICAST_STREAM_TRANSMITTER (object);
 
-  switch (prop_id) {
+  switch (prop_id)
+  {
     case PROP_SENDING:
       g_value_set_boolean (value, self->priv->sending);
       break;
@@ -281,9 +301,15 @@ fs_multicast_stream_transmitter_set_property (GObject *object,
 
         if (self->priv->sending != old_sending)
           for (c = 1; c <= self->priv->transmitter->components; c++)
-            if (self->priv->mcasts[c])
-              fs_multicast_transmitter_set_group_sending (self->priv->mcasts[c],
-                  self->priv->sending);
+            if (self->priv->sendmcasts[c])
+            {
+              if (self->priv->sending)
+                fs_multicast_transmitter_group_inc_sending (
+                    self->priv->sendmcasts[c]);
+              else
+                fs_multicast_transmitter_group_dec_sending (
+                    self->priv->sendmcasts[c]);
+            }
       }
       break;
     case PROP_PREFERRED_LOCAL_CANDIDATES:
@@ -302,12 +328,14 @@ fs_multicast_stream_transmitter_build (FsMulticastStreamTransmitter *self,
   GList *item;
   gint c;
 
-  self->priv->mcasts = g_new0 (UdpMulticastGroup *,
-    self->priv->transmitter->components + 1);
+  self->priv->sendmcasts = g_new0 (UdpMulticastGroup *,
+      self->priv->transmitter->components + 1);
+  self->priv->recvmcasts = g_new0 (UdpMulticastGroup *,
+      self->priv->transmitter->components + 1);
   self->priv->local_candidate = g_new0 (FsCandidate *,
-    self->priv->transmitter->components + 1)
-;  self->priv->remote_candidate = g_new0 (FsCandidate *,
-    self->priv->transmitter->components + 1);
+      self->priv->transmitter->components + 1);
+  self->priv->remote_candidate = g_new0 (FsCandidate *,
+      self->priv->transmitter->components + 1);
 
   for (item = g_list_first (self->priv->preferred_local_candidates);
        item;
@@ -392,7 +420,8 @@ fs_multicast_stream_transmitter_add_remote_candidate (
 {
   FsMulticastStreamTransmitter *self =
     FS_MULTICAST_STREAM_TRANSMITTER (streamtransmitter);
-  UdpMulticastGroup *newmcast = NULL;
+  UdpMulticastGroup *newrecvmcast = NULL;
+  UdpMulticastGroup *newsendmcast = NULL;
 
   if (candidate->proto != FS_NETWORK_PROTOCOL_UDP) {
     g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
@@ -423,6 +452,13 @@ fs_multicast_stream_transmitter_add_remote_candidate (
     return FALSE;
   }
 
+  if (candidate->ttl == 0)
+  {
+    g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
+        "The TTL for IPv4 multicast candidates must not be 0");
+    return FALSE;
+  }
+
   if (self->priv->remote_candidate[candidate->component_id])
   {
     FsCandidate *old_candidate =
@@ -443,29 +479,44 @@ fs_multicast_stream_transmitter_add_remote_candidate (
    * We should also check if the address is in the multicast range
    */
 
-  newmcast = fs_multicast_transmitter_get_group (self->priv->transmitter,
+  newrecvmcast = fs_multicast_transmitter_get_group (self->priv->transmitter,
       candidate->component_id, candidate->ip, candidate->port,
-      self->priv->local_candidate[candidate->component_id]->ip, error);
+      self->priv->local_candidate[candidate->component_id]->ip,
+      candidate->ttl, TRUE, error);
 
-  if (!newmcast)
+  if (!newrecvmcast)
     return FALSE;
 
-  if (self->priv->mcasts[candidate->component_id])
+  newsendmcast = fs_multicast_transmitter_get_group (self->priv->transmitter,
+      candidate->component_id, candidate->ip, candidate->port,
+      self->priv->local_candidate[candidate->component_id]->ip,
+      candidate->ttl, FALSE, error);
+
+  if (!newsendmcast)
+  {
+    fs_multicast_transmitter_put_group (self->priv->transmitter, newrecvmcast);
+    return FALSE;
+  }
+
+  if (self->priv->sendmcasts[candidate->component_id])
   {
     if (self->priv->sending)
-      fs_multicast_transmitter_set_group_sending (
-          self->priv->mcasts[candidate->component_id],
-          FALSE);
+      fs_multicast_transmitter_group_dec_sending (
+          self->priv->sendmcasts[candidate->component_id]);
     fs_multicast_transmitter_put_group (self->priv->transmitter,
-        self->priv->mcasts[candidate->component_id]);
+        self->priv->sendmcasts[candidate->component_id]);
   }
 
-  self->priv->mcasts[candidate->component_id] = newmcast;
+  if (self->priv->recvmcasts[candidate->component_id])
+    fs_multicast_transmitter_put_group (self->priv->transmitter,
+        self->priv->recvmcasts[candidate->component_id]);
+
+  self->priv->sendmcasts[candidate->component_id] = newsendmcast;
+  self->priv->recvmcasts[candidate->component_id] = newrecvmcast;
 
   if (self->priv->sending)
-    fs_multicast_transmitter_set_group_sending (
-        self->priv->mcasts[candidate->component_id],
-        TRUE);
+    fs_multicast_transmitter_group_inc_sending (
+        self->priv->sendmcasts[candidate->component_id]);
 
   self->priv->remote_candidate[candidate->component_id] =
     fs_candidate_copy (candidate);
diff --git a/transmitters/multicast/fs-multicast-transmitter.c b/transmitters/multicast/fs-multicast-transmitter.c
index 23d2425..50dfee0 100644
--- a/transmitters/multicast/fs-multicast-transmitter.c
+++ b/transmitters/multicast/fs-multicast-transmitter.c
@@ -111,6 +111,20 @@ static GType fs_multicast_transmitter_get_stream_transmitter_type (
     GError **error);
 
 
+typedef struct _UdpPort UdpPort;
+
+static UdpPort *fs_multicast_transmitter_get_udpport (
+    FsMulticastTransmitter *trans,
+    guint component_id,
+    const gchar *local_ip,
+    guint16 port,
+    guint8 ttl,
+    gboolean recv,
+    GError **error);
+static void fs_multicast_transmitter_put_udpport (FsMulticastTransmitter *trans,
+    UdpPort *udpport);
+
+
 static GObjectClass *parent_class = NULL;
 //static guint signals[LAST_SIGNAL] = { 0 };
 
@@ -466,8 +480,8 @@ fs_multicast_transmitter_new_stream_transmitter (FsTransmitter *transmitter,
 
 /*
  * The UdpPort structure is a ref-counted pseudo-object use to represent
- * one ip:port combo on which we listen and send, so it includes  a udpsrc
- * and a multiudpsink
+ * one ip:port:ttl trio on which we listen and send, so it includes a udpsrc
+ * and a multiudpsink. It represents one BSD socket.
  */
 
 struct _UdpPort {
@@ -480,7 +494,8 @@ struct _UdpPort {
   GstPad *udpsink_requested_pad;
 
   gchar *local_ip;
-  guint port;
+  guint16 port;
+  guint8 ttl;
 
   gint fd;
 
@@ -490,19 +505,22 @@ struct _UdpPort {
 
   guint component_id;
 
+  gboolean sendonly;
+
   GList *multicast_groups;
 };
 
 static gint
 _bind_port (
     const gchar *ip,
-    guint port,
+    guint16 port,
+    guchar ttl,
     GError **error)
 {
   int sock = -1;
   struct sockaddr_in address;
   int retval;
-  guchar ttl = 64, loop = 0;
+  guchar loop = 1;
   int reuseaddr = 1;
 
   address.sin_family = AF_INET;
@@ -525,21 +543,12 @@ _bind_port (
     freeaddrinfo (result);
   }
 
-  if ((sock = socket (AF_INET, SOCK_DGRAM, 0)) <= 0) {
+  if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) <= 0) {
     g_set_error (error, FS_ERROR, FS_ERROR_NETWORK,
       "Error creating socket: %s", g_strerror (errno));
     goto error;
   }
 
-  address.sin_port = htons (port);
-  retval = bind (sock, (struct sockaddr *) &address, sizeof (address));
-  if (retval != 0)
-  {
-    g_set_error (error, FS_ERROR, FS_ERROR_NETWORK,
-        "Could not bind to port %d", port);
-    goto error;
-  }
-
   if (setsockopt (sock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl,
           sizeof (ttl)) < 0)
   {
@@ -558,7 +567,6 @@ _bind_port (
     goto error;
   }
 
-
   if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &reuseaddr,
           sizeof (reuseaddr)) < 0)
   {
@@ -579,6 +587,15 @@ _bind_port (
   }
 #endif
 
+  address.sin_port = htons (port);
+  retval = bind (sock, (struct sockaddr *) &address, sizeof (address));
+  if (retval != 0)
+  {
+    g_set_error (error, FS_ERROR, FS_ERROR_NETWORK,
+        "Could not bind to port %d", port);
+    goto error;
+  }
+
   return sock;
 
  error:
@@ -681,18 +698,22 @@ _create_sinksource (gchar *elementname, GstBin *bin,
 }
 
 
-UdpPort *
+static UdpPort *
 fs_multicast_transmitter_get_udpport (FsMulticastTransmitter *trans,
     guint component_id,
     const gchar *local_ip,
-    guint port,
+    guint16 port,
+    guint8 ttl,
+    gboolean recv,
     GError **error)
 {
   UdpPort *udpport;
   GList *udpport_e;
+  gboolean sendonly = FALSE;
 
   /* First lets check if we already have one */
-  if (component_id > trans->components) {
+  if (component_id > trans->components)
+  {
     g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
       "Invalid component %d > %d", component_id, trans->components);
     return NULL;
@@ -700,13 +721,31 @@ fs_multicast_transmitter_get_udpport (FsMulticastTransmitter *trans,
 
   for (udpport_e = g_list_first (trans->priv->udpports[component_id]);
        udpport_e;
-       udpport_e = g_list_next (udpport_e)) {
+       udpport_e = g_list_next (udpport_e))
+  {
     udpport = udpport_e->data;
+
     if (port == udpport->port &&
         ((local_ip == NULL && udpport->local_ip == NULL) ||
-          !strcmp (local_ip, udpport->local_ip))) {
-      udpport->refcount++;
-      return udpport;
+          !strcmp (local_ip, udpport->local_ip)))
+    {
+      if (recv)
+      {
+        if (!udpport->sendonly)
+        {
+          udpport->refcount++;
+          return udpport;
+        }
+      }
+      else /* recv */
+      {
+        if (ttl == udpport->ttl)
+        {
+          udpport->refcount++;
+          return udpport;
+        }
+        sendonly = TRUE;
+      }
     }
   }
 
@@ -717,23 +756,29 @@ fs_multicast_transmitter_get_udpport (FsMulticastTransmitter *trans,
   udpport->fd = -1;
   udpport->component_id = component_id;
   udpport->port = port;
+  udpport->ttl = ttl;
+  udpport->sendonly = sendonly;
 
   /* Now lets bind both ports */
 
-  udpport->fd = _bind_port (local_ip, port, error);
+  udpport->fd = _bind_port (local_ip, port, ttl, error);
   if (udpport->fd < 0)
     goto error;
 
   /* Now lets create the elements */
 
   udpport->tee = trans->priv->udpsink_tees[component_id];
-  udpport->funnel = trans->priv->udpsrc_funnels[component_id];
+  if (!udpport->sendonly)
+    udpport->funnel = trans->priv->udpsrc_funnels[component_id];
 
-  udpport->udpsrc = _create_sinksource ("udpsrc",
-    GST_BIN (trans->priv->gst_src), udpport->funnel, udpport->fd, GST_PAD_SRC,
-    &udpport->udpsrc_requested_pad, error);
-  if (!udpport->udpsrc)
-    goto error;
+  if (!udpport->sendonly)
+  {
+    udpport->udpsrc = _create_sinksource ("udpsrc",
+        GST_BIN (trans->priv->gst_src), udpport->funnel, udpport->fd, GST_PAD_SRC,
+        &udpport->udpsrc_requested_pad, error);
+    if (!udpport->udpsrc)
+      goto error;
+  }
 
   udpport->udpsink = _create_sinksource ("multiudpsink",
     GST_BIN (trans->priv->gst_sink), udpport->tee, udpport->fd, GST_PAD_SINK,
@@ -756,7 +801,7 @@ fs_multicast_transmitter_get_udpport (FsMulticastTransmitter *trans,
   return NULL;
 }
 
-void
+static void
 fs_multicast_transmitter_put_udpport (FsMulticastTransmitter *trans,
   UdpPort *udpport)
 {
@@ -765,6 +810,8 @@ fs_multicast_transmitter_put_udpport (FsMulticastTransmitter *trans,
     return;
   }
 
+  g_assert (udpport->multicast_groups == NULL);
+
   trans->priv->udpports[udpport->component_id] =
     g_list_remove (trans->priv->udpports[udpport->component_id], udpport);
 
@@ -813,7 +860,7 @@ fs_multicast_transmitter_put_udpport (FsMulticastTransmitter *trans,
   g_free (udpport);
 }
 
-void
+static void
 fs_multicast_transmitter_udpport_add_dest (UdpPort *udpport,
   const gchar *ip, gint port)
 {
@@ -822,74 +869,13 @@ fs_multicast_transmitter_udpport_add_dest (UdpPort *udpport,
 }
 
 
-void
+static void
 fs_multicast_transmitter_udpport_remove_dest (UdpPort *udpport,
   const gchar *ip, gint port)
 {
   g_signal_emit_by_name (udpport->udpsink, "remove", ip, port);
 }
 
-gboolean
-fs_multicast_transmitter_udpport_sendto (UdpPort *udpport,
-  gchar *msg, size_t len, const struct sockaddr *to, socklen_t tolen,
-  GError **error)
-{
-  if (sendto (udpport->fd, msg, len, 0, to, tolen) != len) {
-    g_set_error (error, FS_ERROR, FS_ERROR_NETWORK,
-      "Could not send STUN request: %s", g_strerror (errno));
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-gulong
-fs_multicast_transmitter_udpport_connect_recv (UdpPort *udpport,
-  GCallback callback, gpointer user_data)
-{
-  GstPad *pad;
-  gulong id;
-
-  pad = gst_element_get_static_pad (udpport->udpsrc, "src");
-
-  id = gst_pad_add_buffer_probe (pad, callback, user_data);
-
-  gst_object_unref (pad);
-
-  return id;
-}
-
-
-void
-fs_multicast_transmitter_udpport_disconnect_recv (UdpPort *udpport, gulong id)
-{
-  GstPad *pad = gst_element_get_static_pad (udpport->udpsrc, "src");
-
-  gst_pad_remove_buffer_probe (pad, id);
-
-  gst_object_unref (pad);
-}
-
-gboolean
-fs_multicast_transmitter_udpport_is_pad (UdpPort *udpport, GstPad *pad)
-{
-  GstPad *mypad;
-  gboolean res;
-
-  mypad =  gst_element_get_static_pad (udpport->udpsrc, "src");
-
-  res = (mypad == pad);
-
-  gst_object_unref (mypad);
-
-  return res;
-}
-
-gint
-fs_multicast_transmitter_udpport_get_port (UdpPort *udpport)
-{
-  return udpport->port;
-}
 
 static GType
 fs_multicast_transmitter_get_stream_transmitter_type (
@@ -901,6 +887,7 @@ fs_multicast_transmitter_get_stream_transmitter_type (
 
 /*
  * The following functions are for counting the use of Multicast
+ * Each struct represents a quatuor of local_ip:port:ttl:multicast_ip
  */
 
 struct _UdpMulticastGroup
@@ -908,7 +895,6 @@ struct _UdpMulticastGroup
   UdpPort *udpport;
 
   gint refcount;
-
   gint sendcount;
 
   gchar *multicast_ip;
@@ -922,6 +908,8 @@ fs_multicast_transmitter_get_group (FsMulticastTransmitter *trans,
     const gchar *multicast_ip,
     guint port,
     const gchar *local_ip,
+    guint8 ttl,
+    gboolean recv,
     GError **error)
 {
   UdpPort *udpport;
@@ -929,7 +917,7 @@ fs_multicast_transmitter_get_group (FsMulticastTransmitter *trans,
   GList *item = NULL;
 
   udpport = fs_multicast_transmitter_get_udpport (trans, component_id,
-      local_ip, port, error);
+      local_ip, port, ttl, recv, error);
   if (!udpport)
     return NULL;
 
@@ -977,11 +965,14 @@ fs_multicast_transmitter_get_group (FsMulticastTransmitter *trans,
           &(mcast->mreqn), sizeof (mcast->mreqn)) < 0)
   {
     g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
-        "Could not join the socket to the multicast group: %s",
+        "Could not join the socket to the multicast group2: %s",
         g_strerror (errno));
     goto error;
   }
 
+  udpport->multicast_groups = g_list_prepend (udpport->multicast_groups,
+      mcast);
+
   return mcast;
 
  error:
@@ -1021,20 +1012,22 @@ fs_multicast_transmitter_put_group (FsMulticastTransmitter *trans,
 }
 
 void
-fs_multicast_transmitter_set_group_sending (UdpMulticastGroup *mcast,
-    gboolean sending)
+fs_multicast_transmitter_group_inc_sending (UdpMulticastGroup *mcast)
 {
-  if (sending) {
-    if (mcast->sendcount == 0)
-      fs_multicast_transmitter_udpport_add_dest (mcast->udpport,
-          mcast->multicast_ip, mcast->udpport->port);
-
-    mcast->sendcount++;
-  } else {
-    mcast->sendcount--;
-
-    if (mcast->sendcount == 0)
-      fs_multicast_transmitter_udpport_remove_dest (mcast->udpport,
-          mcast->multicast_ip, mcast->udpport->port);
-  }
+  if (mcast->sendcount == 0)
+    fs_multicast_transmitter_udpport_add_dest (mcast->udpport,
+        mcast->multicast_ip, mcast->udpport->port);
+
+  mcast->sendcount++;
+}
+
+
+void
+fs_multicast_transmitter_group_dec_sending (UdpMulticastGroup *mcast)
+{
+  mcast->sendcount--;
+
+  if (mcast->sendcount == 0)
+    fs_multicast_transmitter_udpport_remove_dest (mcast->udpport,
+        mcast->multicast_ip, mcast->udpport->port);
 }
diff --git a/transmitters/multicast/fs-multicast-transmitter.h b/transmitters/multicast/fs-multicast-transmitter.h
index ec66453..2100682 100644
--- a/transmitters/multicast/fs-multicast-transmitter.h
+++ b/transmitters/multicast/fs-multicast-transmitter.h
@@ -84,53 +84,26 @@ struct _FsMulticastTransmitter
 };
 
 /* Private declarations */
-typedef struct _UdpPort UdpPort;
 typedef struct _UdpMulticastGroup UdpMulticastGroup;
 
 GType fs_multicast_transmitter_get_type (void);
 
 
-
-UdpPort *fs_multicast_transmitter_get_udpport (FsMulticastTransmitter *trans,
-    guint component_id,
-    const gchar *requested_ip,
-    guint requested_port,
-    GError **error);
-
-void fs_multicast_transmitter_put_udpport (FsMulticastTransmitter *trans,
-  UdpPort *udpport);
-
-void fs_multicast_transmitter_udpport_add_dest (UdpPort *udpport,
-  const gchar *ip, gint port);
-void fs_multicast_transmitter_udpport_remove_dest (UdpPort *udpport,
-  const gchar *ip, gint port);
-
-gboolean fs_multicast_transmitter_udpport_sendto (UdpPort *udpport,
-  gchar *msg, size_t len, const struct sockaddr *to, socklen_t tolen,
-  GError **error);
-
-gulong fs_multicast_transmitter_udpport_connect_recv (UdpPort *udpport,
-  GCallback callback, gpointer user_data);
-void fs_multicast_transmitter_udpport_disconnect_recv (UdpPort *udpport,
-  gulong id);
-
-gboolean fs_multicast_transmitter_udpport_is_pad (UdpPort *udpport,
-    GstPad *pad);
-
-gboolean fs_multicast_transmitter_udpport_get_port (UdpPort *udpport);
-
-
 UdpMulticastGroup *fs_multicast_transmitter_get_group (
     FsMulticastTransmitter *trans,
     guint component_id,
     const gchar *multicast_ip,
     guint port,
     const gchar *local_ip,
+    guint8 ttl,
+    gboolean recv,
     GError **error);
 void fs_multicast_transmitter_put_group (FsMulticastTransmitter *trans,
     UdpMulticastGroup *mcast);
-void fs_multicast_transmitter_set_group_sending (UdpMulticastGroup *mcast,
-    gboolean sending);
+
+void fs_multicast_transmitter_group_inc_sending (UdpMulticastGroup *mcast);
+void fs_multicast_transmitter_group_dec_sending (UdpMulticastGroup *mcast);
+
 
 
 G_END_DECLS
-- 
1.5.6.5




More information about the farsight-commits mailing list