dynudpsink: return FLUSHING when sendto got canceled, not an error
[platform/upstream/gst-plugins-good.git] / gst / udp / gstudpsrc.h
index a2cfb2e..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;
 
 struct _GstUDPSrc {
-  GstElement element;
-
-  /* pads */
-  GstPad *sinkpad,*srcpad;
-
-  int port;
-  int sock;
-  gchar *multi_group;
-
-  struct sockaddr_in myaddr;
-  struct ip_mreq multi_addr;
+  GstPushSrc parent;
+
+  /* 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;
+
+  /* our sockets */
+  GSocket   *used_socket;
+  GCancellable *cancellable;
+  GInetSocketAddress *addr;
+  gboolean   external_socket;
+
+  gchar     *uri;
 };
 
 struct _GstUDPSrcClass {
-  GstElementClass parent_class;
+  GstPushSrcClass parent_class;
 };
 
 GType gst_udpsrc_get_type(void);
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 
 #endif /* __GST_UDPSRC_H__ */