Commit graph

369 commits

Author SHA1 Message Date
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
Wim Taymans
01f5ca3da8 multisocketsink: keep on reading when we stop sending
When we stop sending because we need more data, still keep a GSource
around to receive data from the clients.
Also handle read and write in the same go.
2015-12-02 10:26:03 +01:00
Csaba Toth
3159501002 multisocketsink: fix "client-removed" signal on 64-bit platforms and with bindings
The client-removed signal used G_INT_TYPE instead of G_SOCKET_TYPE
in its definition leading to problems on platforms where the size
of a pointer is larger than the size of an integer, It would also
not work at all with dynamic language bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=757155
2015-10-31 11:12:38 +00:00
Vineeth T M
060f0c21f2 audiosink, multisocketsink: Fix error leak during failures
https://bugzilla.gnome.org/show_bug.cgi?id=755143
2015-09-17 11:59:35 +02:00
Wim Taymans
2b2766494b socketsrc: add caps property
Add caps property that allows the src to easily negotiate a format.
2015-07-14 16:01:10 +02:00
Stefan Sauer
75cc08d451 docs: order and canonicalize the -sections.txt file
Have all sections in alphabetical order. Also make the macro order consistent.
This is a preparation for generating the file. Remove GET_CLASS macro for
some elements, since it is not used and the header is not installed.
2015-07-03 21:16:27 +02:00
Tim-Philipp Müller
37aa31379f tcp: 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 18:50:41 +01:00
Tim-Philipp Müller
ec5c93f169 docs: update element example pipelines
- gst-launch -> gst-launch-1.0
- use autoaudiosink and audiovideosink more often
- review pipeline examples and descriptions
2015-05-10 11:38:19 +01:00
Tim-Philipp Müller
c680e324bc Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:42:34 +01:00
Luis de Bethencourt
df08f5eabe 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:11:01 +01:00
Tim-Philipp Müller
6db2ee56b6 tcpserversink: don't error out if clients send us something, just ignore it
We don't expect clients to send us any data, but if they do, just
ignore it. Web browsers might send us an HTTP request for example,
but some will still be happy if we just send them data without
a proper HTTP response.

There was a bug in the reading code path. We only have a small
read buffer and would provoke an EWOULDBLOCK trying to read
because we don't bail out of the loop early enough.

https://bugzilla.gnome.org/show_bug.cgi?id=743834
2015-04-04 21:38:40 +01:00
William Manley
8328eab2de socketsrc: Add support for GstNetControlMessageMeta
multisocketsink now understands the new GstNetControlMessageMeta to allow
sending control messages (ancillary data) with data when writing to Unix
domain sockets.

Thanks to glib's `GSocketControlMessage` abstraction the code introduced
in this commit is entirely portable and doesn't introduce and additional
dependencies or conditionally compiled code, even if it is unlikely to be
of much use on non-UNIX systems.
2015-03-14 13:23:28 +01:00
William Manley
e63e023e30 multisocketsink: Add support for GstNetControlMessageMeta
multisocketsink now understands the new GstNetControlMessageMeta to allow
sending control messages (ancillary data) with data when writing to Unix
domain sockets.

A later commit will introduce a new socketsrc element which will similarly
understand `GstNetControlMessageMeta`.  This, when used with a
`GSocketControlMessage` of type `GUnixFDMessage` will allow GStreamer to
send and receive file-descriptions in ancillary data, the first step to
using memfds to implement zero-copy video IPC.

Thanks to glib's `GSocketControlMessage` abstraction the code introduced
in this commit is entirely portable and doesn't introduce and additional
dependencies or conditionally compiled code, even if it is unlikely to be
of much use on non-UNIX systems.
2015-03-14 13:23:20 +01:00
William Manley
a297b0545f socketsrc: Add connection-closed-by-peer signal
This provides notification that the socket in use was closed by the peer
and gives an opportunity to replace it with a new one which is not
closed, allowing reading from many sockets in order.

I use this in pulsevideo to implement reconnection logic to handle the
pulsevideo service dieing, such that is can be restarted without
disrupting downstream.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=739546
2015-03-13 20:05:00 +01:00
William Manley
a19ac4b85c socketsrc: Tidy up usage of g_object_unref/g_clear_object and locking
This is clearer, and should make future changes safer.  No functional
change intended.

See https://bugzilla.gnome.org/show_bug.cgi?id=739546
2015-03-13 20:05:00 +01:00
William Manley
0c054aa00d socketsrc: Refactor to simplify
* Don't bother polling, just do a blocking read, the `GCancellable` will
  take care of unlocking.  This should also be faster on MS Windows where
  the GIO documentation for `g_socket_get_available_bytes` states: "Note
  that on Windows, this function is rather inefficient in the UDP case".

* Implement `GstPushSrc.fill` rather than `GstPushSrc.create`.  This means
  that we will be using the downstream allocator which may be more
  efficient.  It also means that socketsrc is likely to respect its
  "blocksize" property (assuming that there is enough data available).

See https://bugzilla.gnome.org/show_bug.cgi?id=739546
2015-03-13 20:05:00 +01:00
William Manley
7c10499ecd tcp: Add element socketsrc
`socketsrc` can be considered a source counterpart to `multisocketsink`.
It can be considered a generalization of `tcpclientsrc` and
`tcpserversrc`:  it contains all the logic required to communicate over
the socket but none of the logic for creating the sockets/establishing
the connection in the first place, allowing the user to accomplish this
externally in whatever manner they wish making it applicable to other
types of sockets besides TCP.

This commit essentially copies the implementation directly from
tcpserversrc.  Later patches will tidy the implementation up and
re-implement `tcpclientsrc` and `tcpserversrc` in terms of `socketsrc`.

See https://bugzilla.gnome.org/show_bug.cgi?id=739546
2015-03-13 20:05:00 +01:00