gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
/* GStreamer
|
2007-08-17 13:59:15 +00:00
|
|
|
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
|
2009-08-31 10:16:01 +00:00
|
|
|
* Copyright (C) <2009> Jarkko Palviainen <jarkko.palviainen@sesca.com>
|
2012-01-17 10:18:15 +00:00
|
|
|
* Copyright (C) <2012> Collabora Ltd.
|
|
|
|
* Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-04 00:07:18 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
*/
|
|
|
|
|
2006-02-06 15:31:16 +00:00
|
|
|
/**
|
2010-04-08 13:56:37 +00:00
|
|
|
* SECTION:element-multiudpsink
|
2018-10-22 09:39:24 +00:00
|
|
|
* @title: multiudpsink
|
2006-02-06 15:31:16 +00:00
|
|
|
* @see_also: udpsink, multifdsink
|
|
|
|
*
|
|
|
|
* multiudpsink is a network sink that sends UDP packets to multiple
|
|
|
|
* clients.
|
|
|
|
* It can be combined with rtp payload encoders to implement RTP streaming.
|
|
|
|
*/
|
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2021-02-16 13:49:56 +00:00
|
|
|
#include "gstudpelements.h"
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
#include "gstmultiudpsink.h"
|
|
|
|
|
2007-11-02 21:16:09 +00:00
|
|
|
#include <string.h>
|
2012-09-12 15:14:46 +00:00
|
|
|
|
2019-06-26 22:03:29 +00:00
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
|
2021-06-26 11:00:03 +00:00
|
|
|
#include <gio/gnetworking.h>
|
|
|
|
|
2018-11-13 12:48:11 +00:00
|
|
|
#include "gst/net/net.h"
|
2011-12-12 02:30:45 +00:00
|
|
|
#include "gst/glib-compat-private.h"
|
|
|
|
|
2006-06-22 19:31:04 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (multiudpsink_debug);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
#define GST_CAT_DEFAULT (multiudpsink_debug)
|
|
|
|
|
2011-02-16 03:33:45 +00:00
|
|
|
#define UDP_MAX_SIZE 65507
|
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
|
|
|
/* MultiUDPSink signals and args */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* methods */
|
|
|
|
SIGNAL_ADD,
|
|
|
|
SIGNAL_REMOVE,
|
|
|
|
SIGNAL_CLEAR,
|
|
|
|
SIGNAL_GET_STATS,
|
|
|
|
|
|
|
|
/* signals */
|
|
|
|
SIGNAL_CLIENT_ADDED,
|
|
|
|
SIGNAL_CLIENT_REMOVED,
|
|
|
|
|
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
#define DEFAULT_SOCKET NULL
|
|
|
|
#define DEFAULT_CLOSE_SOCKET TRUE
|
|
|
|
#define DEFAULT_USED_SOCKET NULL
|
2007-09-04 22:42:21 +00:00
|
|
|
#define DEFAULT_CLIENTS NULL
|
2008-05-21 13:47:43 +00:00
|
|
|
/* FIXME, this should be disabled by default, we don't need to join a multicast
|
|
|
|
* group for sending, if this socket is also used for receiving, it should
|
|
|
|
* be configured in the element that does the receive. */
|
2008-01-17 11:13:16 +00:00
|
|
|
#define DEFAULT_AUTO_MULTICAST TRUE
|
2012-10-10 08:55:28 +00:00
|
|
|
#define DEFAULT_MULTICAST_IFACE NULL
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
#define DEFAULT_TTL 64
|
2009-08-31 10:16:01 +00:00
|
|
|
#define DEFAULT_TTL_MC 1
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
#define DEFAULT_LOOP TRUE
|
2012-10-10 08:28:24 +00:00
|
|
|
#define DEFAULT_FORCE_IPV4 FALSE
|
2008-05-21 13:47:43 +00:00
|
|
|
#define DEFAULT_QOS_DSCP -1
|
2010-08-20 13:35:27 +00:00
|
|
|
#define DEFAULT_SEND_DUPLICATES TRUE
|
2011-01-05 11:04:03 +00:00
|
|
|
#define DEFAULT_BUFFER_SIZE 0
|
2013-05-23 16:42:09 +00:00
|
|
|
#define DEFAULT_BIND_ADDRESS NULL
|
|
|
|
#define DEFAULT_BIND_PORT 0
|
2007-08-17 13:59:15 +00:00
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
PROP_BYTES_TO_SERVE,
|
|
|
|
PROP_BYTES_SERVED,
|
2012-01-17 10:18:15 +00:00
|
|
|
PROP_SOCKET,
|
2013-04-25 10:12:23 +00:00
|
|
|
PROP_SOCKET_V6,
|
2012-01-17 10:18:15 +00:00
|
|
|
PROP_CLOSE_SOCKET,
|
|
|
|
PROP_USED_SOCKET,
|
2013-04-25 10:12:23 +00:00
|
|
|
PROP_USED_SOCKET_V6,
|
2008-01-17 11:13:16 +00:00
|
|
|
PROP_CLIENTS,
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
PROP_AUTO_MULTICAST,
|
2012-10-10 08:55:28 +00:00
|
|
|
PROP_MULTICAST_IFACE,
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
PROP_TTL,
|
2009-08-31 10:16:01 +00:00
|
|
|
PROP_TTL_MC,
|
2008-05-21 10:51:52 +00:00
|
|
|
PROP_LOOP,
|
2012-10-10 08:28:24 +00:00
|
|
|
PROP_FORCE_IPV4,
|
2008-05-21 10:51:52 +00:00
|
|
|
PROP_QOS_DSCP,
|
2010-08-20 13:35:27 +00:00
|
|
|
PROP_SEND_DUPLICATES,
|
2011-01-05 11:04:03 +00:00
|
|
|
PROP_BUFFER_SIZE,
|
2013-05-23 16:42:09 +00:00
|
|
|
PROP_BIND_ADDRESS,
|
2015-04-24 16:01:10 +00:00
|
|
|
PROP_BIND_PORT
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void gst_multiudpsink_finalize (GObject * object);
|
|
|
|
|
|
|
|
static GstFlowReturn gst_multiudpsink_render (GstBaseSink * sink,
|
|
|
|
GstBuffer * buffer);
|
2014-06-20 10:36:19 +00:00
|
|
|
static GstFlowReturn gst_multiudpsink_render_list (GstBaseSink * bsink,
|
|
|
|
GstBufferList * buffer_list);
|
2012-01-17 10:18:15 +00:00
|
|
|
|
|
|
|
static gboolean gst_multiudpsink_start (GstBaseSink * bsink);
|
|
|
|
static gboolean gst_multiudpsink_stop (GstBaseSink * bsink);
|
|
|
|
static gboolean gst_multiudpsink_unlock (GstBaseSink * bsink);
|
|
|
|
static gboolean gst_multiudpsink_unlock_stop (GstBaseSink * bsink);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
|
|
|
static void gst_multiudpsink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_multiudpsink_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
|
|
|
|
2007-09-04 22:42:21 +00:00
|
|
|
static void gst_multiudpsink_add_internal (GstMultiUDPSink * sink,
|
|
|
|
const gchar * host, gint port, gboolean lock);
|
|
|
|
static void gst_multiudpsink_clear_internal (GstMultiUDPSink * sink,
|
|
|
|
gboolean lock);
|
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
static guint gst_multiudpsink_signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
2011-04-19 15:35:47 +00:00
|
|
|
#define gst_multiudpsink_parent_class parent_class
|
|
|
|
G_DEFINE_TYPE (GstMultiUDPSink, gst_multiudpsink, GST_TYPE_BASE_SINK);
|
2021-02-16 13:49:56 +00:00
|
|
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (multiudpsink, "multiudpsink",
|
|
|
|
GST_RANK_NONE, GST_TYPE_MULTIUDPSINK, udp_element_init (plugin));
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
|
|
|
static void
|
2005-09-09 11:09:49 +00:00
|
|
|
gst_multiudpsink_class_init (GstMultiUDPSinkClass * klass)
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
GstBaseSinkClass *gstbasesink_class;
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
|
|
|
gstbasesink_class = (GstBaseSinkClass *) klass;
|
|
|
|
|
|
|
|
gobject_class->set_property = gst_multiudpsink_set_property;
|
|
|
|
gobject_class->get_property = gst_multiudpsink_get_property;
|
|
|
|
gobject_class->finalize = gst_multiudpsink_finalize;
|
|
|
|
|
2006-02-06 15:31:16 +00:00
|
|
|
/**
|
|
|
|
* GstMultiUDPSink::add:
|
|
|
|
* @gstmultiudpsink: the sink on which the signal is emitted
|
|
|
|
* @host: the hostname/IP address of the client to add
|
|
|
|
* @port: the port of the client to add
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
*
|
|
|
|
* Add a client with destination @host and @port to the list of
|
2010-08-20 13:35:27 +00:00
|
|
|
* clients. When the same host/port pair is added multiple times, the
|
|
|
|
* send-duplicates property defines if the packets are sent multiple times to
|
|
|
|
* the same host/port pair or not.
|
|
|
|
*
|
|
|
|
* When a host/port pair is added multiple times, an equal amount of remove
|
|
|
|
* calls must be performed to actually remove the host/port pair from the list
|
|
|
|
* of destinations.
|
2006-02-06 15:31:16 +00:00
|
|
|
*/
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
gst_multiudpsink_signals[SIGNAL_ADD] =
|
2011-08-31 14:04:24 +00:00
|
|
|
g_signal_new ("add", G_TYPE_FROM_CLASS (klass),
|
2012-01-26 15:46:13 +00:00
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
G_STRUCT_OFFSET (GstMultiUDPSinkClass, add),
|
2019-08-26 06:03:24 +00:00
|
|
|
NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_INT);
|
2006-02-06 15:31:16 +00:00
|
|
|
/**
|
|
|
|
* GstMultiUDPSink::remove:
|
|
|
|
* @gstmultiudpsink: the sink on which the signal is emitted
|
|
|
|
* @host: the hostname/IP address of the client to remove
|
|
|
|
* @port: the port of the client to remove
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
*
|
|
|
|
* Remove the client with destination @host and @port from the list of
|
|
|
|
* clients.
|
2006-02-06 15:31:16 +00:00
|
|
|
*/
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
gst_multiudpsink_signals[SIGNAL_REMOVE] =
|
2011-08-31 14:04:24 +00:00
|
|
|
g_signal_new ("remove", G_TYPE_FROM_CLASS (klass),
|
2012-01-26 15:46:13 +00:00
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
G_STRUCT_OFFSET (GstMultiUDPSinkClass, remove),
|
2019-08-26 06:03:24 +00:00
|
|
|
NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_INT);
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
/**
|
|
|
|
* GstMultiUDPSink::clear:
|
|
|
|
* @gstmultiudpsink: the sink on which the signal is emitted
|
|
|
|
*
|
|
|
|
* Clear the list of clients.
|
|
|
|
*/
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
gst_multiudpsink_signals[SIGNAL_CLEAR] =
|
2011-08-31 14:04:24 +00:00
|
|
|
g_signal_new ("clear", G_TYPE_FROM_CLASS (klass),
|
2012-01-26 15:46:13 +00:00
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2019-08-26 06:03:24 +00:00
|
|
|
G_STRUCT_OFFSET (GstMultiUDPSinkClass, clear), NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 0);
|
2006-02-06 15:31:16 +00:00
|
|
|
/**
|
|
|
|
* GstMultiUDPSink::get-stats:
|
|
|
|
* @gstmultiudpsink: the sink on which the signal is emitted
|
|
|
|
* @host: the hostname/IP address of the client to get stats on
|
|
|
|
* @port: the port of the client to get stats on
|
|
|
|
*
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
* Get the statistics of the client with destination @host and @port.
|
|
|
|
*
|
2019-10-11 12:20:15 +00:00
|
|
|
* Returns: a GstStructure: bytes_sent, packets_sent, connect_time
|
|
|
|
* (in epoch nanoseconds), disconnect_time (in epoch
|
|
|
|
* nanoseconds)
|
2006-02-06 15:31:16 +00:00
|
|
|
*/
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
gst_multiudpsink_signals[SIGNAL_GET_STATS] =
|
2011-08-31 14:04:24 +00:00
|
|
|
g_signal_new ("get-stats", G_TYPE_FROM_CLASS (klass),
|
2012-01-26 15:46:13 +00:00
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
G_STRUCT_OFFSET (GstMultiUDPSinkClass, get_stats),
|
2019-08-26 06:03:24 +00:00
|
|
|
NULL, NULL, NULL, GST_TYPE_STRUCTURE, 2, G_TYPE_STRING, G_TYPE_INT);
|
2006-02-06 15:31:16 +00:00
|
|
|
/**
|
|
|
|
* GstMultiUDPSink::client-added:
|
|
|
|
* @gstmultiudpsink: the sink emitting the signal
|
|
|
|
* @host: the hostname/IP address of the added client
|
|
|
|
* @port: the port of the added client
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
*
|
2018-05-23 12:14:27 +00:00
|
|
|
* Signal emitted when a new client is added to the list of
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
* clients.
|
2006-02-06 15:31:16 +00:00
|
|
|
*/
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
gst_multiudpsink_signals[SIGNAL_CLIENT_ADDED] =
|
|
|
|
g_signal_new ("client-added", G_TYPE_FROM_CLASS (klass),
|
2012-01-26 15:46:13 +00:00
|
|
|
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMultiUDPSinkClass, client_added),
|
2019-08-26 06:03:24 +00:00
|
|
|
NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_INT);
|
2006-02-06 15:31:16 +00:00
|
|
|
/**
|
|
|
|
* GstMultiUDPSink::client-removed:
|
|
|
|
* @gstmultiudpsink: the sink emitting the signal
|
|
|
|
* @host: the hostname/IP address of the removed client
|
|
|
|
* @port: the port of the removed client
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
*
|
2018-05-23 12:14:27 +00:00
|
|
|
* Signal emitted when a client is removed from the list of
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
* clients.
|
2006-02-06 15:31:16 +00:00
|
|
|
*/
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
gst_multiudpsink_signals[SIGNAL_CLIENT_REMOVED] =
|
|
|
|
g_signal_new ("client-removed", G_TYPE_FROM_CLASS (klass),
|
2012-01-26 15:46:13 +00:00
|
|
|
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMultiUDPSinkClass,
|
2019-08-26 06:03:24 +00:00
|
|
|
client_removed), NULL, NULL, NULL,
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_INT);
|
|
|
|
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BYTES_TO_SERVE,
|
|
|
|
g_param_spec_uint64 ("bytes-to-serve", "Bytes to serve",
|
|
|
|
"Number of bytes received to serve to clients", 0, G_MAXUINT64, 0,
|
2010-10-13 14:21:23 +00:00
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BYTES_SERVED,
|
|
|
|
g_param_spec_uint64 ("bytes-served", "Bytes served",
|
2012-02-09 09:11:48 +00:00
|
|
|
"Total number of bytes sent to all clients", 0, G_MAXUINT64, 0,
|
2010-10-13 14:21:23 +00:00
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
2012-01-17 10:18:15 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_SOCKET,
|
|
|
|
g_param_spec_object ("socket", "Socket Handle",
|
|
|
|
"Socket to use for UDP sending. (NULL == allocate)",
|
|
|
|
G_TYPE_SOCKET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2013-04-25 10:12:23 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_SOCKET_V6,
|
|
|
|
g_param_spec_object ("socket-v6", "Socket Handle IPv6",
|
|
|
|
"Socket to use for UDPv6 sending. (NULL == allocate)",
|
|
|
|
G_TYPE_SOCKET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2012-01-17 10:18:15 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_CLOSE_SOCKET,
|
|
|
|
g_param_spec_boolean ("close-socket", "Close socket",
|
|
|
|
"Close socket if passed as property on state change",
|
|
|
|
DEFAULT_CLOSE_SOCKET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
g_object_class_install_property (gobject_class, PROP_USED_SOCKET,
|
|
|
|
g_param_spec_object ("used-socket", "Used Socket Handle",
|
|
|
|
"Socket currently in use for UDP sending. (NULL == no socket)",
|
|
|
|
G_TYPE_SOCKET, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
2013-04-25 10:12:23 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_USED_SOCKET_V6,
|
|
|
|
g_param_spec_object ("used-socket-v6", "Used Socket Handle IPv6",
|
|
|
|
"Socket currently in use for UDPv6 sending. (NULL == no socket)",
|
|
|
|
G_TYPE_SOCKET, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
2007-09-04 22:42:21 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_CLIENTS,
|
|
|
|
g_param_spec_string ("clients", "Clients",
|
|
|
|
"A comma separated list of host:port pairs with destinations",
|
2010-10-13 14:21:23 +00:00
|
|
|
DEFAULT_CLIENTS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2008-01-17 11:13:16 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_AUTO_MULTICAST,
|
|
|
|
g_param_spec_boolean ("auto-multicast",
|
|
|
|
"Automatically join/leave multicast groups",
|
|
|
|
"Automatically join/leave the multicast groups, FALSE means user"
|
2010-10-13 14:21:23 +00:00
|
|
|
" has to do it himself", DEFAULT_AUTO_MULTICAST,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2012-10-10 08:55:28 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_MULTICAST_IFACE,
|
|
|
|
g_param_spec_string ("multicast-iface", "Multicast Interface",
|
|
|
|
"The network interface on which to join the multicast group",
|
|
|
|
DEFAULT_MULTICAST_IFACE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_TTL,
|
2009-08-31 10:16:01 +00:00
|
|
|
g_param_spec_int ("ttl", "Unicast TTL",
|
|
|
|
"Used for setting the unicast TTL parameter",
|
2010-10-13 14:21:23 +00:00
|
|
|
0, 255, DEFAULT_TTL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2009-08-31 10:16:01 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_TTL_MC,
|
|
|
|
g_param_spec_int ("ttl-mc", "Multicast TTL",
|
|
|
|
"Used for setting the multicast TTL parameter",
|
2010-10-13 14:21:23 +00:00
|
|
|
0, 255, DEFAULT_TTL_MC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_LOOP,
|
|
|
|
g_param_spec_boolean ("loop", "Multicast Loopback",
|
|
|
|
"Used for setting the multicast loop parameter. TRUE = enable,"
|
2010-10-13 14:21:23 +00:00
|
|
|
" FALSE = disable", DEFAULT_LOOP,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2012-10-10 08:28:24 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstMultiUDPSink::force-ipv4:
|
2012-10-10 08:28:24 +00:00
|
|
|
*
|
|
|
|
* Force the use of an IPv4 socket.
|
|
|
|
*
|
|
|
|
* Since: 1.0.2
|
|
|
|
*/
|
2014-11-02 16:51:23 +00:00
|
|
|
#ifndef GST_REMOVE_DEPRECATED
|
2012-10-10 08:28:24 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_FORCE_IPV4,
|
|
|
|
g_param_spec_boolean ("force-ipv4", "Force IPv4",
|
2013-04-25 10:12:23 +00:00
|
|
|
"Forcing the use of an IPv4 socket (DEPRECATED, has no effect anymore)",
|
2014-11-02 16:51:23 +00:00
|
|
|
DEFAULT_FORCE_IPV4,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED));
|
|
|
|
#endif
|
2008-05-21 10:51:52 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_QOS_DSCP,
|
2008-05-21 13:47:43 +00:00
|
|
|
g_param_spec_int ("qos-dscp", "QoS diff srv code point",
|
|
|
|
"Quality of Service, differentiated services code point (-1 default)",
|
2010-10-13 14:21:23 +00:00
|
|
|
-1, 63, DEFAULT_QOS_DSCP,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-08-20 13:35:27 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstMultiUDPSink::send-duplicates:
|
2010-08-20 13:35:27 +00:00
|
|
|
*
|
2019-09-02 12:27:35 +00:00
|
|
|
* When a host/port pair is added multiple times, send the packet to the host
|
2010-08-20 13:35:27 +00:00
|
|
|
* multiple times as well.
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEND_DUPLICATES,
|
|
|
|
g_param_spec_boolean ("send-duplicates", "Send Duplicates",
|
|
|
|
"When a distination/port pair is added multiple times, send packets "
|
|
|
|
"multiple times as well", DEFAULT_SEND_DUPLICATES,
|
2010-10-13 14:21:23 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
|
2011-01-05 11:04:03 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFFER_SIZE,
|
|
|
|
g_param_spec_int ("buffer-size", "Buffer Size",
|
|
|
|
"Size of the kernel send buffer in bytes, 0=default", 0, G_MAXINT,
|
|
|
|
DEFAULT_BUFFER_SIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2013-05-23 16:42:09 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_BIND_ADDRESS,
|
|
|
|
g_param_spec_string ("bind-address", "Bind Address",
|
|
|
|
"Address to bind the socket to", DEFAULT_BIND_ADDRESS,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
g_object_class_install_property (gobject_class, PROP_BIND_PORT,
|
|
|
|
g_param_spec_int ("bind-port", "Bind Port",
|
|
|
|
"Port to bind the socket to", 0, G_MAXUINT16,
|
|
|
|
DEFAULT_BIND_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2016-03-04 01:30:12 +00:00
|
|
|
gst_element_class_add_static_pad_template (gstelement_class, &sink_template);
|
2011-04-19 15:35:47 +00:00
|
|
|
|
2012-04-09 23:51:41 +00:00
|
|
|
gst_element_class_set_static_metadata (gstelement_class, "UDP packet sender",
|
2011-04-19 15:35:47 +00:00
|
|
|
"Sink/Network",
|
2014-06-16 15:40:07 +00:00
|
|
|
"Send data over the network via UDP to one or multiple recipients "
|
|
|
|
"which can be added or removed at runtime using action signals",
|
2011-04-19 15:35:47 +00:00
|
|
|
"Wim Taymans <wim.taymans@gmail.com>");
|
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
gstbasesink_class->render = gst_multiudpsink_render;
|
2014-06-20 10:36:19 +00:00
|
|
|
gstbasesink_class->render_list = gst_multiudpsink_render_list;
|
2012-01-17 10:18:15 +00:00
|
|
|
gstbasesink_class->start = gst_multiudpsink_start;
|
|
|
|
gstbasesink_class->stop = gst_multiudpsink_stop;
|
|
|
|
gstbasesink_class->unlock = gst_multiudpsink_unlock;
|
|
|
|
gstbasesink_class->unlock_stop = gst_multiudpsink_unlock_stop;
|
2005-09-09 11:09:49 +00:00
|
|
|
klass->add = gst_multiudpsink_add;
|
|
|
|
klass->remove = gst_multiudpsink_remove;
|
|
|
|
klass->clear = gst_multiudpsink_clear;
|
|
|
|
klass->get_stats = gst_multiudpsink_get_stats;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (multiudpsink_debug, "multiudpsink", 0, "UDP sink");
|
|
|
|
}
|
|
|
|
|
2015-05-27 14:55:56 +00:00
|
|
|
static void
|
|
|
|
gst_multiudpsink_create_cancellable (GstMultiUDPSink * sink)
|
|
|
|
{
|
|
|
|
GPollFD pollfd;
|
|
|
|
|
|
|
|
sink->cancellable = g_cancellable_new ();
|
|
|
|
sink->made_cancel_fd = g_cancellable_make_pollfd (sink->cancellable, &pollfd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_multiudpsink_free_cancellable (GstMultiUDPSink * sink)
|
|
|
|
{
|
|
|
|
if (sink->made_cancel_fd) {
|
|
|
|
g_cancellable_release_fd (sink->cancellable);
|
|
|
|
sink->made_cancel_fd = FALSE;
|
|
|
|
}
|
|
|
|
g_object_unref (sink->cancellable);
|
|
|
|
sink->cancellable = NULL;
|
|
|
|
}
|
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
static void
|
|
|
|
gst_multiudpsink_init (GstMultiUDPSink * sink)
|
|
|
|
{
|
2013-04-11 13:57:11 +00:00
|
|
|
guint max_mem;
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_init (&sink->client_lock);
|
2014-06-19 17:31:05 +00:00
|
|
|
sink->clients = NULL;
|
|
|
|
sink->num_v4_unique = 0;
|
|
|
|
sink->num_v4_all = 0;
|
|
|
|
sink->num_v6_unique = 0;
|
|
|
|
sink->num_v6_all = 0;
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
sink->socket = DEFAULT_SOCKET;
|
2013-04-25 10:12:23 +00:00
|
|
|
sink->socket_v6 = DEFAULT_SOCKET;
|
2012-01-17 10:18:15 +00:00
|
|
|
sink->used_socket = DEFAULT_USED_SOCKET;
|
2013-04-25 10:12:23 +00:00
|
|
|
sink->used_socket_v6 = DEFAULT_USED_SOCKET;
|
2012-01-17 10:18:15 +00:00
|
|
|
sink->close_socket = DEFAULT_CLOSE_SOCKET;
|
|
|
|
sink->external_socket = (sink->socket != NULL);
|
2008-01-17 11:13:16 +00:00
|
|
|
sink->auto_multicast = DEFAULT_AUTO_MULTICAST;
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
sink->ttl = DEFAULT_TTL;
|
2009-08-31 10:16:01 +00:00
|
|
|
sink->ttl_mc = DEFAULT_TTL_MC;
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
sink->loop = DEFAULT_LOOP;
|
2012-10-10 08:28:24 +00:00
|
|
|
sink->force_ipv4 = DEFAULT_FORCE_IPV4;
|
2008-05-21 10:51:52 +00:00
|
|
|
sink->qos_dscp = DEFAULT_QOS_DSCP;
|
2010-08-20 13:35:27 +00:00
|
|
|
sink->send_duplicates = DEFAULT_SEND_DUPLICATES;
|
2012-10-10 08:55:28 +00:00
|
|
|
sink->multi_iface = g_strdup (DEFAULT_MULTICAST_IFACE);
|
2012-01-17 10:18:15 +00:00
|
|
|
|
2015-05-27 14:55:56 +00:00
|
|
|
gst_multiudpsink_create_cancellable (sink);
|
2013-04-11 13:57:11 +00:00
|
|
|
|
2014-12-12 23:06:07 +00:00
|
|
|
/* pre-allocate OutputVector, MapInfo and OutputMessage arrays
|
|
|
|
* for use in the render and render_list functions */
|
2013-04-11 13:57:11 +00:00
|
|
|
max_mem = gst_buffer_get_max_memory ();
|
|
|
|
|
2014-12-12 23:06:07 +00:00
|
|
|
sink->n_vecs = max_mem;
|
|
|
|
sink->vecs = g_new (GOutputVector, sink->n_vecs);
|
|
|
|
|
|
|
|
sink->n_maps = max_mem;
|
|
|
|
sink->maps = g_new (GstMapInfo, sink->n_maps);
|
|
|
|
|
|
|
|
sink->n_messages = 1;
|
|
|
|
sink->messages = g_new (GstOutputMessage, sink->n_messages);
|
2014-06-20 10:36:19 +00:00
|
|
|
|
|
|
|
/* we assume that the number of memories per buffer can fit into a guint8 */
|
|
|
|
g_warn_if_fail (max_mem <= G_MAXUINT8);
|
2010-08-20 13:35:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstUDPClient *
|
2014-06-19 18:16:01 +00:00
|
|
|
gst_udp_client_new (GstMultiUDPSink * sink, const gchar * host, gint port)
|
2010-08-20 13:35:27 +00:00
|
|
|
{
|
|
|
|
GstUDPClient *client;
|
2012-01-17 10:18:15 +00:00
|
|
|
GInetAddress *addr;
|
2018-12-12 16:07:39 +00:00
|
|
|
GSocketAddress *sockaddr;
|
2012-01-17 10:18:15 +00:00
|
|
|
GResolver *resolver;
|
|
|
|
GError *err = NULL;
|
|
|
|
|
2018-12-12 16:07:39 +00:00
|
|
|
sockaddr = g_inet_socket_address_new_from_string (host, port);
|
|
|
|
if (!sockaddr) {
|
2012-01-17 10:18:15 +00:00
|
|
|
GList *results;
|
|
|
|
|
|
|
|
resolver = g_resolver_get_default ();
|
|
|
|
results =
|
|
|
|
g_resolver_lookup_by_name (resolver, host, sink->cancellable, &err);
|
|
|
|
if (!results)
|
|
|
|
goto name_resolve;
|
|
|
|
addr = G_INET_ADDRESS (g_object_ref (results->data));
|
2018-12-12 16:07:39 +00:00
|
|
|
sockaddr = g_inet_socket_address_new (addr, port);
|
2012-01-17 10:18:15 +00:00
|
|
|
|
|
|
|
g_resolver_free_addresses (results);
|
|
|
|
g_object_unref (resolver);
|
2018-12-12 16:07:39 +00:00
|
|
|
g_object_unref (addr);
|
2012-01-17 10:18:15 +00:00
|
|
|
}
|
2018-12-12 16:07:39 +00:00
|
|
|
addr = g_inet_socket_address_get_address (G_INET_SOCKET_ADDRESS (sockaddr));
|
2012-01-17 10:18:15 +00:00
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
|
|
|
{
|
|
|
|
gchar *ip = g_inet_address_to_string (addr);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (sink, "IP address for host %s is %s", host, ip);
|
|
|
|
g_free (ip);
|
|
|
|
}
|
|
|
|
#endif
|
2010-08-20 13:35:27 +00:00
|
|
|
|
|
|
|
client = g_slice_new0 (GstUDPClient);
|
2014-06-19 18:16:01 +00:00
|
|
|
client->ref_count = 1;
|
|
|
|
client->add_count = 0;
|
2010-08-20 13:35:27 +00:00
|
|
|
client->host = g_strdup (host);
|
|
|
|
client->port = port;
|
2018-12-12 16:07:39 +00:00
|
|
|
client->addr = sockaddr;
|
2010-08-20 13:35:27 +00:00
|
|
|
|
|
|
|
return client;
|
2012-01-17 10:18:15 +00:00
|
|
|
|
|
|
|
name_resolve:
|
|
|
|
{
|
2015-09-11 08:09:28 +00:00
|
|
|
g_clear_error (&err);
|
2012-01-17 10:18:15 +00:00
|
|
|
g_object_unref (resolver);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
2010-08-20 13:35:27 +00:00
|
|
|
}
|
|
|
|
|
2014-06-19 18:16:01 +00:00
|
|
|
/* call with client lock held */
|
2010-08-20 13:35:27 +00:00
|
|
|
static void
|
2014-06-19 18:16:01 +00:00
|
|
|
gst_udp_client_unref (GstUDPClient * client)
|
2010-08-20 13:35:27 +00:00
|
|
|
{
|
2014-06-19 18:16:01 +00:00
|
|
|
if (--client->ref_count == 0) {
|
|
|
|
g_object_unref (client->addr);
|
|
|
|
g_free (client->host);
|
|
|
|
g_slice_free (GstUDPClient, client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* call with client lock held */
|
|
|
|
static inline GstUDPClient *
|
|
|
|
gst_udp_client_ref (GstUDPClient * client)
|
|
|
|
{
|
|
|
|
++client->ref_count;
|
|
|
|
return client;
|
2010-08-20 13:35:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
client_compare (GstUDPClient * a, GstUDPClient * b)
|
|
|
|
{
|
|
|
|
if ((a->port == b->port) && (strcmp (a->host, b->host) == 0))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return 1;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_multiudpsink_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstMultiUDPSink *sink;
|
|
|
|
|
|
|
|
sink = GST_MULTIUDPSINK (object);
|
|
|
|
|
2014-06-19 18:16:01 +00:00
|
|
|
g_list_foreach (sink->clients, (GFunc) gst_udp_client_unref, NULL);
|
Fix a bunch of leaks shown by the newly-added states test.
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flac_enc_finalize):
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_class_init),
(gst_gconf_audio_sink_dispose), (gst_gconf_audio_sink_finalize):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init),
(gst_gconf_audio_src_class_init), (gst_gconf_audio_src_dispose),
(gst_gconf_audio_src_finalize), (do_toggle_element):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init),
(gst_gconf_video_sink_class_init), (gst_gconf_video_sink_finalize),
(do_toggle_element):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init),
(gst_gconf_video_src_class_init), (gst_gconf_video_src_dispose),
(gst_gconf_video_src_finalize), (do_toggle_element):
* ext/gconf/gstswitchsink.c: (gst_switch_sink_class_init),
(gst_switch_sink_reset), (gst_switch_sink_set_child):
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/shout2/gstshout2.c: (gst_shout2send_class_init),
(gst_shout2send_init), (gst_shout2send_finalize):
* gst/debug/testplugin.c: (gst_test_class_init),
(gst_test_finalize):
* gst/flx/gstflxdec.c: (gst_flxdec_class_init),
(gst_flxdec_dispose):
* gst/multipart/multipartmux.c: (gst_multipart_mux_finalize):
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_finalize):
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init),
(gst_rtspsrc_finalize):
* gst/rtsp/rtspextwms.c: (rtsp_ext_wms_free_context):
* gst/rtsp/rtspextwms.h:
* gst/smpte/gstsmpte.c: (gst_smpte_class_init),
(gst_smpte_finalize):
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_finalize):
* gst/udp/gstudpsink.c: (gst_udpsink_class_init),
(gst_udpsink_finalize):
* gst/wavparse/gstwavparse.c: (gst_wavparse_dispose),
(gst_wavparse_sink_activate):
* sys/oss/gstosssink.c: (gst_oss_sink_finalise):
* sys/oss/gstosssrc.c: (gst_oss_src_class_init),
(gst_oss_src_finalize):
* sys/v4l2/gstv4l2object.c: (gst_v4l2_object_destroy):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init),
(gst_v4l2src_finalize):
* sys/ximage/gstximagesrc.c: (gst_ximage_src_ximage_get):
Fix a bunch of leaks shown by the newly-added states test.
2007-03-04 13:52:03 +00:00
|
|
|
g_list_free (sink->clients);
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
if (sink->socket)
|
|
|
|
g_object_unref (sink->socket);
|
|
|
|
sink->socket = NULL;
|
2006-07-24 11:48:03 +00:00
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (sink->socket_v6)
|
|
|
|
g_object_unref (sink->socket_v6);
|
|
|
|
sink->socket_v6 = NULL;
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
if (sink->used_socket)
|
|
|
|
g_object_unref (sink->used_socket);
|
|
|
|
sink->used_socket = NULL;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (sink->used_socket_v6)
|
|
|
|
g_object_unref (sink->used_socket_v6);
|
|
|
|
sink->used_socket_v6 = NULL;
|
|
|
|
|
2015-05-27 14:55:56 +00:00
|
|
|
gst_multiudpsink_free_cancellable (sink);
|
2009-11-24 18:58:49 +00:00
|
|
|
|
2012-10-10 08:55:28 +00:00
|
|
|
g_free (sink->multi_iface);
|
|
|
|
sink->multi_iface = NULL;
|
|
|
|
|
2014-12-12 23:06:07 +00:00
|
|
|
g_free (sink->vecs);
|
|
|
|
sink->vecs = NULL;
|
|
|
|
g_free (sink->maps);
|
|
|
|
sink->maps = NULL;
|
|
|
|
g_free (sink->messages);
|
|
|
|
sink->messages = NULL;
|
2013-05-23 16:42:09 +00:00
|
|
|
|
|
|
|
g_free (sink->bind_address);
|
|
|
|
sink->bind_address = NULL;
|
2013-04-11 13:57:11 +00:00
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_clear (&sink->client_lock);
|
2009-11-24 18:58:49 +00:00
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2009-11-24 18:58:49 +00:00
|
|
|
}
|
|
|
|
|
2014-06-20 10:36:19 +00:00
|
|
|
static gsize
|
|
|
|
fill_vectors (GOutputVector * vecs, GstMapInfo * maps, guint n, GstBuffer * buf)
|
|
|
|
{
|
|
|
|
GstMemory *mem;
|
|
|
|
gsize size = 0;
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
g_assert (gst_buffer_n_memory (buf) == n);
|
|
|
|
|
|
|
|
for (i = 0; i < n; ++i) {
|
|
|
|
mem = gst_buffer_peek_memory (buf, i);
|
|
|
|
if (gst_memory_map (mem, &maps[i], GST_MAP_READ)) {
|
|
|
|
vecs[i].buffer = maps[i].data;
|
|
|
|
vecs[i].size = maps[i].size;
|
|
|
|
} else {
|
|
|
|
GST_WARNING ("Failed to map memory %p for reading", mem);
|
|
|
|
vecs[i].buffer = "";
|
|
|
|
vecs[i].size = 0;
|
|
|
|
}
|
|
|
|
size += vecs[i].size;
|
|
|
|
}
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gsize
|
|
|
|
gst_udp_calc_message_size (GstOutputMessage * msg)
|
|
|
|
{
|
|
|
|
gsize size = 0;
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
for (i = 0; i < msg->num_vectors; ++i)
|
|
|
|
size += msg->vectors[i].size;
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gst_udp_messsages_find_first_not_sent (GstOutputMessage * messages,
|
|
|
|
guint num_messages)
|
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
for (i = 0; i < num_messages; ++i) {
|
|
|
|
GstOutputMessage *msg = &messages[i];
|
|
|
|
|
|
|
|
if (msg->bytes_sent == 0 && gst_udp_calc_message_size (msg) > 0)
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline gchar *
|
|
|
|
gst_udp_address_get_string (GSocketAddress * addr, gchar * s, gsize size)
|
|
|
|
{
|
|
|
|
GInetSocketAddress *isa = G_INET_SOCKET_ADDRESS (addr);
|
|
|
|
GInetAddress *ia;
|
|
|
|
gchar *addr_str;
|
|
|
|
|
|
|
|
ia = g_inet_socket_address_get_address (isa);
|
|
|
|
addr_str = g_inet_address_to_string (ia);
|
|
|
|
g_snprintf (s, size, "%s:%u", addr_str, g_inet_socket_address_get_port (isa));
|
|
|
|
g_free (addr_str);
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Wrapper around g_socket_send_messages() plus error handling (ignoring).
|
|
|
|
* Returns FALSE if we got cancelled, otherwise TRUE. */
|
2017-12-19 21:47:52 +00:00
|
|
|
static GstFlowReturn
|
2014-06-20 10:36:19 +00:00
|
|
|
gst_multiudpsink_send_messages (GstMultiUDPSink * sink, GSocket * socket,
|
|
|
|
GstOutputMessage * messages, guint num_messages)
|
|
|
|
{
|
|
|
|
gboolean sent_max_size_warning = FALSE;
|
|
|
|
|
|
|
|
while (num_messages > 0) {
|
|
|
|
gchar astr[64] G_GNUC_UNUSED;
|
|
|
|
GError *err = NULL;
|
|
|
|
guint msg_size, skip, i;
|
|
|
|
gint ret, err_idx;
|
|
|
|
|
|
|
|
ret = g_socket_send_messages (socket, messages, num_messages, 0,
|
|
|
|
sink->cancellable, &err);
|
|
|
|
|
|
|
|
if (G_UNLIKELY (ret < 0)) {
|
|
|
|
GstOutputMessage *msg;
|
|
|
|
|
|
|
|
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
2017-12-19 21:47:52 +00:00
|
|
|
GstFlowReturn flow_ret;
|
|
|
|
|
2014-06-20 10:36:19 +00:00
|
|
|
g_clear_error (&err);
|
2017-12-19 21:47:52 +00:00
|
|
|
|
|
|
|
flow_ret = gst_base_sink_wait_preroll (GST_BASE_SINK (sink));
|
|
|
|
|
|
|
|
if (flow_ret == GST_FLOW_OK)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
return flow_ret;
|
2014-06-20 10:36:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
err_idx = gst_udp_messsages_find_first_not_sent (messages, num_messages);
|
|
|
|
if (err_idx < 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
msg = &messages[err_idx];
|
|
|
|
msg_size = gst_udp_calc_message_size (msg);
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (sink, "error sending %u bytes to client %s: %s", msg_size,
|
|
|
|
gst_udp_address_get_string (msg->address, astr, sizeof (astr)),
|
|
|
|
err->message);
|
|
|
|
|
|
|
|
skip = 1;
|
|
|
|
if (msg_size > UDP_MAX_SIZE) {
|
|
|
|
if (!sent_max_size_warning) {
|
|
|
|
GST_ELEMENT_WARNING (sink, RESOURCE, WRITE,
|
|
|
|
("Attempting to send a UDP packets larger than maximum size "
|
|
|
|
"(%u > %d)", msg_size, UDP_MAX_SIZE),
|
|
|
|
("Reason: %s", err ? err->message : "unknown reason"));
|
|
|
|
sent_max_size_warning = FALSE;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
GST_ELEMENT_WARNING (sink, RESOURCE, WRITE,
|
|
|
|
("Error sending UDP packets"), ("client %s, reason: %s",
|
|
|
|
gst_udp_address_get_string (msg->address, astr, sizeof (astr)),
|
|
|
|
(err != NULL) ? err->message : "unknown reason"));
|
|
|
|
|
|
|
|
for (i = err_idx + 1; i < num_messages; ++i, ++skip) {
|
|
|
|
if (messages[i].address != msg->address)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (sink, "skipping %d message(s) to same client", skip);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ignore any errors and try sending the rest */
|
|
|
|
g_clear_error (&err);
|
|
|
|
ret = skip;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_assert (ret <= num_messages);
|
|
|
|
|
|
|
|
messages += ret;
|
|
|
|
num_messages -= ret;
|
|
|
|
}
|
|
|
|
|
2017-12-19 21:47:52 +00:00
|
|
|
return GST_FLOW_OK;
|
2014-06-20 10:36:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_multiudpsink_render_buffers (GstMultiUDPSink * sink, GstBuffer ** buffers,
|
|
|
|
guint num_buffers, guint8 * mem_nums, guint total_mem_num)
|
|
|
|
{
|
|
|
|
GstOutputMessage *msgs;
|
|
|
|
gboolean send_duplicates;
|
|
|
|
GstUDPClient **clients;
|
|
|
|
GOutputVector *vecs;
|
|
|
|
GstMapInfo *map_infos;
|
|
|
|
GstFlowReturn flow_ret;
|
|
|
|
guint num_addr_v4, num_addr_v6;
|
|
|
|
guint num_addr, num_msgs;
|
|
|
|
guint i, j, mem;
|
|
|
|
gsize size = 0;
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
send_duplicates = sink->send_duplicates;
|
|
|
|
|
|
|
|
g_mutex_lock (&sink->client_lock);
|
|
|
|
|
|
|
|
if (send_duplicates) {
|
|
|
|
num_addr_v4 = sink->num_v4_all;
|
|
|
|
num_addr_v6 = sink->num_v6_all;
|
|
|
|
} else {
|
|
|
|
num_addr_v4 = sink->num_v4_unique;
|
|
|
|
num_addr_v6 = sink->num_v6_unique;
|
|
|
|
}
|
|
|
|
num_addr = num_addr_v4 + num_addr_v6;
|
|
|
|
|
|
|
|
if (num_addr == 0)
|
|
|
|
goto no_clients;
|
|
|
|
|
|
|
|
clients = g_newa (GstUDPClient *, num_addr);
|
|
|
|
for (l = sink->clients, i = 0; l != NULL; l = l->next) {
|
|
|
|
GstUDPClient *client = l->data;
|
|
|
|
|
|
|
|
clients[i++] = gst_udp_client_ref (client);
|
|
|
|
for (j = 1; send_duplicates && j < client->add_count; ++j)
|
|
|
|
clients[i++] = gst_udp_client_ref (client);
|
|
|
|
}
|
|
|
|
g_assert_cmpuint (i, ==, num_addr);
|
|
|
|
|
|
|
|
g_mutex_unlock (&sink->client_lock);
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (sink, "%u buffers, %u memories -> to be sent to %u clients",
|
|
|
|
num_buffers, total_mem_num, num_addr);
|
|
|
|
|
2014-12-12 23:06:07 +00:00
|
|
|
/* ensure our pre-allocated scratch space arrays are large enough */
|
|
|
|
if (sink->n_vecs < total_mem_num) {
|
|
|
|
sink->n_vecs = GST_ROUND_UP_16 (total_mem_num);
|
|
|
|
g_free (sink->vecs);
|
|
|
|
sink->vecs = g_new (GOutputVector, sink->n_vecs);
|
|
|
|
}
|
|
|
|
vecs = sink->vecs;
|
|
|
|
|
|
|
|
if (sink->n_maps < total_mem_num) {
|
|
|
|
sink->n_maps = GST_ROUND_UP_16 (total_mem_num);
|
|
|
|
g_free (sink->maps);
|
|
|
|
sink->maps = g_new (GstMapInfo, sink->n_maps);
|
|
|
|
}
|
|
|
|
map_infos = sink->maps;
|
2014-06-20 10:36:19 +00:00
|
|
|
|
|
|
|
num_msgs = num_addr * num_buffers;
|
2014-12-12 23:06:07 +00:00
|
|
|
if (sink->n_messages < num_msgs) {
|
|
|
|
sink->n_messages = GST_ROUND_UP_16 (num_msgs);
|
|
|
|
g_free (sink->messages);
|
|
|
|
sink->messages = g_new (GstOutputMessage, sink->n_messages);
|
|
|
|
}
|
|
|
|
msgs = sink->messages;
|
2014-06-20 10:36:19 +00:00
|
|
|
|
|
|
|
/* populate first num_buffers messages with output vectors for the buffers */
|
|
|
|
for (i = 0, mem = 0; i < num_buffers; ++i) {
|
|
|
|
size += fill_vectors (&vecs[mem], &map_infos[mem], mem_nums[i], buffers[i]);
|
|
|
|
msgs[i].vectors = &vecs[mem];
|
|
|
|
msgs[i].num_vectors = mem_nums[i];
|
|
|
|
msgs[i].num_control_messages = 0;
|
2016-08-11 22:32:21 +00:00
|
|
|
msgs[i].bytes_sent = 0;
|
2014-06-20 10:36:19 +00:00
|
|
|
msgs[i].control_messages = NULL;
|
|
|
|
msgs[i].address = clients[0]->addr;
|
|
|
|
mem += mem_nums[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: how about some locking? (there wasn't any before either, but..) */
|
|
|
|
sink->bytes_to_serve += size;
|
|
|
|
|
|
|
|
/* now copy the pre-filled num_buffer messages over to the next num_buffer
|
2019-09-02 12:27:35 +00:00
|
|
|
* messages for the next client, where we also change the target address */
|
2014-06-20 10:36:19 +00:00
|
|
|
for (i = 1; i < num_addr; ++i) {
|
|
|
|
for (j = 0; j < num_buffers; ++j) {
|
|
|
|
msgs[i * num_buffers + j] = msgs[j];
|
|
|
|
msgs[i * num_buffers + j].address = clients[i]->addr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now send it! */
|
|
|
|
|
2017-12-19 21:47:52 +00:00
|
|
|
/* no IPv4 socket? Send it all from the IPv6 socket then.. */
|
|
|
|
if (sink->used_socket == NULL) {
|
|
|
|
flow_ret = gst_multiudpsink_send_messages (sink, sink->used_socket_v6,
|
|
|
|
msgs, num_msgs);
|
|
|
|
} else {
|
|
|
|
guint num_msgs_v4 = num_buffers * num_addr_v4;
|
|
|
|
guint num_msgs_v6 = num_buffers * num_addr_v6;
|
2014-06-20 10:36:19 +00:00
|
|
|
|
2017-12-19 21:47:52 +00:00
|
|
|
/* our client list is sorted with IPv4 clients first and IPv6 ones last */
|
|
|
|
flow_ret = gst_multiudpsink_send_messages (sink, sink->used_socket,
|
|
|
|
msgs, num_msgs_v4);
|
2014-06-20 10:36:19 +00:00
|
|
|
|
2017-12-19 21:47:52 +00:00
|
|
|
if (flow_ret != GST_FLOW_OK)
|
2014-06-20 10:36:19 +00:00
|
|
|
goto cancelled;
|
2017-12-19 21:47:52 +00:00
|
|
|
|
|
|
|
flow_ret = gst_multiudpsink_send_messages (sink, sink->used_socket_v6,
|
|
|
|
msgs + num_msgs_v4, num_msgs_v6);
|
2014-06-20 10:36:19 +00:00
|
|
|
}
|
|
|
|
|
2017-12-19 21:47:52 +00:00
|
|
|
if (flow_ret != GST_FLOW_OK)
|
|
|
|
goto cancelled;
|
2014-06-20 10:36:19 +00:00
|
|
|
|
|
|
|
/* now update stats */
|
|
|
|
g_mutex_lock (&sink->client_lock);
|
|
|
|
|
|
|
|
for (i = 0; i < num_addr; ++i) {
|
|
|
|
GstUDPClient *client = clients[i];
|
|
|
|
|
|
|
|
for (j = 0; j < num_buffers; ++j) {
|
|
|
|
gsize bytes_sent;
|
|
|
|
|
|
|
|
bytes_sent = msgs[i * num_buffers + j].bytes_sent;
|
|
|
|
|
|
|
|
client->bytes_sent += bytes_sent;
|
|
|
|
client->packets_sent++;
|
|
|
|
sink->bytes_served += bytes_sent;
|
|
|
|
}
|
|
|
|
gst_udp_client_unref (client);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_unlock (&sink->client_lock);
|
|
|
|
|
|
|
|
out:
|
|
|
|
|
|
|
|
for (i = 0; i < mem; ++i)
|
|
|
|
gst_memory_unmap (map_infos[i].memory, &map_infos[i]);
|
|
|
|
|
2015-03-10 09:31:20 +00:00
|
|
|
return flow_ret;
|
2014-06-20 10:36:19 +00:00
|
|
|
|
|
|
|
no_clients:
|
|
|
|
{
|
|
|
|
g_mutex_unlock (&sink->client_lock);
|
|
|
|
GST_LOG_OBJECT (sink, "no clients");
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
cancelled:
|
|
|
|
{
|
|
|
|
GST_INFO_OBJECT (sink, "cancelled");
|
|
|
|
|
|
|
|
g_mutex_lock (&sink->client_lock);
|
|
|
|
for (i = 0; i < num_addr; ++i)
|
|
|
|
gst_udp_client_unref (clients[i]);
|
|
|
|
g_mutex_unlock (&sink->client_lock);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_multiudpsink_render_list (GstBaseSink * bsink, GstBufferList * buffer_list)
|
|
|
|
{
|
|
|
|
GstMultiUDPSink *sink;
|
|
|
|
GstBuffer **buffers;
|
|
|
|
GstFlowReturn flow;
|
|
|
|
guint8 *mem_nums;
|
|
|
|
guint total_mems;
|
|
|
|
guint i, num_buffers;
|
|
|
|
|
|
|
|
sink = GST_MULTIUDPSINK_CAST (bsink);
|
|
|
|
|
|
|
|
num_buffers = gst_buffer_list_length (buffer_list);
|
|
|
|
if (num_buffers == 0)
|
|
|
|
goto no_data;
|
|
|
|
|
|
|
|
buffers = g_newa (GstBuffer *, num_buffers);
|
|
|
|
mem_nums = g_newa (guint8, num_buffers);
|
|
|
|
for (i = 0, total_mems = 0; i < num_buffers; ++i) {
|
|
|
|
buffers[i] = gst_buffer_list_get (buffer_list, i);
|
|
|
|
mem_nums[i] = gst_buffer_n_memory (buffers[i]);
|
|
|
|
total_mems += mem_nums[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
flow = gst_multiudpsink_render_buffers (sink, buffers, num_buffers,
|
|
|
|
mem_nums, total_mems);
|
|
|
|
|
|
|
|
return flow;
|
|
|
|
|
|
|
|
no_data:
|
|
|
|
{
|
|
|
|
GST_LOG_OBJECT (sink, "empty buffer");
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-16 13:04:15 +00:00
|
|
|
static GstFlowReturn
|
2011-04-05 17:15:11 +00:00
|
|
|
gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
|
2009-06-16 13:04:15 +00:00
|
|
|
{
|
|
|
|
GstMultiUDPSink *sink;
|
2014-06-24 00:16:37 +00:00
|
|
|
GstFlowReturn flow;
|
|
|
|
guint8 n_mem;
|
2009-06-16 13:04:15 +00:00
|
|
|
|
2014-06-19 13:59:48 +00:00
|
|
|
sink = GST_MULTIUDPSINK_CAST (bsink);
|
2009-06-16 13:04:15 +00:00
|
|
|
|
2011-04-05 17:15:11 +00:00
|
|
|
n_mem = gst_buffer_n_memory (buffer);
|
2012-10-10 09:32:17 +00:00
|
|
|
|
2014-06-24 00:16:37 +00:00
|
|
|
if (n_mem > 0)
|
|
|
|
flow = gst_multiudpsink_render_buffers (sink, &buffer, 1, &n_mem, n_mem);
|
|
|
|
else
|
|
|
|
flow = GST_FLOW_OK;
|
2013-10-14 14:23:25 +00:00
|
|
|
|
2014-06-24 00:16:37 +00:00
|
|
|
return flow;
|
2009-06-16 13:04:15 +00:00
|
|
|
}
|
|
|
|
|
2007-09-04 22:42:21 +00:00
|
|
|
static void
|
|
|
|
gst_multiudpsink_set_clients_string (GstMultiUDPSink * sink,
|
|
|
|
const gchar * string)
|
|
|
|
{
|
|
|
|
gchar **clients;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
clients = g_strsplit (string, ",", 0);
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&sink->client_lock);
|
2007-09-04 22:42:21 +00:00
|
|
|
/* clear all existing clients */
|
|
|
|
gst_multiudpsink_clear_internal (sink, FALSE);
|
|
|
|
for (i = 0; clients[i]; i++) {
|
|
|
|
gchar *host, *p;
|
2012-01-17 10:18:15 +00:00
|
|
|
gint64 port = 0;
|
2007-09-04 22:42:21 +00:00
|
|
|
|
|
|
|
host = clients[i];
|
|
|
|
p = strstr (clients[i], ":");
|
|
|
|
if (p != NULL) {
|
|
|
|
*p = '\0';
|
2012-01-17 10:18:15 +00:00
|
|
|
port = g_ascii_strtoll (p + 1, NULL, 10);
|
2007-09-04 22:42:21 +00:00
|
|
|
}
|
|
|
|
if (port != 0)
|
|
|
|
gst_multiudpsink_add_internal (sink, host, port, FALSE);
|
|
|
|
}
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
2007-09-04 22:42:21 +00:00
|
|
|
|
|
|
|
g_strfreev (clients);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar *
|
|
|
|
gst_multiudpsink_get_clients_string (GstMultiUDPSink * sink)
|
|
|
|
{
|
|
|
|
GString *str;
|
|
|
|
GList *clients;
|
|
|
|
|
|
|
|
str = g_string_new ("");
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&sink->client_lock);
|
2007-09-04 22:42:21 +00:00
|
|
|
clients = sink->clients;
|
|
|
|
while (clients) {
|
|
|
|
GstUDPClient *client;
|
2010-08-20 13:35:27 +00:00
|
|
|
gint count;
|
2007-09-04 22:42:21 +00:00
|
|
|
|
|
|
|
client = (GstUDPClient *) clients->data;
|
|
|
|
|
|
|
|
clients = g_list_next (clients);
|
|
|
|
|
2014-06-19 18:16:01 +00:00
|
|
|
count = client->add_count;
|
2010-08-20 13:35:27 +00:00
|
|
|
while (count--) {
|
|
|
|
g_string_append_printf (str, "%s:%d%s", client->host, client->port,
|
|
|
|
(clients || count > 1 ? "," : ""));
|
|
|
|
}
|
2007-09-04 22:42:21 +00:00
|
|
|
}
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
2007-09-04 22:42:21 +00:00
|
|
|
|
|
|
|
return g_string_free (str, FALSE);
|
|
|
|
}
|
|
|
|
|
2008-05-21 10:51:52 +00:00
|
|
|
static void
|
2013-04-25 10:12:23 +00:00
|
|
|
gst_multiudpsink_setup_qos_dscp (GstMultiUDPSink * sink, GSocket * socket)
|
2008-05-21 10:51:52 +00:00
|
|
|
{
|
2008-05-21 13:47:43 +00:00
|
|
|
/* don't touch on -1 */
|
|
|
|
if (sink->qos_dscp < 0)
|
|
|
|
return;
|
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (socket == NULL)
|
2008-05-21 10:51:52 +00:00
|
|
|
return;
|
|
|
|
|
2018-11-13 12:48:11 +00:00
|
|
|
if (!gst_net_utils_set_socket_tos (socket, sink->qos_dscp))
|
|
|
|
GST_ERROR_OBJECT (sink, "could not set qos dscp: %d", sink->qos_dscp);
|
2008-05-21 10:51:52 +00:00
|
|
|
}
|
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
static void
|
|
|
|
gst_multiudpsink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstMultiUDPSink *udpsink;
|
|
|
|
|
|
|
|
udpsink = GST_MULTIUDPSINK (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
2012-01-17 10:18:15 +00:00
|
|
|
case PROP_SOCKET:
|
|
|
|
if (udpsink->socket != NULL && udpsink->socket != udpsink->used_socket &&
|
|
|
|
udpsink->close_socket) {
|
|
|
|
GError *err = NULL;
|
|
|
|
|
|
|
|
if (!g_socket_close (udpsink->socket, &err)) {
|
|
|
|
GST_ERROR ("failed to close socket %p: %s", udpsink->socket,
|
|
|
|
err->message);
|
|
|
|
g_clear_error (&err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (udpsink->socket)
|
|
|
|
g_object_unref (udpsink->socket);
|
|
|
|
udpsink->socket = g_value_dup_object (value);
|
|
|
|
GST_DEBUG_OBJECT (udpsink, "setting socket to %p", udpsink->socket);
|
2007-08-17 13:59:15 +00:00
|
|
|
break;
|
2013-04-25 10:12:23 +00:00
|
|
|
case PROP_SOCKET_V6:
|
|
|
|
if (udpsink->socket_v6 != NULL
|
|
|
|
&& udpsink->socket_v6 != udpsink->used_socket_v6
|
|
|
|
&& udpsink->close_socket) {
|
|
|
|
GError *err = NULL;
|
|
|
|
|
|
|
|
if (!g_socket_close (udpsink->socket_v6, &err)) {
|
|
|
|
GST_ERROR ("failed to close socket %p: %s", udpsink->socket_v6,
|
|
|
|
err->message);
|
|
|
|
g_clear_error (&err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (udpsink->socket_v6)
|
|
|
|
g_object_unref (udpsink->socket_v6);
|
|
|
|
udpsink->socket_v6 = g_value_dup_object (value);
|
|
|
|
GST_DEBUG_OBJECT (udpsink, "setting socket to %p", udpsink->socket_v6);
|
|
|
|
break;
|
2012-01-17 10:18:15 +00:00
|
|
|
case PROP_CLOSE_SOCKET:
|
|
|
|
udpsink->close_socket = g_value_get_boolean (value);
|
2007-08-17 13:59:15 +00:00
|
|
|
break;
|
2007-09-04 22:42:21 +00:00
|
|
|
case PROP_CLIENTS:
|
|
|
|
gst_multiudpsink_set_clients_string (udpsink, g_value_get_string (value));
|
|
|
|
break;
|
2008-01-17 11:13:16 +00:00
|
|
|
case PROP_AUTO_MULTICAST:
|
|
|
|
udpsink->auto_multicast = g_value_get_boolean (value);
|
|
|
|
break;
|
2012-10-10 08:55:28 +00:00
|
|
|
case PROP_MULTICAST_IFACE:
|
|
|
|
g_free (udpsink->multi_iface);
|
|
|
|
|
|
|
|
if (g_value_get_string (value) == NULL)
|
|
|
|
udpsink->multi_iface = g_strdup (DEFAULT_MULTICAST_IFACE);
|
|
|
|
else
|
|
|
|
udpsink->multi_iface = g_value_dup_string (value);
|
|
|
|
break;
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
case PROP_TTL:
|
|
|
|
udpsink->ttl = g_value_get_int (value);
|
|
|
|
break;
|
2009-08-31 10:16:01 +00:00
|
|
|
case PROP_TTL_MC:
|
|
|
|
udpsink->ttl_mc = g_value_get_int (value);
|
|
|
|
break;
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
case PROP_LOOP:
|
|
|
|
udpsink->loop = g_value_get_boolean (value);
|
|
|
|
break;
|
2012-10-10 08:28:24 +00:00
|
|
|
case PROP_FORCE_IPV4:
|
|
|
|
udpsink->force_ipv4 = g_value_get_boolean (value);
|
|
|
|
break;
|
2008-05-21 10:51:52 +00:00
|
|
|
case PROP_QOS_DSCP:
|
2008-09-23 17:31:22 +00:00
|
|
|
udpsink->qos_dscp = g_value_get_int (value);
|
2013-04-25 10:12:23 +00:00
|
|
|
gst_multiudpsink_setup_qos_dscp (udpsink, udpsink->used_socket);
|
|
|
|
gst_multiudpsink_setup_qos_dscp (udpsink, udpsink->used_socket_v6);
|
2008-05-21 10:51:52 +00:00
|
|
|
break;
|
2010-08-20 13:35:27 +00:00
|
|
|
case PROP_SEND_DUPLICATES:
|
|
|
|
udpsink->send_duplicates = g_value_get_boolean (value);
|
|
|
|
break;
|
2011-01-05 11:04:03 +00:00
|
|
|
case PROP_BUFFER_SIZE:
|
|
|
|
udpsink->buffer_size = g_value_get_int (value);
|
|
|
|
break;
|
2013-05-23 16:42:09 +00:00
|
|
|
case PROP_BIND_ADDRESS:
|
|
|
|
g_free (udpsink->bind_address);
|
|
|
|
udpsink->bind_address = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
case PROP_BIND_PORT:
|
|
|
|
udpsink->bind_port = g_value_get_int (value);
|
|
|
|
break;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_multiudpsink_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstMultiUDPSink *udpsink;
|
|
|
|
|
|
|
|
udpsink = GST_MULTIUDPSINK (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
case PROP_BYTES_TO_SERVE:
|
|
|
|
g_value_set_uint64 (value, udpsink->bytes_to_serve);
|
|
|
|
break;
|
|
|
|
case PROP_BYTES_SERVED:
|
|
|
|
g_value_set_uint64 (value, udpsink->bytes_served);
|
|
|
|
break;
|
2012-01-17 10:18:15 +00:00
|
|
|
case PROP_SOCKET:
|
|
|
|
g_value_set_object (value, udpsink->socket);
|
2007-08-17 13:59:15 +00:00
|
|
|
break;
|
2013-05-23 15:25:29 +00:00
|
|
|
case PROP_SOCKET_V6:
|
|
|
|
g_value_set_object (value, udpsink->socket_v6);
|
|
|
|
break;
|
2012-01-17 10:18:15 +00:00
|
|
|
case PROP_CLOSE_SOCKET:
|
|
|
|
g_value_set_boolean (value, udpsink->close_socket);
|
2007-08-17 13:59:15 +00:00
|
|
|
break;
|
2012-01-17 10:18:15 +00:00
|
|
|
case PROP_USED_SOCKET:
|
|
|
|
g_value_set_object (value, udpsink->used_socket);
|
2007-08-17 13:59:15 +00:00
|
|
|
break;
|
2013-05-23 15:25:29 +00:00
|
|
|
case PROP_USED_SOCKET_V6:
|
|
|
|
g_value_set_object (value, udpsink->used_socket_v6);
|
|
|
|
break;
|
2007-09-04 22:42:21 +00:00
|
|
|
case PROP_CLIENTS:
|
|
|
|
g_value_take_string (value,
|
|
|
|
gst_multiudpsink_get_clients_string (udpsink));
|
|
|
|
break;
|
2008-01-17 11:13:16 +00:00
|
|
|
case PROP_AUTO_MULTICAST:
|
|
|
|
g_value_set_boolean (value, udpsink->auto_multicast);
|
|
|
|
break;
|
2012-10-10 08:55:28 +00:00
|
|
|
case PROP_MULTICAST_IFACE:
|
|
|
|
g_value_set_string (value, udpsink->multi_iface);
|
|
|
|
break;
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
case PROP_TTL:
|
|
|
|
g_value_set_int (value, udpsink->ttl);
|
|
|
|
break;
|
2009-08-31 10:16:01 +00:00
|
|
|
case PROP_TTL_MC:
|
|
|
|
g_value_set_int (value, udpsink->ttl_mc);
|
|
|
|
break;
|
gst/udp/gstudpnetutils.*: Provide a bunch of helper methods to deal with IPv4 and IPv6 transparently.
Original commit message from CVS:
Patch by: Bruno Santos <brunof at ua dot pt>
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr),
(gst_udp_join_group), (gst_udp_leave_group),
(gst_udp_is_multicast):
* gst/udp/gstudpnetutils.h:
Provide a bunch of helper methods to deal with IPv4 and IPv6
transparently.
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_init), (gst_multiudpsink_set_property),
(gst_multiudpsink_get_property), (join_multicast),
(gst_multiudpsink_init_send), (gst_multiudpsink_add_internal),
(gst_multiudpsink_remove):
* gst/udp/gstmultiudpsink.h:
Add multicast TTL and loopback properties.
Use the helper methods to implement ip4 and ip6.
* gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
* gst/udp/gstudpsrc.h:
Use the helper methods to implement ip4 and ip6.
Fixes #515962.
2008-05-21 09:56:02 +00:00
|
|
|
case PROP_LOOP:
|
|
|
|
g_value_set_boolean (value, udpsink->loop);
|
|
|
|
break;
|
2012-10-10 08:28:24 +00:00
|
|
|
case PROP_FORCE_IPV4:
|
|
|
|
g_value_set_boolean (value, udpsink->force_ipv4);
|
|
|
|
break;
|
2008-05-21 10:51:52 +00:00
|
|
|
case PROP_QOS_DSCP:
|
|
|
|
g_value_set_int (value, udpsink->qos_dscp);
|
|
|
|
break;
|
2010-08-20 13:35:27 +00:00
|
|
|
case PROP_SEND_DUPLICATES:
|
|
|
|
g_value_set_boolean (value, udpsink->send_duplicates);
|
|
|
|
break;
|
2011-01-05 11:04:03 +00:00
|
|
|
case PROP_BUFFER_SIZE:
|
|
|
|
g_value_set_int (value, udpsink->buffer_size);
|
|
|
|
break;
|
2013-05-23 16:42:09 +00:00
|
|
|
case PROP_BIND_ADDRESS:
|
|
|
|
g_value_set_string (value, udpsink->bind_address);
|
|
|
|
break;
|
|
|
|
case PROP_BIND_PORT:
|
|
|
|
g_value_set_int (value, udpsink->bind_port);
|
|
|
|
break;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-05 12:47:33 +00:00
|
|
|
static gboolean
|
|
|
|
gst_multiudpsink_configure_client (GstMultiUDPSink * sink,
|
|
|
|
GstUDPClient * client)
|
|
|
|
{
|
2012-01-17 10:18:15 +00:00
|
|
|
GInetSocketAddress *saddr = G_INET_SOCKET_ADDRESS (client->addr);
|
|
|
|
GInetAddress *addr = g_inet_socket_address_get_address (saddr);
|
2013-04-25 10:12:23 +00:00
|
|
|
GSocketFamily family = g_socket_address_get_family (G_SOCKET_ADDRESS (saddr));
|
|
|
|
GSocket *socket;
|
2012-01-17 10:18:15 +00:00
|
|
|
GError *err = NULL;
|
|
|
|
|
2010-03-05 12:47:33 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "configuring client %p", client);
|
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (family == G_SOCKET_FAMILY_IPV6 && !sink->used_socket_v6)
|
|
|
|
goto invalid_family;
|
|
|
|
|
|
|
|
/* Select socket to send from for this address */
|
|
|
|
if (family == G_SOCKET_FAMILY_IPV6 || !sink->used_socket)
|
|
|
|
socket = sink->used_socket_v6;
|
|
|
|
else
|
|
|
|
socket = sink->used_socket;
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
if (g_inet_address_get_is_multicast (addr)) {
|
2010-03-05 12:47:33 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "we have a multicast client %p", client);
|
|
|
|
if (sink->auto_multicast) {
|
|
|
|
GST_DEBUG_OBJECT (sink, "autojoining group");
|
2013-04-25 10:12:23 +00:00
|
|
|
if (!g_socket_join_multicast_group (socket, addr, FALSE,
|
2012-10-10 08:55:28 +00:00
|
|
|
sink->multi_iface, &err))
|
2010-03-05 12:47:33 +00:00
|
|
|
goto join_group_failed;
|
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (sink, "setting loop to %d", sink->loop);
|
2013-04-25 10:12:23 +00:00
|
|
|
g_socket_set_multicast_loopback (socket, sink->loop);
|
2010-03-05 12:47:33 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "setting ttl to %d", sink->ttl_mc);
|
2013-04-25 10:12:23 +00:00
|
|
|
g_socket_set_multicast_ttl (socket, sink->ttl_mc);
|
2010-03-05 12:47:33 +00:00
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (sink, "setting unicast ttl to %d", sink->ttl);
|
2013-04-25 10:12:23 +00:00
|
|
|
g_socket_set_ttl (socket, sink->ttl);
|
2010-03-05 12:47:33 +00:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
join_group_failed:
|
|
|
|
{
|
2012-01-17 10:18:15 +00:00
|
|
|
gst_multiudpsink_stop (GST_BASE_SINK (sink));
|
2010-03-05 12:47:33 +00:00
|
|
|
GST_ELEMENT_ERROR (sink, RESOURCE, SETTINGS, (NULL),
|
2012-08-22 15:23:25 +00:00
|
|
|
("Could not join multicast group: %s",
|
|
|
|
err ? err->message : "unknown reason"));
|
2012-01-17 10:18:15 +00:00
|
|
|
g_clear_error (&err);
|
2010-03-05 12:47:33 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2013-04-25 10:12:23 +00:00
|
|
|
invalid_family:
|
|
|
|
{
|
|
|
|
gst_multiudpsink_stop (GST_BASE_SINK (sink));
|
|
|
|
GST_ELEMENT_ERROR (sink, RESOURCE, SETTINGS, (NULL),
|
|
|
|
("Invalid address family (got %d)", family));
|
|
|
|
return FALSE;
|
|
|
|
}
|
2010-03-05 12:47:33 +00:00
|
|
|
}
|
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
/* create a socket for sending to remote machine */
|
|
|
|
static gboolean
|
2012-01-17 10:18:15 +00:00
|
|
|
gst_multiudpsink_start (GstBaseSink * bsink)
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
{
|
2012-01-17 10:18:15 +00:00
|
|
|
GstMultiUDPSink *sink;
|
2006-07-10 10:21:57 +00:00
|
|
|
GList *clients;
|
|
|
|
GstUDPClient *client;
|
2012-01-17 10:18:15 +00:00
|
|
|
GError *err = NULL;
|
|
|
|
|
|
|
|
sink = GST_MULTIUDPSINK (bsink);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
sink->external_socket = FALSE;
|
2007-08-17 13:59:15 +00:00
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (sink->socket) {
|
2010-03-05 12:47:33 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "using configured socket");
|
2013-04-25 10:12:23 +00:00
|
|
|
if (g_socket_get_family (sink->socket) == G_SOCKET_FAMILY_IPV6) {
|
|
|
|
sink->used_socket_v6 = G_SOCKET (g_object_ref (sink->socket));
|
|
|
|
sink->external_socket = TRUE;
|
|
|
|
} else {
|
|
|
|
sink->used_socket = G_SOCKET (g_object_ref (sink->socket));
|
|
|
|
sink->external_socket = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sink->socket_v6) {
|
|
|
|
GST_DEBUG_OBJECT (sink, "using configured IPv6 socket");
|
2016-04-25 13:03:14 +00:00
|
|
|
g_return_val_if_fail (!sink->socket || g_socket_get_family (sink->socket) !=
|
2013-04-25 10:12:23 +00:00
|
|
|
G_SOCKET_FAMILY_IPV6, FALSE);
|
|
|
|
|
|
|
|
if (sink->used_socket_v6 && sink->used_socket_v6 != sink->socket_v6) {
|
|
|
|
GST_ERROR_OBJECT (sink,
|
|
|
|
"Provided different IPv6 sockets in socket and socket-v6 properties");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
sink->used_socket_v6 = G_SOCKET (g_object_ref (sink->socket_v6));
|
2012-01-17 10:18:15 +00:00
|
|
|
sink->external_socket = TRUE;
|
2007-08-17 13:59:15 +00:00
|
|
|
}
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (!sink->used_socket && !sink->used_socket_v6) {
|
2013-05-23 16:05:07 +00:00
|
|
|
GSocketAddress *bind_addr;
|
|
|
|
GInetAddress *bind_iaddr;
|
2013-04-25 10:12:23 +00:00
|
|
|
|
2013-05-23 16:42:09 +00:00
|
|
|
if (sink->bind_address) {
|
|
|
|
GSocketFamily family;
|
|
|
|
|
|
|
|
bind_iaddr = g_inet_address_new_from_string (sink->bind_address);
|
|
|
|
if (!bind_iaddr) {
|
|
|
|
GList *results;
|
|
|
|
GResolver *resolver;
|
|
|
|
|
|
|
|
resolver = g_resolver_get_default ();
|
|
|
|
results =
|
|
|
|
g_resolver_lookup_by_name (resolver, sink->bind_address,
|
|
|
|
sink->cancellable, &err);
|
|
|
|
if (!results) {
|
|
|
|
g_object_unref (resolver);
|
|
|
|
goto name_resolve;
|
|
|
|
}
|
|
|
|
bind_iaddr = G_INET_ADDRESS (g_object_ref (results->data));
|
|
|
|
g_resolver_free_addresses (results);
|
|
|
|
g_object_unref (resolver);
|
|
|
|
}
|
|
|
|
|
|
|
|
bind_addr = g_inet_socket_address_new (bind_iaddr, sink->bind_port);
|
|
|
|
g_object_unref (bind_iaddr);
|
|
|
|
family = g_socket_address_get_family (G_SOCKET_ADDRESS (bind_addr));
|
|
|
|
|
|
|
|
if ((sink->used_socket =
|
|
|
|
g_socket_new (family, G_SOCKET_TYPE_DATAGRAM,
|
|
|
|
G_SOCKET_PROTOCOL_UDP, &err)) == NULL) {
|
|
|
|
g_object_unref (bind_addr);
|
|
|
|
goto no_socket;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_socket_bind (sink->used_socket, bind_addr, TRUE, &err);
|
2017-12-08 00:31:32 +00:00
|
|
|
g_object_unref (bind_addr);
|
2013-05-23 16:42:09 +00:00
|
|
|
if (err != NULL)
|
|
|
|
goto bind_error;
|
2013-05-23 16:05:07 +00:00
|
|
|
} else {
|
2013-05-23 16:42:09 +00:00
|
|
|
/* create sender sockets if none available */
|
|
|
|
if ((sink->used_socket = g_socket_new (G_SOCKET_FAMILY_IPV4,
|
|
|
|
G_SOCKET_TYPE_DATAGRAM, G_SOCKET_PROTOCOL_UDP, &err)) == NULL)
|
|
|
|
goto no_socket;
|
|
|
|
|
|
|
|
bind_iaddr = g_inet_address_new_any (G_SOCKET_FAMILY_IPV4);
|
2013-11-07 08:49:55 +00:00
|
|
|
bind_addr = g_inet_socket_address_new (bind_iaddr, sink->bind_port);
|
2013-05-23 16:42:09 +00:00
|
|
|
g_socket_bind (sink->used_socket, bind_addr, TRUE, &err);
|
2013-05-23 16:05:07 +00:00
|
|
|
g_object_unref (bind_addr);
|
|
|
|
g_object_unref (bind_iaddr);
|
|
|
|
if (err != NULL)
|
|
|
|
goto bind_error;
|
2013-05-23 16:42:09 +00:00
|
|
|
|
|
|
|
if ((sink->used_socket_v6 = g_socket_new (G_SOCKET_FAMILY_IPV6,
|
|
|
|
G_SOCKET_TYPE_DATAGRAM, G_SOCKET_PROTOCOL_UDP,
|
|
|
|
&err)) == NULL) {
|
|
|
|
GST_INFO_OBJECT (sink, "Failed to create IPv6 socket: %s",
|
|
|
|
err->message);
|
|
|
|
g_clear_error (&err);
|
|
|
|
} else {
|
|
|
|
bind_iaddr = g_inet_address_new_any (G_SOCKET_FAMILY_IPV6);
|
2013-11-07 08:49:55 +00:00
|
|
|
bind_addr = g_inet_socket_address_new (bind_iaddr, sink->bind_port);
|
2013-05-23 16:42:09 +00:00
|
|
|
g_socket_bind (sink->used_socket_v6, bind_addr, TRUE, &err);
|
|
|
|
g_object_unref (bind_addr);
|
|
|
|
g_object_unref (bind_iaddr);
|
|
|
|
if (err != NULL)
|
|
|
|
goto bind_error;
|
|
|
|
}
|
2013-04-25 10:12:23 +00:00
|
|
|
}
|
|
|
|
}
|
2012-01-17 10:18:15 +00:00
|
|
|
#ifdef SO_SNDBUF
|
|
|
|
{
|
2021-06-26 11:00:03 +00:00
|
|
|
gint sndsize;
|
|
|
|
GError *opt_err = NULL;
|
2012-01-17 10:18:15 +00:00
|
|
|
|
|
|
|
if (sink->buffer_size != 0) {
|
|
|
|
sndsize = sink->buffer_size;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (sink, "setting udp buffer of %d bytes", sndsize);
|
|
|
|
/* set buffer size, Note that on Linux this is typically limited to a
|
|
|
|
* maximum of around 100K. Also a minimum of 128 bytes is required on
|
|
|
|
* Linux. */
|
2013-04-25 10:12:23 +00:00
|
|
|
|
|
|
|
if (sink->used_socket) {
|
2021-06-26 11:00:03 +00:00
|
|
|
if (!g_socket_set_option (sink->used_socket, SOL_SOCKET, SO_SNDBUF,
|
|
|
|
sndsize, &opt_err)) {
|
2013-04-25 10:12:23 +00:00
|
|
|
GST_ELEMENT_WARNING (sink, RESOURCE, SETTINGS, (NULL),
|
2021-06-26 11:00:03 +00:00
|
|
|
("Could not create a buffer of requested %d bytes (%s)",
|
|
|
|
sndsize, opt_err->message));
|
|
|
|
g_clear_error (&opt_err);
|
2013-04-25 10:12:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sink->used_socket_v6) {
|
2021-06-26 11:00:03 +00:00
|
|
|
if (!g_socket_set_option (sink->used_socket_v6, SOL_SOCKET, SO_SNDBUF,
|
|
|
|
sndsize, &opt_err)) {
|
2013-04-25 10:12:23 +00:00
|
|
|
GST_ELEMENT_WARNING (sink, RESOURCE, SETTINGS, (NULL),
|
2021-06-26 11:00:03 +00:00
|
|
|
("Could not create a buffer of requested %d bytes (%s)",
|
|
|
|
sndsize, opt_err->message));
|
|
|
|
g_clear_error (&opt_err);
|
2013-04-25 10:12:23 +00:00
|
|
|
}
|
2012-01-17 10:18:15 +00:00
|
|
|
}
|
2011-01-05 11:04:03 +00:00
|
|
|
}
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
/* read the value of the receive buffer. Note that on linux this returns 2x the
|
|
|
|
* value we set because the kernel allocates extra memory for metadata.
|
|
|
|
* The default on Linux is about 100K (which is about 50K without metadata) */
|
2013-04-25 10:12:23 +00:00
|
|
|
if (sink->used_socket) {
|
2021-06-26 11:00:03 +00:00
|
|
|
if (g_socket_get_option (sink->used_socket, SOL_SOCKET, SO_SNDBUF,
|
|
|
|
&sndsize, NULL)) {
|
2013-04-25 10:12:23 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "have UDP buffer of %d bytes", sndsize);
|
2021-06-26 11:00:03 +00:00
|
|
|
} else {
|
2013-04-25 10:12:23 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "could not get UDP buffer size");
|
2021-06-26 11:00:03 +00:00
|
|
|
}
|
2013-04-25 10:12:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (sink->used_socket_v6) {
|
2021-06-26 11:00:03 +00:00
|
|
|
if (g_socket_get_option (sink->used_socket_v6, SOL_SOCKET, SO_SNDBUF,
|
|
|
|
&sndsize, NULL)) {
|
2013-04-25 10:12:23 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "have UDPv6 buffer of %d bytes", sndsize);
|
2021-06-26 11:00:03 +00:00
|
|
|
} else {
|
2013-04-25 10:12:23 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "could not get UDPv6 buffer size");
|
2021-06-26 11:00:03 +00:00
|
|
|
}
|
2013-04-25 10:12:23 +00:00
|
|
|
}
|
2012-01-17 10:18:15 +00:00
|
|
|
}
|
|
|
|
#endif
|
2011-01-05 11:04:03 +00:00
|
|
|
|
2013-06-24 15:11:35 +00:00
|
|
|
#ifdef SO_BINDTODEVICE
|
|
|
|
if (sink->multi_iface) {
|
|
|
|
if (sink->used_socket) {
|
2014-04-21 12:32:40 +00:00
|
|
|
if (setsockopt (g_socket_get_fd (sink->used_socket), SOL_SOCKET,
|
|
|
|
SO_BINDTODEVICE, sink->multi_iface,
|
|
|
|
strlen (sink->multi_iface)) < 0)
|
|
|
|
GST_WARNING_OBJECT (sink, "setsockopt SO_BINDTODEVICE failed: %s",
|
|
|
|
strerror (errno));
|
2013-06-24 15:11:35 +00:00
|
|
|
}
|
|
|
|
if (sink->used_socket_v6) {
|
2014-04-21 12:32:40 +00:00
|
|
|
if (setsockopt (g_socket_get_fd (sink->used_socket_v6), SOL_SOCKET,
|
|
|
|
SO_BINDTODEVICE, sink->multi_iface,
|
|
|
|
strlen (sink->multi_iface)) < 0)
|
|
|
|
GST_WARNING_OBJECT (sink, "setsockopt SO_BINDTODEVICE failed (v6): %s",
|
|
|
|
strerror (errno));
|
2013-06-24 15:11:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (sink->used_socket)
|
|
|
|
g_socket_set_broadcast (sink->used_socket, TRUE);
|
|
|
|
if (sink->used_socket_v6)
|
|
|
|
g_socket_set_broadcast (sink->used_socket_v6, TRUE);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
sink->bytes_to_serve = 0;
|
|
|
|
sink->bytes_served = 0;
|
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
gst_multiudpsink_setup_qos_dscp (sink, sink->used_socket);
|
|
|
|
gst_multiudpsink_setup_qos_dscp (sink, sink->used_socket_v6);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2009-08-31 10:13:07 +00:00
|
|
|
/* look for multicast clients and join multicast groups appropriately
|
|
|
|
set also ttl and multicast loopback delivery appropriately */
|
2006-07-10 10:21:57 +00:00
|
|
|
for (clients = sink->clients; clients; clients = g_list_next (clients)) {
|
|
|
|
client = (GstUDPClient *) clients->data;
|
2010-03-05 12:47:33 +00:00
|
|
|
|
|
|
|
if (!gst_multiudpsink_configure_client (sink, client))
|
|
|
|
return FALSE;
|
2006-07-10 10:21:57 +00:00
|
|
|
}
|
|
|
|
return TRUE;
|
2007-04-10 10:01:14 +00:00
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
/* ERRORS */
|
|
|
|
no_socket:
|
|
|
|
{
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, (NULL),
|
2012-01-17 10:18:15 +00:00
|
|
|
("Could not create socket: %s", err->message));
|
|
|
|
g_clear_error (&err);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2013-05-23 16:05:07 +00:00
|
|
|
bind_error:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, (NULL),
|
|
|
|
("Failed to bind socket: %s", err->message));
|
|
|
|
g_clear_error (&err);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2013-05-23 16:42:09 +00:00
|
|
|
name_resolve:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, (NULL),
|
|
|
|
("Failed to resolve bind address %s: %s", sink->bind_address,
|
|
|
|
err->message));
|
|
|
|
g_clear_error (&err);
|
|
|
|
return FALSE;
|
|
|
|
}
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
}
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
static gboolean
|
|
|
|
gst_multiudpsink_stop (GstBaseSink * bsink)
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
{
|
2012-01-17 10:18:15 +00:00
|
|
|
GstMultiUDPSink *udpsink;
|
|
|
|
|
|
|
|
udpsink = GST_MULTIUDPSINK (bsink);
|
|
|
|
|
|
|
|
if (udpsink->used_socket) {
|
|
|
|
if (udpsink->close_socket || !udpsink->external_socket) {
|
|
|
|
GError *err = NULL;
|
|
|
|
|
|
|
|
if (!g_socket_close (udpsink->used_socket, &err)) {
|
|
|
|
GST_ERROR_OBJECT (udpsink, "Failed to close socket: %s", err->message);
|
|
|
|
g_clear_error (&err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_unref (udpsink->used_socket);
|
|
|
|
udpsink->used_socket = NULL;
|
|
|
|
}
|
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (udpsink->used_socket_v6) {
|
|
|
|
if (udpsink->close_socket || !udpsink->external_socket) {
|
|
|
|
GError *err = NULL;
|
|
|
|
|
|
|
|
if (!g_socket_close (udpsink->used_socket_v6, &err)) {
|
|
|
|
GST_ERROR_OBJECT (udpsink, "Failed to close socket: %s", err->message);
|
|
|
|
g_clear_error (&err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_unref (udpsink->used_socket_v6);
|
|
|
|
udpsink->used_socket_v6 = NULL;
|
|
|
|
}
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
return TRUE;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
}
|
|
|
|
|
2014-06-23 17:43:21 +00:00
|
|
|
static gint
|
|
|
|
gst_udp_client_compare_socket_family (GstUDPClient * a, GstUDPClient * b)
|
|
|
|
{
|
|
|
|
GSocketFamily fa = g_socket_address_get_family (a->addr);
|
|
|
|
GSocketFamily fb = g_socket_address_get_family (b->addr);
|
|
|
|
|
|
|
|
if (fa == fb)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* a should go before b */
|
|
|
|
if (fa == G_SOCKET_FAMILY_IPV4 && fb == G_SOCKET_FAMILY_IPV6)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
/* b should go before a */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2007-09-04 22:42:21 +00:00
|
|
|
static void
|
|
|
|
gst_multiudpsink_add_internal (GstMultiUDPSink * sink, const gchar * host,
|
|
|
|
gint port, gboolean lock)
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
{
|
2014-06-19 17:31:05 +00:00
|
|
|
GSocketFamily family;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
GstUDPClient *client;
|
2010-08-20 13:35:27 +00:00
|
|
|
GstUDPClient udpclient;
|
|
|
|
GList *find;
|
|
|
|
|
|
|
|
udpclient.host = (gchar *) host;
|
|
|
|
udpclient.port = port;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2005-09-09 11:09:49 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "adding client on host %s, port %d", host, port);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2010-08-20 13:35:27 +00:00
|
|
|
if (lock)
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&sink->client_lock);
|
2010-08-20 13:35:27 +00:00
|
|
|
|
|
|
|
find = g_list_find_custom (sink->clients, &udpclient,
|
|
|
|
(GCompareFunc) client_compare);
|
2014-06-19 17:31:05 +00:00
|
|
|
|
2014-06-24 00:15:25 +00:00
|
|
|
if (!find) {
|
|
|
|
find = g_list_find_custom (sink->clients_to_be_removed, &udpclient,
|
|
|
|
(GCompareFunc) client_compare);
|
|
|
|
if (find)
|
|
|
|
gst_udp_client_ref (find->data);
|
|
|
|
}
|
|
|
|
|
2010-08-20 13:35:27 +00:00
|
|
|
if (find) {
|
|
|
|
client = (GstUDPClient *) find->data;
|
|
|
|
|
2014-06-19 17:31:05 +00:00
|
|
|
family = g_socket_address_get_family (client->addr);
|
|
|
|
|
2010-08-20 13:35:27 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "found %d existing clients with host %s, port %d",
|
2014-06-19 18:16:01 +00:00
|
|
|
client->add_count, host, port);
|
2010-08-20 13:35:27 +00:00
|
|
|
} else {
|
2014-06-19 18:16:01 +00:00
|
|
|
client = gst_udp_client_new (sink, host, port);
|
2012-01-17 10:18:15 +00:00
|
|
|
if (!client)
|
|
|
|
goto error;
|
2010-08-20 13:35:27 +00:00
|
|
|
|
2014-06-19 17:31:05 +00:00
|
|
|
family = g_socket_address_get_family (client->addr);
|
|
|
|
|
2019-10-11 12:20:15 +00:00
|
|
|
client->connect_time = g_get_real_time () * GST_USECOND;
|
2010-08-20 13:35:27 +00:00
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
if (sink->used_socket)
|
2010-08-20 13:35:27 +00:00
|
|
|
gst_multiudpsink_configure_client (sink, client);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (sink, "add client with host %s, port %d", host, port);
|
2014-06-23 17:43:21 +00:00
|
|
|
|
|
|
|
/* keep IPv4 clients at the beginning, and IPv6 at the end, we can make
|
|
|
|
* use of this in gst_multiudpsink_render_buffers() */
|
|
|
|
sink->clients = g_list_insert_sorted (sink->clients, client,
|
|
|
|
(GCompareFunc) gst_udp_client_compare_socket_family);
|
2014-06-19 17:31:05 +00:00
|
|
|
|
|
|
|
if (family == G_SOCKET_FAMILY_IPV4)
|
|
|
|
++sink->num_v4_unique;
|
|
|
|
else
|
|
|
|
++sink->num_v6_unique;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
}
|
|
|
|
|
2014-06-19 18:16:01 +00:00
|
|
|
++client->add_count;
|
|
|
|
|
2014-06-19 17:31:05 +00:00
|
|
|
if (family == G_SOCKET_FAMILY_IPV4)
|
|
|
|
++sink->num_v4_all;
|
|
|
|
else
|
|
|
|
++sink->num_v6_all;
|
|
|
|
|
2007-09-04 22:42:21 +00:00
|
|
|
if (lock)
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
g_signal_emit (G_OBJECT (sink),
|
|
|
|
gst_multiudpsink_signals[SIGNAL_CLIENT_ADDED], 0, host, port);
|
|
|
|
|
2008-06-20 16:24:11 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "added client on host %s, port %d", host, port);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* ERRORS */
|
2012-01-17 10:18:15 +00:00
|
|
|
error:
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
{
|
2008-06-20 16:24:11 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "did not add client on host %s, port %d", host,
|
|
|
|
port);
|
2010-08-20 13:35:27 +00:00
|
|
|
if (lock)
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-04 22:42:21 +00:00
|
|
|
void
|
|
|
|
gst_multiudpsink_add (GstMultiUDPSink * sink, const gchar * host, gint port)
|
|
|
|
{
|
|
|
|
gst_multiudpsink_add_internal (sink, host, port, TRUE);
|
|
|
|
}
|
|
|
|
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
void
|
|
|
|
gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
|
|
|
|
{
|
2014-06-23 23:56:27 +00:00
|
|
|
GSocketFamily family;
|
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.
2005-06-02 13:28:46 +00:00
|
|
|
GList *find;
|
|
|
|
GstUDPClient udpclient;
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
GstUDPClient *client;
|
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.
2005-06-02 13:28:46 +00:00
|
|
|
|
|
|
|
udpclient.host = (gchar *) host;
|
|
|
|
udpclient.port = port;
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&sink->client_lock);
|
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.
2005-06-02 13:28:46 +00:00
|
|
|
find = g_list_find_custom (sink->clients, &udpclient,
|
|
|
|
(GCompareFunc) client_compare);
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
if (!find)
|
|
|
|
goto not_found;
|
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.
2005-06-02 13:28:46 +00:00
|
|
|
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
client = (GstUDPClient *) find->data;
|
2005-12-20 12:44:25 +00:00
|
|
|
|
2010-08-20 13:35:27 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "found %d clients with host %s, port %d",
|
2014-06-19 18:16:01 +00:00
|
|
|
client->add_count, host, port);
|
|
|
|
|
|
|
|
--client->add_count;
|
2005-12-20 12:44:25 +00:00
|
|
|
|
2014-06-23 23:56:27 +00:00
|
|
|
family = g_socket_address_get_family (client->addr);
|
|
|
|
if (family == G_SOCKET_FAMILY_IPV4)
|
|
|
|
--sink->num_v4_all;
|
|
|
|
else
|
|
|
|
--sink->num_v6_all;
|
|
|
|
|
2014-06-19 18:16:01 +00:00
|
|
|
if (client->add_count == 0) {
|
2012-01-17 10:18:15 +00:00
|
|
|
GInetSocketAddress *saddr = G_INET_SOCKET_ADDRESS (client->addr);
|
|
|
|
GInetAddress *addr = g_inet_socket_address_get_address (saddr);
|
2013-04-25 10:12:23 +00:00
|
|
|
GSocket *socket;
|
|
|
|
|
|
|
|
/* Select socket to send from for this address */
|
|
|
|
if (family == G_SOCKET_FAMILY_IPV6 || !sink->used_socket)
|
|
|
|
socket = sink->used_socket_v6;
|
|
|
|
else
|
|
|
|
socket = sink->used_socket;
|
2012-01-17 10:18:15 +00:00
|
|
|
|
2010-08-20 13:35:27 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "remove client with host %s, port %d", host, port);
|
2007-04-29 14:43:37 +00:00
|
|
|
|
2019-10-11 12:20:15 +00:00
|
|
|
client->disconnect_time = g_get_real_time () * GST_USECOND;
|
2010-08-20 13:35:27 +00:00
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (socket && sink->auto_multicast
|
2012-01-17 10:18:15 +00:00
|
|
|
&& g_inet_address_get_is_multicast (addr)) {
|
|
|
|
GError *err = NULL;
|
|
|
|
|
2013-04-25 10:12:23 +00:00
|
|
|
if (!g_socket_leave_multicast_group (socket, addr, FALSE,
|
2012-10-10 08:55:28 +00:00
|
|
|
sink->multi_iface, &err)) {
|
2012-01-17 10:18:15 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "Failed to leave multicast group: %s",
|
|
|
|
err->message);
|
|
|
|
g_clear_error (&err);
|
|
|
|
}
|
|
|
|
}
|
2010-08-20 13:35:27 +00:00
|
|
|
|
2014-06-23 23:56:27 +00:00
|
|
|
if (family == G_SOCKET_FAMILY_IPV4)
|
|
|
|
--sink->num_v4_unique;
|
|
|
|
else
|
|
|
|
--sink->num_v6_unique;
|
|
|
|
|
2014-06-24 00:15:25 +00:00
|
|
|
/* Keep state consistent for streaming thread, so remove from client list,
|
|
|
|
* but keep it around until after the signal has been emitted, in case a
|
|
|
|
* callback wants to get stats for that client or so */
|
|
|
|
sink->clients = g_list_delete_link (sink->clients, find);
|
|
|
|
|
|
|
|
sink->clients_to_be_removed =
|
|
|
|
g_list_prepend (sink->clients_to_be_removed, client);
|
|
|
|
|
2010-08-20 13:35:27 +00:00
|
|
|
/* Unlock to emit signal before we delete the actual client */
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
2010-08-20 13:35:27 +00:00
|
|
|
g_signal_emit (G_OBJECT (sink),
|
|
|
|
gst_multiudpsink_signals[SIGNAL_CLIENT_REMOVED], 0, host, port);
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&sink->client_lock);
|
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.
2005-06-02 13:28:46 +00:00
|
|
|
|
2014-06-24 00:15:25 +00:00
|
|
|
sink->clients_to_be_removed =
|
|
|
|
g_list_remove (sink->clients_to_be_removed, client);
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
|
2014-06-19 18:16:01 +00:00
|
|
|
gst_udp_client_unref (client);
|
2010-08-20 13:35:27 +00:00
|
|
|
}
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
not_found:
|
|
|
|
{
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
GST_WARNING_OBJECT (sink, "client at host %s, port %d not found",
|
|
|
|
host, port);
|
|
|
|
return;
|
|
|
|
}
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
}
|
|
|
|
|
2007-09-04 22:42:21 +00:00
|
|
|
static void
|
|
|
|
gst_multiudpsink_clear_internal (GstMultiUDPSink * sink, gboolean lock)
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
{
|
2005-09-09 11:09:49 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "clearing");
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
/* we only need to remove the client structure, there is no additional
|
|
|
|
* socket or anything to free for UDP */
|
2007-09-04 22:42:21 +00:00
|
|
|
if (lock)
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&sink->client_lock);
|
2014-06-19 18:16:01 +00:00
|
|
|
g_list_foreach (sink->clients, (GFunc) gst_udp_client_unref, sink);
|
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.
2005-06-02 13:28:46 +00:00
|
|
|
g_list_free (sink->clients);
|
|
|
|
sink->clients = NULL;
|
2014-06-19 17:31:05 +00:00
|
|
|
sink->num_v4_unique = 0;
|
|
|
|
sink->num_v4_all = 0;
|
|
|
|
sink->num_v6_unique = 0;
|
|
|
|
sink->num_v6_all = 0;
|
2007-09-04 22:42:21 +00:00
|
|
|
if (lock)
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
2007-09-04 22:42:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gst_multiudpsink_clear (GstMultiUDPSink * sink)
|
|
|
|
{
|
|
|
|
gst_multiudpsink_clear_internal (sink, TRUE);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
}
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
GstStructure *
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
gst_multiudpsink_get_stats (GstMultiUDPSink * sink, const gchar * host,
|
|
|
|
gint port)
|
|
|
|
{
|
2005-12-20 12:44:25 +00:00
|
|
|
GstUDPClient *client;
|
2012-01-17 10:18:15 +00:00
|
|
|
GstStructure *result = NULL;
|
2005-12-20 12:44:25 +00:00
|
|
|
GstUDPClient udpclient;
|
|
|
|
GList *find;
|
|
|
|
|
|
|
|
udpclient.host = (gchar *) host;
|
|
|
|
udpclient.port = port;
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&sink->client_lock);
|
2005-12-20 12:44:25 +00:00
|
|
|
|
|
|
|
find = g_list_find_custom (sink->clients, &udpclient,
|
|
|
|
(GCompareFunc) client_compare);
|
2014-06-24 00:15:25 +00:00
|
|
|
|
|
|
|
if (!find)
|
|
|
|
find = g_list_find_custom (sink->clients_to_be_removed, &udpclient,
|
|
|
|
(GCompareFunc) client_compare);
|
|
|
|
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
if (!find)
|
|
|
|
goto not_found;
|
2005-12-20 12:44:25 +00:00
|
|
|
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
GST_DEBUG_OBJECT (sink, "stats for client with host %s, port %d", host, port);
|
2005-12-20 12:44:25 +00:00
|
|
|
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
client = (GstUDPClient *) find->data;
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
result = gst_structure_new_empty ("multiudpsink-stats");
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
gst_structure_set (result,
|
|
|
|
"bytes-sent", G_TYPE_UINT64, client->bytes_sent,
|
|
|
|
"packets-sent", G_TYPE_UINT64, client->packets_sent,
|
|
|
|
"connect-time", G_TYPE_UINT64, client->connect_time,
|
|
|
|
"disconnect-time", G_TYPE_UINT64, client->disconnect_time, NULL);
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
2005-12-20 12:44:25 +00:00
|
|
|
|
|
|
|
return result;
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
not_found:
|
|
|
|
{
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&sink->client_lock);
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
GST_WARNING_OBJECT (sink, "client with host %s, port %d not found",
|
|
|
|
host, port);
|
|
|
|
/* Apparently (see comment in gstmultifdsink.c) returning NULL from here may
|
|
|
|
* confuse/break python bindings */
|
2012-01-17 10:18:15 +00:00
|
|
|
return gst_structure_new_empty ("multiudpsink-stats");
|
gst/udp/gstmultiudpsink.*: Updated docs.
Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init),
(gst_multiudpsink_render), (gst_multiudpsink_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_add),
(gst_multiudpsink_remove), (gst_multiudpsink_clear),
(gst_multiudpsink_get_stats), (gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
Updated docs.
Added properties bytes-served, bytes_to_serve.
Post proper error messages,
Emit client added signal too.
2006-02-06 17:26:43 +00:00
|
|
|
}
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
}
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
static gboolean
|
|
|
|
gst_multiudpsink_unlock (GstBaseSink * bsink)
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
{
|
|
|
|
GstMultiUDPSink *sink;
|
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
sink = GST_MULTIUDPSINK (bsink);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
g_cancellable_cancel (sink->cancellable);
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
static gboolean
|
|
|
|
gst_multiudpsink_unlock_stop (GstBaseSink * bsink)
|
|
|
|
{
|
|
|
|
GstMultiUDPSink *sink;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
|
2012-01-17 10:18:15 +00:00
|
|
|
sink = GST_MULTIUDPSINK (bsink);
|
|
|
|
|
2015-05-27 14:55:56 +00:00
|
|
|
gst_multiudpsink_free_cancellable (sink);
|
|
|
|
gst_multiudpsink_create_cancellable (sink);
|
2012-01-17 10:18:15 +00:00
|
|
|
|
|
|
|
return TRUE;
|
gst/udp/: Added multifdsink to send UDP to multiple addresses.
Original commit message from CVS:
* gst/udp/.cvsignore:
* 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_get_property),
(gst_multiudpsink_init_send), (gst_multiudpsink_close),
(gst_multiudpsink_add), (gst_multiudpsink_remove),
(gst_multiudpsink_clear), (gst_multiudpsink_get_stats),
(gst_multiudpsink_change_state):
* gst/udp/gstmultiudpsink.h:
* gst/udp/gstudp-marshal.list:
* gst/udp/gstudp.c: (plugin_init):
* gst/udp/gstudp.h:
* gst/udp/gstudpsink.c: (gst_udpsink_get_type),
(gst_udpsink_base_init), (gst_udpsink_class_init),
(gst_udpsink_init), (gst_udpsink_set_uri),
(gst_udpsink_set_property), (gst_udpsink_get_property),
(gst_udpsink_uri_get_type), (gst_udpsink_uri_get_protocols),
(gst_udpsink_uri_get_uri), (gst_udpsink_uri_set_uri),
(gst_udpsink_uri_handler_init):
* gst/udp/gstudpsink.h:
* 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):
* gst/udp/gstudpsrc.h:
Added multifdsink to send UDP to multiple addresses.
Cleaned up UDP source/sink elements some more.
Make UDP sink extends from multiudpsink.
2005-05-12 15:32:51 +00:00
|
|
|
}
|