Commit graph

138 commits

Author SHA1 Message Date
Thomas Bluemel
578e93cd0b multiudpsink: Initialize bytes_sent field.
This fixes endpoints not receiving any data intermittently.

https://bugzilla.gnome.org/show_bug.cgi?id=769773
2016-08-12 09:21:20 +02:00
Mats Lindestam
63c284c24e multiudpsink: Allow setting "socket-v6" without setting "socket" too
https://bugzilla.gnome.org/show_bug.cgi?id=764897
2016-04-26 11:05:22 +03:00
Vineeth TM
1071309870 good: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763076
2016-03-24 14:32:20 +02:00
Vineeth TM
2a7ba2955c multiudpsink: fix GError memory leak when hostname resolution fails
https://bugzilla.gnome.org/show_bug.cgi?id=754869
2015-09-11 10:18:14 +01:00
Tim-Philipp Müller
b33d30621c udpsink, multiudpsink: keep GCancellable fd around instead of re-creating it constantly
Otherwise we constantly create/close event file descriptors,
every time we call g_socket_condition_timed_wait() or
g_socket_send_message(s)(), i.e. a lot. Which is not
particularly good for performance.

Can't create GCancellable in ::start() here because it's used
in client_new() which may be called via the add-client action
signal which may be called before the element is up and running.
2015-05-27 17:08:47 +01:00
Tim-Philipp Müller
f54110fd3e udp: don't use soon-to-be-deprecated g_cancellable_reset()
From the API documentation: "Note that it is generally not
a good idea to reuse an existing cancellable for more
operations after it has been cancelled once, as this
function might tempt you to do. The recommended practice
is to drop the reference to a cancellable after cancelling
it, and let it die with the outstanding async operations.
You should create a fresh cancellable for further async
operations."

https://bugzilla.gnome.org/show_bug.cgi?id=739132
2015-05-19 19:00:20 +01:00
Luis de Bethencourt
671b4d25cd remove unused enum items PROP_LAST
This were probably added to the enums due to cargo cult programming and are
unused. Removing them.
2015-04-24 17:01:12 +01:00
Tim-Philipp Müller
3c595f308a multiudpsink: fix crash with GST_DEBUG enabled
g_inet_socket_address_get_address() does not give
us a ref to the address, so don't unref it.
2015-03-13 18:38:42 +00:00
Tim-Philipp Müller
c4fa54da17 Fix double semicolons 2015-03-10 09:31:20 +00:00
Tim-Philipp Müller
4dd7d79b52 udpsink: allocate scratch space for render functions on the heap
and not the stack. Our allocations could get a bit too large
to be sure it's not going to cause trouble using the stack.
2014-12-16 20:26:36 +00:00
Tim-Philipp Müller
97a2eb7afb multiudpsink: re-use send_buffers() code path for render() function
It's like rendering a buffer list, just with one buffer.
Has the added advantage that if there are multiple clients
we can send the buffer to all the clients in one go.
2014-12-16 20:26:36 +00:00
Tim-Philipp Müller
54a9a436ba multiudpsink: keep client list consistent during removals
We unlock and re-lock the client lock while emitting the
removed signal, which causes inconsistencies in the client
list vs. the client counts. Instead, remove the client from
the list already before emitting the signal and put it into
a temporary list of clients to be removed. That way things
look consistent to the streaming thread, but signal callbacks
can still do things like get stats from removed clients.
2014-12-16 20:26:36 +00:00
Tim-Philipp Müller
fa3ef2e54c multiudpsink: fix client count after removal 2014-12-16 20:26:36 +00:00
Tim-Philipp Müller
7bdf7500a1 multiudpsink: keep client list sorted by socket family
We make use of in the send_buffers() function if we
need to use different sockets to send to IPv4 and
IPv6 destinations.
2014-12-16 20:26:36 +00:00
Tim-Philipp Müller
e1a7deb27f multiudpsink: add sendmmsg-ready render_list function prototype
Add prototype for a render_list() function that can use a
sendmmsg-style g_socket_send_messages() function once it lands
in GLib. We can use this infrastructure to send multiple buffers
made up by multiple memories to multiple clients in one go, which
drastically reduces the number of syscalls made when sending
high-bitrate video streams.

https://bugzilla.gnome.org/show_bug.cgi?id=732152
2014-12-16 20:26:36 +00:00
Tim-Philipp Müller
dead5c2476 multiudpsink: make udp client structure refcounted
Use the refcount for memory management and keep track
of the number of duplicate clients in a separate
variable. This will be useful later, and means we
don't have to hold the OBJECT_LOCK all the time.

https://bugzilla.gnome.org/show_bug.cgi?id=732866
2014-12-16 20:26:36 +00:00
Tim-Philipp Müller
675384a8cb multiudpsink: keep count of number of unique and non-unique IPv4 and IPv6 clients
This will come in handy later.
2014-12-16 20:26:36 +00:00
Tim-Philipp Müller
3956f5addc Sprinkle some G_PARAM_DEPRECATED and #ifndef GST_REMOVE_DEPRECATED 2014-11-02 16:58:30 +00:00
Tim-Philipp Müller
41c895de4d multiudpsink: optimisation: avoid unnecessary memory ref/unrefs
We know the buffer will stay valid and we will also not
modify the buffer, we just want to send out the data.
2014-06-20 12:21:05 +01:00
Tim-Philipp Müller
3512ad3be0 multiudpsink: avoid some unnecessary run-time type checks 2014-06-20 12:06:57 +01:00
Tim-Philipp Müller
884d1af074 udp: improve element descriptions for dynudpsink and multiudpsink 2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
6c1231eed3 udp: remove suppression of compiler warnings for deprecated GLib API
Not needed any more.
2014-06-18 14:54:58 +01:00
Vincent Penquerc'h
25fa88f8aa multiidpsink: warn when setsockopt fails
This doesn't seem to be fatal, but it's good to let the user know
in the logs.

Coverity 1139630
2014-04-21 17:21:20 +01:00
Tim-Philipp Müller
627109ce4d multiudpsink: fix misleading comment
Those are not allocated on the stack.
2013-12-19 12:47:22 +00:00
Tim-Philipp Müller
d506409af5 docs: get rid of 'Since: 0.10.x' markers
And some gtk-doc markup fixes.
2013-11-18 14:47:35 +00:00
Sebastian Dröge
fd89e36c8a multiudpsink: Also use the bind-port property if no bind-address was given 2013-11-07 09:50:39 +01:00
Ognyan Tonchev
c81ce6b152 multiudpsink: Fix memory leak
Unmap all GstMemory of the current buffer when flushing.

https://bugzilla.gnome.org/show_bug.cgi?id=710110
2013-10-14 18:21:54 +02:00
Wim Taymans
35f6e79b94 udpsink: bind to the given interface
Actually call BINDTODEVICE to bind to the interface as given by the
property.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702819
2013-06-24 17:13:05 +02:00
Sebastian Dröge
e26b8c2832 (dyn|multi)udpsink: Add properties to specify the bind address and port
By default we use the any addresses and a random port for binding the socket.
2013-05-23 18:42:09 +02:00
Sebastian Dröge
5b79b8ff3c (dyn|multi)udpsink: Bind socket before using it
https://bugzilla.gnome.org/show_bug.cgi?id=700878
2013-05-23 18:05:07 +02:00
Sebastian Dröge
1ed7f7a6a8 (multi)udpsink: Add missing getters for socket-v6 and used-socket-v6 properties 2013-05-23 17:26:31 +02:00
Sebastian Dröge
b1af93f791 (multi)udpsink: Use separate sockets for IPv4 and IPv6
https://bugzilla.gnome.org/show_bug.cgi?id=534243
2013-04-25 12:12:23 +02:00
Sebastian Dröge
a957457cc1 udp: Use the generic marshaller instead of generating marshallers 2013-04-25 09:13:51 +02:00
Wim Taymans
f96aa414e1 udpsink: avoid alloc and free in render function
Avoid doing alloc and free in the render function for each buffer. Instead,
allocate the needed arrays in _init and use those.
2013-04-11 14:57:11 +01:00
Wim Taymans
3d7d757521 udpsink: improve debug 2013-04-09 16:53:31 +02:00
Tim-Philipp Müller
230cf41cc9 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:07:18 +00:00
Rasmus Rohde
11ed7c0373 multiudpsink: add multicast-iface property
udpsrc already has support for setting the multicast interface, which
is useful for multi-homed machines. This patch adds the same code to
the multiudpsink.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685864
2012-10-10 11:48:25 +02:00
Wim Taymans
54f049c355 multiudpsink: don't error on send errors but only warn
Don't error on send errors but simply post a warning, it's possible
that the next packet will be fine.
2012-10-10 11:32:17 +02:00
Rasmus Rohde
6c169312d1 multiudpsink: add force-ipv4 option
Add an option to the multiudpsink that makes it possible to force
the use of an IPv4 socket.

This can e.g. be used to handle the issue described in
https://bugzilla.gnome.org/show_bug.cgi?id=682481
2012-10-10 10:28:24 +02:00
Wim Taymans
2955f0e10c multiudpsink: remove unused field 2012-10-10 10:18:52 +02:00
Wim Taymans
e8d951ed68 multiudpsink: post error when something goes wrong 2012-10-10 10:09:37 +02:00
Mark Nauwelaerts
d6ca569c29 udp: add include for IPPROTO_* 2012-09-12 17:14:46 +02:00
Mark Nauwelaerts
58c96df0ae udp: properly match braces and cpp directives
Fixes compilation where IPV6_TCLASS not defined.
2012-09-12 16:39:08 +02:00
Wim Taymans
916e4c86fa udpsink: don't crash on NULL error
Check if there is an error before retrieving its message.

See https://bugzilla.gnome.org/show_bug.cgi?id=682481
2012-08-22 17:27:27 +02:00
Olivier Crête
b4ff570532 multiudpsink: Return FLUSHING instead of ERROR on unlock
If the base class asks multiudpsink to unlock, then it should return
FLUSHING, not ERROR
2012-08-07 11:31:32 -07:00
Tim-Philipp Müller
80245e2a70 multiudpsink: check the right size when warning about too large udp packets
What matters is the total size, not the size of any of the
individual memory chunks that make up the packet.
2012-07-11 12:31:13 +01:00
Tim-Philipp Müller
e09ae5736d Use new gst_element_class_set_static_metadata() 2012-04-10 00:51:41 +01:00
Raimo Järvi
eccb5b8fed udp: Fix compiling with mingw.
https://bugzilla.gnome.org/show_bug.cgi?id=672880
2012-03-27 11:42:43 +02:00
Olivier Crête
e819b60f27 udpsink: Unlock on error 2012-03-22 16:18:37 -04:00
Wim Taymans
84c96e2393 udpsink: make buffer-size work again 2012-03-13 20:49:43 +01:00