dynudpsink: return FLUSHING when sendto got canceled, not an error
[platform/upstream/gst-plugins-good.git] / gst / udp / gstudpsrc.h
index bb4273e..c631e35 100644 (file)
@@ -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.
  */
 
 
 #define __GST_UDPSRC_H__
 
 #include <gst/gst.h>
+#include <gst/base/gstpushsrc.h>
+#include <gio/gio.h>
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif                         /* __cplusplus */
+G_BEGIN_DECLS
 
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <fcntl.h>
-#include "gstudp.h"
+#include "gstudpnetutils.h"
 
 #define GST_TYPE_UDPSRC \
   (gst_udpsrc_get_type())
 #define GST_UDPSRC(obj) \
   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_UDPSRC,GstUDPSrc))
 #define GST_UDPSRC_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_UDPSRC,GstUDPSrc))
+  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_UDPSRC,GstUDPSrcClass))
 #define GST_IS_UDPSRC(obj) \
   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_UDPSRC))
-#define GST_IS_UDPSRC_CLASS(obj) \
+#define GST_IS_UDPSRC_CLASS(klass) \
   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_UDPSRC))
+#define GST_UDPSRC_CAST(obj) ((GstUDPSrc *)(obj))
 
-  typedef struct _GstUDPSrc GstUDPSrc;
-  typedef struct _GstUDPSrcClass GstUDPSrcClass;
-
-  typedef enum
-  {
-    GST_UDPSRC_OPEN = GST_ELEMENT_FLAG_LAST,
-
-    GST_UDPSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
-  } GstUDPSrcFlags;
-
-  struct _GstUDPSrc
-  {
-    GstElement element;
-
-    /* pads */
-    GstPad *sinkpad, *srcpad;
+typedef struct _GstUDPSrc GstUDPSrc;
+typedef struct _GstUDPSrcClass GstUDPSrcClass;
 
-    int port;
-    int sock;
-    int control_sock;
-    Gst_UDP_Control control;
-    gchar *multi_group;
+struct _GstUDPSrc {
+  GstPushSrc parent;
 
-    struct sockaddr_in myaddr;
-    struct ip_mreq multi_addr;
-    GstClock *clock;
+  /* properties */
+  gchar     *address;
+  gint       port;
+  gchar     *multi_iface;
+  gint       ttl;
+  GstCaps   *caps;
+  gint       buffer_size;
+  guint64    timeout;
+  gint       skip_first_bytes;
+  GSocket   *socket;
+  gboolean   close_socket;
+  gboolean   auto_multicast;
+  gboolean   reuse;
 
-    gboolean first_buf;
-  };
+  /* our sockets */
+  GSocket   *used_socket;
+  GCancellable *cancellable;
+  GInetSocketAddress *addr;
+  gboolean   external_socket;
 
-  struct _GstUDPSrcClass
-  {
-    GstElementClass parent_class;
-  };
+  gchar     *uri;
+};
 
-  GType gst_udpsrc_get_type (void);
+struct _GstUDPSrcClass {
+  GstPushSrcClass parent_class;
+};
 
+GType gst_udpsrc_get_type(void);
 
-#ifdef __cplusplus
-}
-#endif                         /* __cplusplus */
+G_END_DECLS
 
 
-#endif                         /* __GST_UDPSRC_H__ */
+#endif /* __GST_UDPSRC_H__ */