From 8e61fd923091dbdb1cefe157c8dcfecc57d166fd Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 2 Jun 2005 13:28:46 +0000 Subject: gst/udp/: Use NetBuffer and small cleanups. Original commit message from CVS: * gst/udp/Makefile.am: * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_get_type), (gst_multiudpsink_base_init), (gst_multiudpsink_class_init), (gst_multiudpsink_init), (gst_multiudpsink_finalize), (gst_multiudpsink_get_times), (gst_multiudpsink_render), (gst_multiudpsink_set_property), (gst_multiudpsink_init_send), (gst_multiudpsink_add), (client_compare), (free_client), (gst_multiudpsink_remove), (gst_multiudpsink_clear), (gst_multiudpsink_get_stats): * gst/udp/gstudpsrc.c: (gst_udpsrc_get_type), (gst_udpsrc_base_init), (gst_udpsrc_class_init), (gst_udpsrc_create), (gst_udpsrc_set_uri), (gst_udpsrc_start), (gst_udpsrc_unlock), (gst_udpsrc_stop): Use NetBuffer and small cleanups. Implement client removal in multiudpsink. --- gst/udp/gstudpsrc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gst/udp/gstudpsrc.c') diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index ffec6a02..cce25904 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -25,6 +25,7 @@ #include "gstudpsrc.h" #include #include +#include #ifdef HAVE_FIONREAD_IN_SYS_FILIO #include @@ -201,7 +202,7 @@ static GstFlowReturn gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf) { GstUDPSrc *udpsrc; - GstBuffer *outbuf; + GstNetBuffer *outbuf; struct sockaddr_in tmpaddr; socklen_t len; fd_set read_fds; @@ -286,11 +287,16 @@ gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf) break; } - outbuf = gst_buffer_new (); + outbuf = gst_netbuffer_new (); GST_BUFFER_DATA (outbuf) = pktdata; GST_BUFFER_SIZE (outbuf) = ret; - *buf = outbuf; + gst_netaddress_set_ip4_address (&outbuf->from, tmpaddr.sin_addr.s_addr, + tmpaddr.sin_port); + + GST_LOG_OBJECT (udpsrc, "read %d bytes", readsize); + + *buf = GST_BUFFER (outbuf); return GST_FLOW_OK; -- cgit