Commit graph

374 commits

Author SHA1 Message Date
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
William Manley
b8232a7467 multisocketsink: Map GstMemorys individually when sending
If a buffer is made up of non-contiguous `GstMemory`s `gst_buffer_map`
has to copy all the data into a new `GstMemory` which is contiguous.  By
mapping all the `GstMemory`s individually and then using scatter-gather
IO we avoid this situation.

This is a preparatory step for adding support to multisocketsink for
sending file descriptors, where a GstBuffer may be made up of several
`GstMemory`s, some of which are backed by a memfd or file, but I think this
patch is valid and useful on its own.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=746150
2015-03-13 16:20:50 +01:00
Sebastian Dröge
90eb93c2ef Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.
2014-12-01 09:51:12 +01:00
William Manley
ffb43c0591 tcpserversink: Don't leak a GSocket and a GInetSocketAddress
when accepting a connection.

Discovered by `make check-valgrind` with the new `socketintegrationtest`.

https://bugzilla.gnome.org/show_bug.cgi?id=739544
2014-11-07 10:15:43 +01:00
Michael Olbrich
5ebfe5b26b tcpserversrc: close the server socket after accepting a connection
g_socket_accept() is only called once for a server socket. So
keeping the socket open ist just confusing possible clients.

https://bugzilla.gnome.org/show_bug.cgi?id=731566
2014-06-13 11:18:10 +01:00
Tim-Philipp Müller
79cf59b7dd tcpclientsrc: return FLUSHING when select() is canceled
https://bugzilla.gnome.org/show_bug.cgi?id=731567
2014-06-13 10:04:47 +01:00
Michael Olbrich
593a52a656 tcpserversrc: return FLOW_FLUSHING instead of an error when accept/select is canceled
Canceling the accept/select happens when the source is shut down. This is
not an error and the GST_FLOW_ERROR causes problems when only part of the
pipeline is shut down.

https://bugzilla.gnome.org/show_bug.cgi?id=731567
2014-06-13 09:19:49 +01:00
Tim-Philipp Müller
bcb8068e27 docs: remove outdated and pointless 'Last reviewed' lines from docs
They are very confusing for people, and more often than not
also just not very accurate. Seeing 'last reviewed: 2005' in
your docs is not very confidence-inspiring. Let's just remove
those comments.
2014-04-26 23:28:57 +01:00
Tim-Philipp Müller
1d40b1d2bb tcp: fix compilation with MSVC
error C2440 at line 165 of gsttcpserversink.c
type cast error: cannot convert from GSocket* to GstMultiSinkHandle
2013-11-28 16:24:13 +00:00
Tim-Philipp Müller
b1ff48c1a1 docs: remove old 0.10 Since markers
They're just confusing.
2013-11-16 16:10:07 +00:00
Sebastian Dröge
b12cd5432a multisocketsink: Fix handling of partial writes and WOULD_BLOCK errors 2013-07-28 13:52:28 +02:00
Sebastian Dröge
692fd81ac7 multifdsink: Update current time after every write
Each write will update the last_activity_time and otherwise we would
compare against a too old current time and immediately timeout because
current time is smaller than last activity time (overflow).
2013-07-28 13:23:41 +02:00
Sebastian Dröge
930bfe3cbc multihandlesink: Update current time after every write
Each write will update the last_activity_time and otherwise we would
compare against a too old current time and immediately timeout because
current time is smaller than last activity time (overflow).
2013-07-28 13:22:17 +02:00
Sebastian Dröge
7f6e1bdfdb tcp: Use the generic marshaller instead of generating custom ones 2013-04-25 09:20:29 +02:00
Sebastian Dröge
e06cc5295a tcp: Add FIXME comment for 2.0 to rename "host" to "bind-address" for the server elements 2013-04-25 09:06:33 +02:00
Sebastian Dröge
948a4a3632 gst: Add better support for static plugins 2013-04-15 15:52:58 +02:00
Tim-Philipp Müller
0b172593fa tcp: print warning if someone tries to add clients in NULL state
And mention this in docs.

https://bugzilla.gnome.org/show_bug.cgi?id=689326
2012-12-02 12:54:17 +00:00
Tim-Philipp Müller
5f59b4f7ee Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 23:05:09 +00:00
Sebastian Dröge
3c1041d5eb Revert "gst: Add better support for static plugins"
This reverts commit d2d79e3bc2,
which was accidentially pushed.
2012-10-24 13:26:26 +02:00
Sebastian Dröge
d2d79e3bc2 gst: Add better support for static plugins 2012-10-24 12:10:44 +02:00
Sebastian Dröge
ce0bfbb7cc tcp: sys/socket.h is needed for getsockname() and similar functions 2012-10-22 15:45:47 +02:00
Tim-Philipp Müller
0ea6526770 tcpserver{sink,src}: improve docs and property strings
And some minor clean-ups.
2012-10-19 18:29:56 +01:00
Alexandre Relange
d2f1d82778 tcpserver{sink,src}: add 'current-port' property and signal actually used port
Useful when port=0 (use random available port) was requested.

https://bugzilla.gnome.org/show_bug.cgi?id=580093
2012-10-19 18:23:20 +01:00
Mark Nauwelaerts
6a87cb5248 tcp: adjust comment style 2012-09-10 14:03:49 +02:00
Tim-Philipp Müller
9efb5f5af2 multi{fd,socket}sink: rename client-handle-removed signal to client-{fd,socket}-removed 2012-09-09 02:00:49 +01:00
Tim-Philipp Müller
84a3add409 multifdsink, multisocketsink: fix broken action signal setup
We can't just make a vfunc that takes a union of int
and pointer as argument, and then set up subclass-specific
action signals and signals that take int (in multifdsink's
case) or a GSocket * (in multisocketsink's case), and then
expect everything to Just Work. This blows up spectacularly
on PPC G4 for some reason.

Fixes multifdsink unit test on PPC, and fixes aborts in
multisocketunit test (now hangs in gst_pad_push - progress).
2012-09-09 01:57:59 +01:00
Tim-Philipp Müller
17c839c8a1 No statements with side-effects in g_assert() or g_return_*() please 2012-08-08 10:11:48 +01:00
Tim-Philipp Müller
924139f589 multifdsink: remove deprecated and unused "mode" property 2012-07-06 12:43:26 +01:00
Mark Nauwelaerts
56602aa8fc tcpclientsink: ensure proper cleanup upon startup error 2012-04-24 17:15:23 +02:00
Mark Nauwelaerts
62cc0cade7 tcp: update property documentation to reference correct property 2012-04-11 21:45:46 +02:00
Tim-Philipp Müller
3c6a3ad629 Use new gst_element_class_set_static_metadata() 2012-04-10 00:45:16 +01:00
Sebastian Dröge
ad42b16375 gst: Update for GST_PLUGIN_DEFINE() API change 2012-04-05 15:11:05 +02:00
Raimo Järvi
086bee8c14 tcp: Fix compiling with mingw
https://bugzilla.gnome.org/show_bug.cgi?id=673056
2012-04-02 11:26:45 +02:00
Alessandro Decina
9f1732fba7 Fix compiler warnings 2012-02-26 20:36:46 +01:00
Christian Fredrik Kalager Schaller
4a774a1eea Add missing header file to build file 2012-02-13 16:03:03 +00:00
Thomas Vander Stichele
4d59dc2391 multifdsink: depends on sys/socket.h 2012-02-12 22:23:45 +01:00
Thomas Vander Stichele
b11c895efe multihandlesink: finish refactor 2012-02-12 22:23:45 +01:00
Thomas Vander Stichele
029b9b49de multihandle: rename num-fds/-sockets to num-handles 2012-02-12 22:23:45 +01:00
Thomas Vander Stichele
fa14beb88b multihandlesink: rework to use Handle 2012-02-12 22:23:45 +01:00
Thomas Vander Stichele
64d8ec6459 multihandlesink: introduce Handle union 2012-02-12 22:23:44 +01:00
Thomas Vander Stichele
14ac8bb585 multihandlesink: rework to use GST_TYPE_FORMAT 2012-02-12 22:23:44 +01:00
Thomas Vander Stichele
16a675081d test: use more literal enums 2012-02-12 22:23:44 +01:00
Thomas Vander Stichele
020739664a multihandlesink: further refactoring 2012-02-12 22:23:44 +01:00
Thomas Vander Stichele
99185cc8f5 multisocketsink: fix refcounting bug 2012-02-12 22:17:56 +01:00
Thomas Vander Stichele
604ddc8740 multihandlesink: further refactoring 2012-02-12 22:17:56 +01:00
Thomas Vander Stichele
d21c42a709 multihandlesink: fix one bug in multisocketsink refactoring 2012-02-12 22:10:51 +01:00
Thomas Vander Stichele
c024274261 multihandlesink: first stab at common base class 2012-02-12 22:10:50 +01:00
Thomas Vander Stichele
684aa4baaf gst/tcp: Factor out common symbols; fix tests. 2012-02-12 22:07:29 +01:00
Thomas Vander Stichele
3b0fae73ae multifdsink: put back multifdsink before refactoring 2012-02-12 22:07:29 +01:00
Wim Taymans
a75e9102c5 GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING 2012-02-08 15:17:49 +01:00
Wim Taymans
be0cadac03 update for HEADER flag changes 2012-01-30 17:16:17 +01:00
Andoni Morales Alastruey
7e97a21b10 tcpserversink: remove unused include 2012-01-26 15:26:43 +01:00
Wim Taymans
fcdc385aa1 port to new map API 2012-01-25 12:30:53 +01:00
Wim Taymans
3d42f0f6ed port to new glib thread API 2012-01-19 11:36:17 +01:00
Wim Taymans
8dcb565221 tcp: work around compiler warnings 2012-01-19 09:17:31 +01:00
Tim-Philipp Müller
576bbb4fd8 Remove compatibility code cruft for old GLib versions 2012-01-18 17:22:21 +00:00
Sebastian Dröge
6cb38409d1 tcp: Fix handling of closed connections 2012-01-17 12:21:54 +01:00
Sebastian Dröge
6d6593b757 tcp: Add support for IPv6 2012-01-17 12:08:17 +01:00
Sebastian Dröge
a649fe2d61 tcp: Only read as much as is currently available from the socket 2012-01-17 11:44:20 +01:00
Sebastian Dröge
c2438ba868 tcp: Don't leak the resolver if name resolval failed 2012-01-17 11:32:01 +01:00
Sebastian Dröge
7e4d0b0038 multisocketsink: Fix possible GType namespace conflicts with the private element enums 2012-01-16 12:29:35 +01:00
Sebastian Dröge
7794a11347 multisocketsink: Re-add QoS DSCP property 2012-01-16 12:17:00 +01:00
Sebastian Dröge
1148919ad0 tcp: Remove old socket helper functions 2012-01-16 11:31:46 +01:00
Sebastian Dröge
17254bbd23 tcpserversink: Port to GIO
And change multifdsink to GIO too and rename it to multisocketsink
because it only works on GSockets now, not generic fds.
2012-01-16 11:31:40 +01:00
Sebastian Dröge
d29c7826ab tcpserversrc: Port to GIO 2012-01-16 11:13:37 +01:00
Sebastian Dröge
2a2acedde0 tcpclientsink: Port to GIO 2012-01-16 11:13:37 +01:00
Sebastian Dröge
075ec8b4e4 tcpclientsrc: Port to GIO 2012-01-16 11:13:31 +01:00
Wim Taymans
24d405b609 multifdsink: use pad caps for streamheader
Instead of using the caps on the buffer, use the caps on the pad.
2012-01-04 17:57:39 +01:00
Tim-Philipp Müller
17359744f3 tcp: remove some dataprotocol cruft
The protocol=gdp property has been removed in favour
of explicit gdppay/depay.
2011-12-25 23:25:31 +00:00
Tim-Philipp Müller
fb6d09055a Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	ext/alsa/gstalsadeviceprobe.c
	ext/alsa/gstalsamixer.c
	ext/pango/gsttextoverlay.c
	ext/pango/gsttextoverlay.h
	gst-libs/gst/audio/gstaudiobasesink.c
	gst-libs/gst/audio/gstaudioringbuffer.c
	gst-libs/gst/audio/gstaudiosrc.c
	gst-libs/gst/video/Makefile.am
	gst-libs/gst/video/video.c
	gst/encoding/gststreamcombiner.c
	gst/encoding/gststreamsplitter.c
	gst/playback/gstplaybasebin.c
	gst/playback/gststreamsynchronizer.c
	gst/playback/gstsubtitleoverlay.c
	gst/playback/gsturidecodebin.c
	sys/xvimage/xvimagesink.c
	tests/examples/Makefile.am
	win32/common/libgstvideo.def

Video overlay composition disabled for now, needs
porting to buffer meta.
2011-12-08 01:19:03 +00:00
Tim-Philipp Müller
5440ae3c18 Suppress deprecation warnings in selected files, for g_static_rec_mutex_* mostly
GStaticRecMutex is part of our API/ABI, not much we can do here
in 0.10 for most of these.
2011-12-04 20:50:25 +00:00
Tim-Philipp Müller
0d98aa25b8 Work around deprecated thread API in glib master
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We'll change these
over to the new API once we depend on glib >= 2.32.

Replace g_thread_create() with g_thread_try_new().
2011-12-04 17:16:30 +00:00
Tim-Philipp Müller
177525f89f Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst-libs/gst/netbuffer/gstnetbuffer.c
	gst/ffmpegcolorspace/avcodec.h
	gst/ffmpegcolorspace/gstffmpegcodecmap.c
	gst/ffmpegcolorspace/imgconvert.c
	gst/ffmpegcolorspace/imgconvert_template.h
	gst/ffmpegcolorspace/mem.c
	gst/playback/README
	gst/playback/gstplaybasebin.c
	gst/playback/gstplaybasebin.h
	gst/playback/gstplaybin.c
	sys/v4l/v4lmjpegsrc_calls.c
	sys/v4l/videodev_mjpeg.h
	tests/check/elements/gnomevfssink.c
2011-12-02 11:10:17 +00:00
Piotr Fusik
14644457b0 various: typo fixes
Fix typos in code and docs. Fixes. #658984
2011-12-02 12:03:27 +01:00
Vincent Penquerc'h
96374054ac various: fix pad template leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
2011-11-28 13:09:02 +00:00
Wim Taymans
f1088ed647 update for UNEXPECTED -> EOS flowreturn 2011-10-10 11:39:52 +02:00
Josep Torra
5629ed74b3 Fix debug statements
Fixes build on MacOSX

Signed-off-by: Edward Hervey <edward.hervey@collabora.co.uk>
2011-08-10 11:15:41 +02:00
Debarshi Ray
2c6dbae423 Remove unused but set variables
This is needed to satisfy the new -Wunused-but-set-variable added in
GCC 4.6: http://gcc.gnu.org/gcc-4.6/changes.html
2011-06-14 22:40:13 +01:00
Sebastian Dröge
7330318e2f tcpclientsrc: Update for negotation related API changes 2011-05-16 15:35:41 +02:00
Wim Taymans
ec57868488 -base: don't use buffer caps
Port to newest 0.11 core API, remove GST_PAD_CAPS and GST_BUFFER_CAPS.
2011-05-09 13:05:12 +02:00
Sebastian Dröge
f10a8f0986 gst: Use G_DEFINE_TYPE instead of GST_BOILERPLATE 2011-04-19 11:35:53 +02:00
Sebastian Dröge
352edd1dd9 Merge branch 'master' into 0.11 2011-04-16 09:12:31 +02:00
Tim-Philipp Müller
a90adccacd multifdsink: do check return values of fcntl() and fstat()
https://bugzilla.gnome.org/show_bug.cgi?id=647294
2011-04-12 12:24:44 +01:00
Marc Plano-Lesay
bf2b14f860 fix unused-but-set-variable warnings with gcc 4.6
https://bugzilla.gnome.org/show_bug.cgi?id=647294
2011-04-12 12:24:37 +01:00
Wim Taymans
6e160bed3d Merge branch 'master' into 0.11
Conflicts:
	android/alsa.mk
	android/app.mk
	android/app_plugin.mk
	android/audio.mk
	android/audioconvert.mk
	android/decodebin.mk
	android/decodebin2.mk
	android/gdp.mk
	android/interfaces.mk
	android/netbuffer.mk
	android/pbutils.mk
	android/playbin.mk
	android/queue2.mk
	android/riff.mk
	android/rtp.mk
	android/rtsp.mk
	android/sdp.mk
	android/tag.mk
	android/tcp.mk
	android/typefindfunctions.mk
	android/video.mk
2011-04-11 11:37:51 +02:00
Alessandro Decina
030f639a8e android: make it ready for androgenizer
Remove the android/ top dir
Fixe the Makefile.am to be androgenized

To build gstreamer for android we are now using androgenizer which generates the
needed Android.mk files.
Androgenizer can be found here:
http://git.collabora.co.uk/?p=user/derek/androgenizer.git
2011-04-11 07:23:21 +02:00
Wim Taymans
3b03e23559 plugins: port some plugins to the new memory API 2011-03-27 16:35:28 +02:00
Andoni Morales Alastruey
8c13488022 multifdsink: disconnect inactive clients in the select loop too
Clients are usually disconnected in the streaming thread if their inactivity
is bigger than the timeout. If no new buffers are to be rendered in the sink,
these clients will never be disconnected and for that reason it should be
handled in the select() loop too.
2011-03-10 15:10:51 +01:00
Andoni Morales Alastruey
4a64969b3d multifdsink: disconnect inactive clients in the select loop too
Clients are usually disconnected in the streaming thread if their inactivity
is bigger than the timeout. If no new buffers are to be rendered in the sink,
these clients will never be disconnected and for that reason it should be
handled in the select() loop too.
2011-03-10 15:10:00 +01:00
Wim Taymans
c6dd11981d Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	gst-libs/gst/pbutils/Makefile.am
2011-02-28 11:47:44 +01:00
Mark Nauwelaerts
e5e09844ea tcp: use socklen_t where appropriate rather than specific type
In particular, fixes Cygwin build where socklen_t is defined as int
in line with native win32 api definition.
2011-01-31 19:21:32 +01:00
Wim Taymans
b1696cf21d multifdsink: only keep last valid timestamp
Fixes #634397
2010-12-29 12:55:24 +01:00
Andoni Morales Alastruey
c41a4d0df4 multifdsink: add first and last buffer's timestamp to the stats 2010-12-29 12:55:24 +01:00
Wim Taymans
5b4959d5d1 tcp: remove deprecated GDP protocol 2010-12-06 20:01:35 +01:00
Sebastian Dröge
b2d716c340 tcp: Remove dead assignment 2010-12-02 19:04:29 +01:00
Zaheer Abbas Merali
b3629a7e1f multifdsink: gdp protocol is deprecated. People should use gdppay instead. 2010-10-07 18:55:34 +01:00