Commit graph

385 commits

Author SHA1 Message Date
Sebastian Dröge
5a65f5f3b7 multihandlesink: Use the monotonic clock for detecting timeouts and connection durations
Otherwise real-time clock changes can wrongly trigger timeouts, or not
cause timeouts to happen in time.

Unfortunately real-time clock times still have to be kept track inside
the elements for the statistics. Switching those over to the monotonic
clock would cause behaviour changes from the application point of view.

The statistics are extended with fields with monotonic times though.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1137>
2021-05-05 16:12:38 +00:00
Doug Nazar
3676a2c6de tcp: Rework client start error handling.
Ensure errors are cleaned up properly at the right level.
Abort connection attempts if we're cancelled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1115>
2021-04-22 07:17:06 +00:00
Doug Nazar
dd12c9b230 tcp: Convert tcpclientsink to new helpers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1105>
2021-04-20 09:49:23 +00:00
Doug Nazar
13743353cb tcp: Convert tcpclientsrc to new helpers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1105>
2021-04-20 09:49:23 +00:00
Doug Nazar
0fefbc932a tcp: Convert tcpserversink to new helpers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1105>
2021-04-20 09:49:23 +00:00
Doug Nazar
9ad0566c37 tcp: Convert tcpserversrc to new helpers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1105>
2021-04-20 09:49:23 +00:00
Doug Nazar
408b2fa634 tcp: Add helper functions to lookup hostnames and create sockets.
Lookup will now maintain the full list of possible IP address(es).
We can now iterate over all available addresses in case certain
address families (IPv6) are disabled or try connecting to additional
addresses for the clients.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1105>
2021-04-20 09:49:23 +00:00
Doug Nazar
d4bf6b36d2 tcp: cleanup files
consolidate gsttcp.h & gsttcpelements.h
rename gsttcpelement.c to match header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1105>
2021-04-20 09:49:23 +00:00
Stéphane Cerveau
520a682c7c tcp: allow per feature registration
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1029>
2021-03-16 17:58:59 +00:00
Jan Alexander Steffens (heftig)
c4cdb6590e tcpserversink: Don't assume g_socket_get_remote_address succeeds
When the client disconnects immediately after connecting, the remote
address is no longer available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/908>
2020-10-30 14:01:51 +01:00
Jan Alexander Steffens (heftig)
c272a5e1a5 multihandlesink: Don't pass NULL caps to gst_caps_is_equal
Apparently the sinkpad caps can get cleared when shutting down the
pipeline while the sink is working, provoking a critical warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/842>
2020-10-08 21:55:38 +00:00
Thibault Saunier
e9d3e4d7ea doc: Fix link in tcp multi*sinks. 2020-06-23 14:52:21 -04:00
Mathieu Duponchelle
69d5428bfc docs: mark more types as plugin API 2020-06-23 14:52:20 -04:00
Mathieu Duponchelle
cc516695b0 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:41:17 +02:00
Mathieu Duponchelle
e666c9ec04 plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 22:44:23 -04:00
Vivia Nikolaidou
e56b784171 tcpserversrc: Add stats property
Like in tcpclientsrc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/651>
2020-05-06 15:25:44 +03:00
Vivia Nikolaidou
d1c9972e94 tcpclientsrc: Fix compilation on FreeBSD
The members of the tcp_info struct are prefixed with a double
underscore, as reported in
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/584#note_423487
2020-03-08 10:45:57 +00:00
Vivia Nikolaidou
ea930a4bf8 tcpclientsrc: Expose connection stats as property
Unfortunately the OS takes care of bad connections for us, so we can't
get the stats in a platform-independent way. Count total bytes received
as well, platform-independently.
2020-02-28 14:17:34 +02:00
Stéphane Cerveau
58e6f598f4 base: use of g_value_dup_string
Use helper method to get string from GValue.
2019-12-18 16:03:59 +01:00
Tim-Philipp Müller
64b6c4796a multifdsink: remove defunct include guarded by unused HAVE_FIONREAD_IN_SYS_FILIO
The configure check for this went away in 2012 in commit cd3eee.
2019-12-09 07:33:55 +00:00
Tim-Philipp Müller
289d8e53e2 Remove autotools build system 2019-10-13 14:15:43 +01:00
Edward Hervey
2409f4f360 base: Avoid usage of deprecated API
GTimeval and related functions are now deprecated in glib.
Replacement APIs have been present since 2.26
2019-10-11 06:17:39 +00:00
Thibault Saunier
909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Niels De Graef
0314b482f3 Don't pass default GLib marshallers for signals
By passing NULL to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.

Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.
2019-08-27 07:31:57 +02:00
Mathieu Duponchelle
1c85065d16 doc: fix element section documentations
Element sections were not rendered anymore after the hotdoc
port, fixing this revealed a few incorrect links.
2019-05-25 16:55:57 +02:00
Thibault Saunier
287897e465 doc: Fix some gtk-doc comments 2019-05-13 11:34:08 -04:00
Thibault Saunier
27ba8d24ec doc: Port to hotdoc 2019-05-13 11:34:08 -04:00
Tim-Philipp Müller
4187242a7c tcp: fix markup for example pipelines in docs
gtk-doc doesn't like the # it seems.

https://bugzilla.gnome.org/show_bug.cgi?id=795548
2018-05-05 18:02:16 +02:00
Xavier Claessens
201e7c7803 Meson: Generate pc file for all plugins in base
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:05:56 +01:00
Jan Schmidt
577c14495c tcp/multihandlesink: Handle the case of no caps
Pass data with no caps and no streamheaders without
throwing a bunch of criticals
2018-02-09 18:07:59 +11:00
Nicolas Dufresne
8e6c6266d7 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 13:42:07 -04:00
Olivier Crête
c1acb1c1fb multifdsink: Remove GValueArray from the doc
It's been a GstStructure for a long time. Also fix
a typo in the name of one of the fields.
2017-03-14 16:30:46 -04:00
Thibault Saunier
099ac9faf2 docs: Convert gtkdoc comments to markdown
Modernizing the documentation, making it simpler to read an
modify and allowing us to possibly switch to hotdoc in the
future.
2017-03-10 18:19:17 -03:00
Tim-Philipp Müller
ad53caf059 multihandlesink: fix some property descriptions 2017-01-04 13:44:53 +00:00
Nicola Murino
07646dd11b tcpclientsrc: add timeout property
https://bugzilla.gnome.org/show_bug.cgi?id=749567
2016-12-21 10:05:49 +02:00
Jan Alexander Steffens (heftig)
58be309344 multihandlesink: Fix buffers-queued being off by one
max_buffer_usage is the index of the oldest buffer in the queue,
starting at zero, not the number of buffers queued.

find_limits returns the index of the oldest buffer that satisfies the
limits in its min_idx parameter, not the number of buffers needed. Fix
this use too in order to keep passing the tests that read
buffers-queued.

https://bugzilla.gnome.org/show_bug.cgi?id=775351
2016-11-29 19:14:10 +02:00
Jan Alexander Steffens (heftig)
8b9ebd8f88 multihandlesink: Update bufpos in a separate pass
If a client gets dropped and the iteration gets restarted, bufpos is
incremented again for all clients that preceded the dropped one, causing
havoc.

Adjust the bufpos for all clients first before trying to drop any.

https://bugzilla.gnome.org/show_bug.cgi?id=774908
2016-11-29 19:13:00 +02:00
Nirbheek Chauhan
5c4f4ac1bd Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:09:51 +01:00
Sebastian Dröge
46e808a300 multihandlesink: Warn if trying to change the state from the streaming thread
Instead of silently returning GST_STATE_CHANGE_FAILURE.
2016-05-05 13:17:53 +03:00
Vineeth TM
44b70ca3a1 base: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763075
2016-03-24 14:25:41 +02:00
Sebastian Dröge
65390b5129 multihandlesink: Remove useless streamheader storage
We don't do anything with it but always get them from the caps anyway, so
stop storing them and having complicated logic around that.

https://bugzilla.gnome.org/show_bug.cgi?id=763278
2016-03-14 12:45:33 +02:00
Sebastian Dröge
1d4fb48718 multihandlesink: Only don't send HEADER buffers normally if they are actually streamheaders from the caps
And also consider HEADER buffers without DELTA_UNIT flag as sync points. This
fixes sync-mode=2 with mpegtsmux for example, which has no streamheaders but
puts the HEADER flag on its keyframes.

https://bugzilla.gnome.org/show_bug.cgi?id=763278
2016-03-14 12:45:33 +02:00
Sebastian Dröge
0a434e9c6c tcp: Remove unused file
It's a copy of multihandlesink, but completely outdated. Let's get rid of it
before it gets even more outdated.

https://bugzilla.gnome.org/show_bug.cgi?id=763278
2016-03-14 12:45:16 +02:00
Tom Deseyn
8c4d3c6aa9 multisocketsink: handle client close correctly and EWOULDBLOCK
Fixes 100% cpu usage when client disconnects. Commit 6db2ee56
would just make multisocketsink ignore reads of 0 bytes without
removing the client, so we'd get woken up over and over again
for the client.

Fix the original issue differently by handling the non-fatal error code.

https://bugzilla.gnome.org/show_bug.cgi?id=761257
https://bugzilla.gnome.org/show_bug.cgi?id=743834
2016-03-01 13:15:38 +00:00
Tim-Philipp Müller
ddfe7a2808 win32: remove outdated build cruft
This hasn't been touched for generations, doesn't work,
and is just causing confusion. We also don't want to
maintain these files manually.
2016-02-20 10:05:17 +00:00
Luis de Bethencourt
29cfb9a6d7 multifdsink: fix typo in GST_WARNING_OBJECT
This should make easier to parse the debug logs.
s/fnctl/fcntl
2015-12-16 11:12:03 +00:00
Wim Taymans
9c2bcd7b76 multisocketsink: add GstNetworkMessage event
Add a property and logic to send a GstNetworkMessage event containing
the message that was received from a client. This can be used to
implement simply bidirectional communication.
2015-12-10 12:44:42 +01:00
Wim Taymans
9aaaa26ff3 multisocketsink: add dispatched event
Add a property and logic to send a GstNetworkMessageDispatched
event upstream to notify that a buffer has been sent. This can be used
to keep track of what client received what buffers.
2015-12-10 12:44:42 +01:00
Wim Taymans
0e1a858d89 socketsrc: handle GstNetworkMessage events
Add a property to handle GstNetworkMessage events. These events contain
a buffer that is sent on the socket to allow for simple bidirectional
communication.
2015-12-10 12:44:42 +01:00
Wim Taymans
1da5a3ab66 multisocketsink: let downstream know we support metadata
Let downstream know that we support GstNetControlMessage metadata API.
2015-12-04 12:25:11 +01:00