(dyn|multi)udpsink: Add properties to specify the bind address and port
[platform/upstream/gstreamer.git] / gst / udp / gstmultiudpsink.h
index 52ab296..a1be566 100644 (file)
@@ -1,5 +1,5 @@
 /* GStreamer
- * Copyright (C) <2005> Wim Taymand <wim@fluendo.com>
+ * Copyright (C) <2005> Wim Taymans <wim@fluendo.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -13,8 +13,8 @@
  *
  * You should have received a copy of the GNU Library General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifndef __GST_MULTIUDPSINK_H__
 
 #include <gst/gst.h>
 #include <gst/base/gstbasesink.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
 #include "gstudpnetutils.h"
-#include "gstudp.h"
 
 #define GST_TYPE_MULTIUDPSINK            (gst_multiudpsink_get_type())
 #define GST_MULTIUDPSINK(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIUDPSINK,GstMultiUDPSink))
@@ -38,11 +38,9 @@ typedef struct _GstMultiUDPSink GstMultiUDPSink;
 typedef struct _GstMultiUDPSinkClass GstMultiUDPSinkClass;
 
 typedef struct {
-  int *sock;
-
-  struct sockaddr_in theiraddr;
-  struct ip_mreq multi_addr;
+  gint refcount;
 
+  GSocketAddress *addr;
   gchar *host;
   gint port;
 
@@ -58,18 +56,35 @@ typedef struct {
 struct _GstMultiUDPSink {
   GstBaseSink parent;
 
-  int sock;
+  GSocket       *used_socket, *used_socket_v6;
+  GCancellable  *cancellable;
 
-  GMutex        *client_lock;
+  GMutex         client_lock;
   GList         *clients;
 
+  GOutputVector *vec;
+  GstMapInfo *map;
+
   /* properties */
   guint64        bytes_to_serve;
   guint64        bytes_served;
-  int            sockfd;
-  gboolean       closefd;
-
-  gboolean       externalfd;
+  GSocket       *socket, *socket_v6;
+  gboolean       close_socket;
+
+  gboolean       external_socket;
+
+  gboolean       auto_multicast;
+  gchar         *multi_iface;
+  gint           ttl;
+  gint           ttl_mc;
+  gboolean       loop;
+  gboolean       force_ipv4;
+  gint           qos_dscp;
+
+  gboolean       send_duplicates;
+  gint           buffer_size;
+  gchar         *bind_address;
+  gint           bind_port;
 };
 
 struct _GstMultiUDPSinkClass {
@@ -79,7 +94,7 @@ struct _GstMultiUDPSinkClass {
   void          (*add)          (GstMultiUDPSink *sink, const gchar *host, gint port);
   void          (*remove)       (GstMultiUDPSink *sink, const gchar *host, gint port);
   void          (*clear)        (GstMultiUDPSink *sink);
-  GValueArray*  (*get_stats)    (GstMultiUDPSink *sink, const gchar *host, gint port);
+  GstStructure* (*get_stats)    (GstMultiUDPSink *sink, const gchar *host, gint port);
 
   /* signals */
   void          (*client_added) (GstElement *element, const gchar *host, gint port);
@@ -91,7 +106,7 @@ GType gst_multiudpsink_get_type(void);
 void            gst_multiudpsink_add            (GstMultiUDPSink *sink, const gchar *host, gint port);
 void            gst_multiudpsink_remove         (GstMultiUDPSink *sink, const gchar *host, gint port);
 void            gst_multiudpsink_clear          (GstMultiUDPSink *sink);
-GValueArray*    gst_multiudpsink_get_stats      (GstMultiUDPSink *sink, const gchar *host, gint port);
+GstStructure*   gst_multiudpsink_get_stats      (GstMultiUDPSink *sink, const gchar *host, gint port);
 
 G_END_DECLS