platform/upstream/gstreamer.git
5 years agoRelease 1.15.2
Tim-Philipp Müller [Tue, 26 Feb 2019 11:58:53 +0000 (11:58 +0000)]
Release 1.15.2

5 years agortsp-media: Fix multicast use case with common media
Göran Jönsson [Tue, 19 Feb 2019 08:45:08 +0000 (09:45 +0100)]
rtsp-media: Fix multicast use case with common media

Use case
client 1: SETUP
client 1: PLAY
client 2: SETUP
client 1: TEARDOWN
client 2: PLAY
client 2: TEARDOWN

5 years agortsp-server: remove recursive behavior
Göran Jönsson [Wed, 16 Jan 2019 11:59:11 +0000 (12:59 +0100)]
rtsp-server: remove recursive behavior

Introduce a threadpool to send rtp and rtcp to avoid recursive behavior.

5 years agortsp-client: Only allow to set either a send_func or send_messages_func but not both
Sebastian Dröge [Fri, 25 Jan 2019 12:22:42 +0000 (14:22 +0200)]
rtsp-client: Only allow to set either a send_func or send_messages_func but not both

And route all messages through the send_func if no send_messages_func
was provided.

We otherwise break backwards compatibility.

5 years agortsp-client: Add support for sending buffer lists directly
Sebastian Dröge [Mon, 17 Sep 2018 19:18:46 +0000 (22:18 +0300)]
rtsp-client: Add support for sending buffer lists directly

Fixes https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/29

5 years agortsp-server: Add support for buffer lists
Sebastian Dröge [Wed, 27 Jun 2018 10:17:07 +0000 (12:17 +0200)]
rtsp-server: Add support for buffer lists

This adds new functions for passing buffer lists through the different
layers without breaking API/ABI, and enables the appsink to actually
provide buffer lists.

This should already reduce CPU usage and potentially context switches a
bit by passing a whole buffer list from the appsink instead of
individual buffers. As a next step it would be necessary to
  a) Add support for a vector of data for the GstRTSPMessage body
  b) Add support for sending multiple messages at once to the
    GstRTSPWatch and let it be handled internally
  c) Adding API to GOutputStream that works like writev()

Fixes https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/29

5 years agoclient: Fix crash in close handler
Benjamin Berg [Tue, 4 Dec 2018 13:12:04 +0000 (14:12 +0100)]
client: Fix crash in close handler

The close handler could trigger a crash because it invalidated the
watch_context while still leaving a source attached to it which would be
cleaned up at a later point.

5 years agortsp-stream: Use cached address when allocating sockets
Edward Hervey [Tue, 29 Jan 2019 13:42:35 +0000 (14:42 +0100)]
rtsp-stream: Use cached address when allocating sockets

If an address/port was previously decided upon (ex: multicast in the
SDP), then use that instead of re-creating another one

Fixes https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/57

5 years agortsp-media: Fix race codition in finish_unprepare
Lars Wiréen [Thu, 27 Dec 2018 10:28:17 +0000 (11:28 +0100)]
rtsp-media: Fix race codition in finish_unprepare

The previous fix for race condition around finish_unprepare where the
function could be called twice assumed that the status wouldn't change
during execution of the function. This assumption is incorrect as the
state may change, for example if an error message arrives from the
pipeline bus.

Instead a flag keeping track on whether the finish_unprepare function
is currently executing is introduced and checked.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/59

5 years agoRelease 1.15.1
Tim-Philipp Müller [Thu, 17 Jan 2019 02:26:48 +0000 (02:26 +0000)]
Release 1.15.1

5 years agoAdd source elements to the pipeline before activation
Patricia Muscalu [Wed, 5 Dec 2018 14:07:25 +0000 (15:07 +0100)]
Add source elements to the pipeline before activation

In plug_src we changed the element state before adding it to
the owner container. This prevented the pipeline from intercepting
a GST_STREAM_STATUS_TYPE_CREATE message from the pad in order
to assign a custom task pool.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/53

5 years agoAutomatic update of common submodule
Thibault Saunier [Wed, 5 Dec 2018 20:24:59 +0000 (17:24 -0300)]
Automatic update of common submodule

From ed78bee to 59cb678

5 years agoexamples: test-appsrc: fix coding style error
Ingo Randolf [Tue, 20 Nov 2018 18:12:09 +0000 (19:12 +0100)]
examples: test-appsrc: fix coding style error

5 years agoexamples: test-appsrc: fix buffer leak
Ingo Randolf [Tue, 20 Nov 2018 10:07:48 +0000 (11:07 +0100)]
examples: test-appsrc: fix buffer leak

5 years agortsp-media: Update priv->blocked when linked streams are unblocked.
Patricia Muscalu [Sat, 17 Nov 2018 18:19:54 +0000 (19:19 +0100)]
rtsp-media: Update priv->blocked when linked streams are unblocked.

Media is considered to be blocked when all streams that belong to
that media are blocked.
This patch solves the problem of inconsistent updates of
priv->blocked that are not synchronized with the media state.

5 years agortsp-media: Don't block streams before seeking
Patricia Muscalu [Sat, 17 Nov 2018 17:18:27 +0000 (18:18 +0100)]
rtsp-media: Don't block streams before seeking

Before the seek operation is performed on media, it's required that
its pipeline is prepared <=> the pipeline is in the PAUSED state.
At this stage, all transport parts (transport sinks) have been successfully
added to the pipeline and there is no need for blocking the streams.

5 years agotests: rtspserver: Add shared media test case for TCP
Patricia Muscalu [Sat, 17 Nov 2018 15:11:53 +0000 (16:11 +0100)]
tests: rtspserver: Add shared media test case for TCP

5 years agortsp-stream: Use seqnum-offset for rtpinfo
Linus Svensson [Tue, 6 Nov 2018 17:21:54 +0000 (18:21 +0100)]
rtsp-stream: Use seqnum-offset for rtpinfo

The sequence number in the rtpinfo is supposed to be the first RTP
sequence number. The "seqnum" property on a payloader is supposed to be
the number from the last processed RTP packet. The sequence number for
payloaders that inherit gstrtpbasepayload will not be correct in case of
buffer lists. In order to fix the seqnum property on the payloaders
gst-rtsp-server must get the sequence number for rtpinfo elsewhere and
"seqnum-offset" from the "stats" property contains the value of the
very first RTP packet in a stream. The server will, however, try to look
at the last simple in the sink element and only use properties on the
payloader in case there no sink elements yet, and by looking at the last
sample of the sink gives the server full control of which RTP packet it
looks at. If the payloader does not have the "stats" property, "seqnum"
is still used since "seqnum-offset" is only present in as part of
"stats" and this is still an issue not solved with this patch.

Needed for gst-plugins-base!17

5 years agortsp-stream: Plug memory leak
Linus Svensson [Tue, 6 Nov 2018 17:10:56 +0000 (18:10 +0100)]
rtsp-stream: Plug memory leak

Attaching a GSource to a context will increase the refcount. The idle
source will never be free'd since the initial reference is never
dropped.

5 years agoAdd Gitlab CI configuration
Jordan Petridis [Mon, 12 Nov 2018 14:06:39 +0000 (16:06 +0200)]
Add Gitlab CI configuration

This commit adds a .gitlab-ci.yml file, which uses a feature
to fetch the config from a centralized repository. The intent is
to have all the gstreamer modules use the same configuration.

The configuration is currently hosted at the gst-ci repository
under the gitlab/ci_template.yml path.

Part of https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/29

5 years agoUpdate git locations to gitlab
Matthew Waters [Mon, 5 Nov 2018 05:56:35 +0000 (05:56 +0000)]
Update git locations to gitlab

5 years agomeson: add new onvif types
Mathieu Duponchelle [Thu, 1 Nov 2018 13:20:16 +0000 (14:20 +0100)]
meson: add new onvif types

5 years agoAdd ONVIF subclass headers to the installed headers in meson.build too
Sebastian Dröge [Thu, 1 Nov 2018 10:49:51 +0000 (12:49 +0200)]
Add ONVIF subclass headers to the installed headers in meson.build too

5 years agortsp-server: Declare GstRTSPServer struct before anything else
Sebastian Dröge [Thu, 1 Nov 2018 09:29:01 +0000 (11:29 +0200)]
rtsp-server: Declare GstRTSPServer struct before anything else

It's needed by all kinds of other headers, including the ones that are
required for defining the GstRTSPServer struct itself and its API.

5 years agoMark all ONVIF-specific subclasses as Since 1.14
Sebastian Dröge [Thu, 1 Nov 2018 08:23:02 +0000 (10:23 +0200)]
Mark all ONVIF-specific subclasses as Since 1.14

5 years agoInclude ONVIF types from single-include rtsp-server.h
Sebastian Dröge [Thu, 1 Nov 2018 08:18:22 +0000 (10:18 +0200)]
Include ONVIF types from single-include rtsp-server.h

... by actually making it a single-include header and moving everything
related to the GstRTSPServer type to rtsp-server-object.h instead.
Otherwise there are too many circular includes.

https://bugzilla.gnome.org/show_bug.cgi?id=797361

5 years agortsp-stream: use idle source in on_message_sent
Göran Jönsson [Thu, 18 Oct 2018 05:25:05 +0000 (07:25 +0200)]
rtsp-stream: use idle source in on_message_sent

When the underlying layers are running on_message_sent, this sometimes
causes the underlying layer to send more data, which will cause the
underlying layer to run callback on_message_sent again. This can go on
and on.

To break this chain, we introduce an idle source that takes care of
sending data if there are more to send when running callback

https://bugzilla.gnome.org/show_bug.cgi?id=797289

5 years agortsp-client: Remove timeout GSource on cleanup
Edward Hervey [Sat, 20 Oct 2018 14:14:53 +0000 (16:14 +0200)]
rtsp-client: Remove timeout GSource on cleanup

Avoids ending up with races where a timeout would still be around
*after* a client was gone. This could happen rather easily in
RTSP-over-HTTP mode on a local connection, where each RTSP message
would be sent as a different HTTP connection with the same tunnelid.

If not properly removed, that timeout would then try to free again
a client (and its contents).

5 years agoautotools: fix distcheck
Tim-Philipp Müller [Thu, 4 Oct 2018 13:31:59 +0000 (14:31 +0100)]
autotools: fix distcheck

5 years agoonvif: encapsulate onvif part into a bin
Ognyan Tonchev [Wed, 12 Sep 2018 09:55:15 +0000 (11:55 +0200)]
onvif: encapsulate onvif part into a bin

...and thus do not let onvif affect pipelines latency

https://bugzilla.gnome.org/show_bug.cgi?id=797174

5 years agotests: client: Avoid bind() failures in tests
Patricia Muscalu [Thu, 27 Sep 2018 17:57:13 +0000 (19:57 +0200)]
tests: client: Avoid bind() failures in tests

https://bugzilla.gnome.org/show_bug.cgi?id=797059

5 years agoNew property for socket binding to mcast addresses
Patricia Muscalu [Thu, 6 Sep 2018 14:17:33 +0000 (16:17 +0200)]
New property for socket binding to mcast addresses

By default the multicast sockets are bound to INADDR_ANY,
as it's not allowed to bind sockets to multicast addresses
in Windows. This default behaviour can be changed by setting
bind-mcast-address property on the media-factory object.

https://bugzilla.gnome.org/show_bug.cgi?id=797059

5 years agolibs: fix API export/import and 'inconsistent linkage' on MSVC
Tim-Philipp Müller [Mon, 24 Sep 2018 08:36:21 +0000 (09:36 +0100)]
libs: fix API export/import and 'inconsistent linkage' on MSVC

Export rtsp-server library API in headers when we're building the
library itself, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

Fix up some missing config.h includes when building the lib which
is needed to get the export api define from config.h

https://bugzilla.gnome.org/show_bug.cgi?id=797185

5 years agortsp-media-factory: Add missing break statements
Edward Hervey [Wed, 19 Sep 2018 12:31:56 +0000 (14:31 +0200)]
rtsp-media-factory: Add missing break statements

This resulted in warnings/assertions whenever one accessed the
max-mcast-ttl property.

CID #1439515
CID #1439523

5 years agomeson: add gobject-cast-checks, glib-asserts, glib-checks options
Tim-Philipp Müller [Wed, 19 Sep 2018 11:21:30 +0000 (12:21 +0100)]
meson: add gobject-cast-checks, glib-asserts, glib-checks options

5 years agomeson: add option to disable build of rtspclientsink plugin
Tim-Philipp Müller [Wed, 19 Sep 2018 11:17:57 +0000 (12:17 +0100)]
meson: add option to disable build of rtspclientsink plugin

5 years agomeson: re-arrange options
Tim-Philipp Müller [Wed, 19 Sep 2018 11:10:14 +0000 (12:10 +0100)]
meson: re-arrange options

5 years agomeson: Use feature option for tests option
Nirbheek Chauhan [Sat, 1 Sep 2018 05:51:15 +0000 (11:21 +0530)]
meson: Use feature option for tests option

This was somehow missed the last time around.

5 years agomeson: Maintain macOS ABI through dylib versioning
Nirbheek Chauhan [Fri, 31 Aug 2018 09:12:15 +0000 (14:42 +0530)]
meson: Maintain macOS ABI through dylib versioning

Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library

5 years agomeson: add pkg-config file for the rtspclientsink plugin
Matthew Waters [Fri, 31 Aug 2018 07:20:47 +0000 (17:20 +1000)]
meson: add pkg-config file for the rtspclientsink plugin

5 years agortsp-client: Avoid reuse of channel numbers for interleaved
David Svensson Fors [Fri, 17 Aug 2018 07:54:27 +0000 (09:54 +0200)]
rtsp-client: Avoid reuse of channel numbers for interleaved

If a (strange) client would reuse interleaved channel numbers in
multiple SETUP requests, we should not accept them. The channel
numbers are used for looking up stream transports in the
priv->transports hash table, and transports disappear from the table
if channel numbers are reused.

RFC 7826 (RTSP 2.0), Section 18.54, clarifies that it is OK for the
server to change the channel numbers suggested by the client.

https://bugzilla.gnome.org/show_bug.cgi?id=796988

5 years agortsp-client: Add unit test of SETUP for RTSP/RTP/TCP
David Svensson Fors [Fri, 17 Aug 2018 07:54:27 +0000 (09:54 +0200)]
rtsp-client: Add unit test of SETUP for RTSP/RTP/TCP

Allow regex for matching transport header against expected pattern.

https://bugzilla.gnome.org/show_bug.cgi?id=796988

5 years agomeson: There is no gstreamer-plugins-good-1.0.pc
Nirbheek Chauhan [Wed, 15 Aug 2018 13:27:27 +0000 (18:57 +0530)]
meson: There is no gstreamer-plugins-good-1.0.pc

There is no installed version of that, only an uninstalled version.

5 years agoFix indentation again
Sebastian Dröge [Tue, 14 Aug 2018 11:31:55 +0000 (14:31 +0300)]
Fix indentation again

5 years agostream: Added a list of multicast client addresses
Patricia Muscalu [Thu, 26 Jul 2018 10:01:16 +0000 (12:01 +0200)]
stream: Added a list of multicast client addresses

When media is shared, the same media stream can be sent
to multiple multicast groups. Currently, there is no API
to retrieve multicast addresses from the stream.
When calling gst_rtsp_stream_get_multicast_address() function,
only the first multicast address is returned.
With this patch, each multicast destination requested in SETUP
will be stored in an internal list (call to
gst_rtsp_stream_add_multicast_client_address()).
The list of multicast groups requested by the clients can be
retrieved by calling gst_rtsp_stream_get_multicast_client_addresses().
There still exist some problems with the current implementation
in the multicast case:
1) The receiving part is currently only configured with
regard to the first multicast client (see
https://bugzilla.gnome.org/show_bug.cgi?id=796917).
2) Secondly, of security reasons, some constraints should be
put on the requested multicast destinations (see
https://bugzilla.gnome.org/show_bug.cgi?id=796916).

Change-Id: I6b060746e472a0734cc2fd828ffe4ea2956733ea

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agostream: Choose the maximum ttl value provided by multicast clients
Patricia Muscalu [Wed, 25 Jul 2018 13:33:18 +0000 (15:33 +0200)]
stream: Choose the maximum ttl value provided by multicast clients

The maximum ttl value provided so far by the multicast clients
will be chosen and reported in the response to the current
client request.

Change-Id: I5408646e3b5a0a224d907ae215bdea60c4f1905f

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agortsp-stream: Don't require address pool in the transport specific case
Patricia Muscalu [Fri, 23 Feb 2018 13:34:32 +0000 (14:34 +0100)]
rtsp-stream: Don't require address pool in the transport specific case

If "transport.client-settings" parameter is set to true, the client is
allowed to specify destination, ports and ttl.
There is no need for pre-configured address pool.

Change-Id: I6ae578fb5164d78e8ec1e2ee82dc4eaacd0912d1

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agoclient: Don't reserve multicast address in the client setting case
Patricia Muscalu [Tue, 24 Jul 2018 12:02:40 +0000 (14:02 +0200)]
client: Don't reserve multicast address in the client setting case

When two multicast clients request specific transport
configurations, and "transport.client-settings" parameter is
set to true, it's wrong to actually require that these two
clients request the same multicast group.
Removed test_client_multicast_invalid_transport_specific test
cases as they wrongly require that the requested destination
address is supposed to be present in the address pool, also in
the case when "transport.client-settings" parameter is set to true.

Change-Id: I4580182ef35996caf644686d6139f72ec599c9fa

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agoAdd new API for setting/getting maximum multicast ttl value
Patricia Muscalu [Tue, 24 Jul 2018 07:35:46 +0000 (09:35 +0200)]
Add new API for setting/getting maximum multicast ttl value

Change-Id: I5ef4758188c14785e17fb8fbf42a3dc0cb054233

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agortsp-stream: avoid duplicating the first multicast client
Mathieu Duponchelle [Tue, 31 Jul 2018 19:17:41 +0000 (21:17 +0200)]
rtsp-stream: avoid duplicating the first multicast client

In dcb4533fedae3ac62bc25a916eb95927b7d69aec , we made it so
clients were dynamically added and removed to the multicast
udp sinks, as such we should no longer add a first client in
set_multicast_socket_for_udpsink

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agoRevert "rtsp-stream: avoid duplicating the first multicast client"
Sebastian Dröge [Tue, 14 Aug 2018 11:25:53 +0000 (14:25 +0300)]
Revert "rtsp-stream: avoid duplicating the first multicast client"

This reverts commit 33570944401747f44d8ebfec535350651413fb92.

Commits where accidentially squashed together

5 years agoRevert "Add new API for setting/getting maximum multicast ttl value"
Sebastian Dröge [Tue, 14 Aug 2018 11:25:42 +0000 (14:25 +0300)]
Revert "Add new API for setting/getting maximum multicast ttl value"

This reverts commit 7f0ae77e400fb8a0462a76a5dd2e63e12c4a2e52.

Commits where accidentially squashed together

5 years agoRevert "rtsp-stream: Don't require address pool in the transport specific case"
Sebastian Dröge [Tue, 14 Aug 2018 11:25:37 +0000 (14:25 +0300)]
Revert "rtsp-stream: Don't require address pool in the transport specific case"

This reverts commit a9db3e7f092cfeb5475e9aa24b1e91906c141d52.

Commits where accidentially squashed together

5 years agoRevert "stream: Choose the maximum ttl value provided by multicast clients"
Sebastian Dröge [Tue, 14 Aug 2018 11:25:14 +0000 (14:25 +0300)]
Revert "stream: Choose the maximum ttl value provided by multicast clients"

This reverts commit 499e437e501215849d24cdaa157e0edf4de097d0.

Commits where accidentially squashed together

5 years agoexamples: Fix indentation
Sebastian Dröge [Tue, 14 Aug 2018 11:10:56 +0000 (14:10 +0300)]
examples: Fix indentation

5 years agostream: Choose the maximum ttl value provided by multicast clients
Patricia Muscalu [Wed, 25 Jul 2018 13:33:18 +0000 (15:33 +0200)]
stream: Choose the maximum ttl value provided by multicast clients

The maximum ttl value provided so far by the multicast clients
will be chosen and reported in the response to the current
client request.

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agortsp-stream: Don't require address pool in the transport specific case
Patricia Muscalu [Fri, 23 Feb 2018 13:34:32 +0000 (14:34 +0100)]
rtsp-stream: Don't require address pool in the transport specific case

If "transport.client-settings" parameter is set to true, the client is
allowed to specify destination, ports and ttl.
There is no need for pre-configured address pool.

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agoAdd new API for setting/getting maximum multicast ttl value
Patricia Muscalu [Tue, 24 Jul 2018 07:35:46 +0000 (09:35 +0200)]
Add new API for setting/getting maximum multicast ttl value

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agortsp-stream: avoid duplicating the first multicast client
Mathieu Duponchelle [Tue, 31 Jul 2018 19:17:41 +0000 (21:17 +0200)]
rtsp-stream: avoid duplicating the first multicast client

In dcb4533fedae3ac62bc25a916eb95927b7d69aec , we made it so
clients were dynamically added and removed to the multicast
udp sinks, as such we should no longer add a first client in
set_multicast_socket_for_udpsink

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agortsp-server: Add gstreamer-base gir dir in autotools
Thibault Saunier [Mon, 6 Aug 2018 19:33:04 +0000 (15:33 -0400)]
rtsp-server: Add gstreamer-base gir dir in autotools

5 years agortsp-client: always allocate both IPV4 and IPV6 sockets
Mathieu Duponchelle [Wed, 25 Jul 2018 17:54:55 +0000 (19:54 +0200)]
rtsp-client: always allocate both IPV4 and IPV6 sockets

multiudpsink does not support setting the socket* properties
after it has started, which meant that rtsp-server could no
longer serve on both IPV4 and IPV6 sockets since the patches
from https://bugzilla.gnome.org/show_bug.cgi?id=757488 were
merged.

When first connecting an IPV6 client then an IPV4 client,
multiudpsink fell back to using the IPV6 socket.

When first connecting an IPV4 client, then an IPV6 client,
multiudpsink errored out, released the IPV4 socket, then
crashed when trying to send a message on NULL nevertheless,
that is however a separate issue.

This could probably be fixed by handling the setting of
sockets in multiudpsink after it has started, that will
however be a much more significant effort.

For now, this commit simply partially reverts the behaviour
of rtsp-stream: it will continue to only create the udpsinks
when needed, as was the case since the patches were merged,
it will however when creating them, always allocate both
sockets and set them on the sink before it starts, as was
the case prior to the patches.

Transport configuration will only error out if the allocation
of UDP sockets fails for the actual client's family, this
also downgrades the GST_ERRORs in alloc_ports_one_family
to GST_WARNINGs, as failing to allocate is no longer
necessarily fatal.

https://bugzilla.gnome.org/show_bug.cgi?id=796875

5 years agomeson: Convert common options to feature options
Nirbheek Chauhan [Wed, 25 Jul 2018 11:52:20 +0000 (17:22 +0530)]
meson: Convert common options to feature options

These are necessary for gst-build to set options correctly. The
remaining automagic option is cgroup support in examples.

https://bugzilla.gnome.org/show_bug.cgi?id=795107

5 years agortsp-stream: Slightly simplify locking
Sebastian Dröge [Mon, 23 Jul 2018 15:03:51 +0000 (18:03 +0300)]
rtsp-stream: Slightly simplify locking

5 years agoLimit queued TCP data messages to one per stream
David Svensson Fors [Thu, 28 Jun 2018 09:22:21 +0000 (11:22 +0200)]
Limit queued TCP data messages to one per stream

Before, the watch backlog size in GstRTSPClient was changed
dynamically between unlimited and a fixed size, trying to avoid both
unlimited memory usage and deadlocks while waiting for place in the
queue. (Some of the deadlocks were described in a long comment in
handle_request().)

In the previous commit, we changed to a fixed backlog size of 100.
This is possible, because we now handle RTP/RTCP data messages differently
from RTSP request/response messages.

The data messages are messages tunneled over TCP. We allow at most one
queued data message per stream in GstRTSPClient at a time, and
successfully sent data messages are acked by sending a "message-sent"
callback from the GstStreamTransport. Until that ack comes, the
GstRTSPStream does not call pull_sample() on its appsink, and
therefore the streaming thread in the pipeline will not be blocked
inside GstRTSPClient, waiting for a place in the queue.

pull_sample() is called when we have both an ack and a "new-sample"
signal from the appsink. Then, we know there is a buffer to write.

RTSP request/response messages are not acked in the same way as data
messages. The rest of the 100 places in the queue are used for
them. If the queue becomes full of request/response messages, we
return an error and close the connection to the client.

Change-Id: I275310bc90a219ceb2473c098261acc78be84c97

5 years agortsp-client: Use fixed backlog size
David Svensson Fors [Thu, 28 Jun 2018 09:22:13 +0000 (11:22 +0200)]
rtsp-client: Use fixed backlog size

Change to using a fixed backlog size WATCH_BACKLOG_SIZE.

Preparation for the next commit, which changes to a different way of
avoiding both deadlocks and unlimited memory usage with the watch
backlog.

5 years agortsp-media: unref clock (if set) when finalizing
Carlos Rafael Giani [Mon, 16 Jul 2018 19:57:08 +0000 (21:57 +0200)]
rtsp-media: unref clock (if set) when finalizing

https://bugzilla.gnome.org/show_bug.cgi?id=796814

5 years agortsp-media: add gst_rtsp_media_*_set_clock to docs
Carlos Rafael Giani [Mon, 16 Jul 2018 19:56:44 +0000 (21:56 +0200)]
rtsp-media: add gst_rtsp_media_*_set_clock to docs

https://bugzilla.gnome.org/show_bug.cgi?id=796814

5 years agomedia-factory: unref old clock when setting new clock
Tim-Philipp Müller [Thu, 12 Jul 2018 18:01:54 +0000 (19:01 +0100)]
media-factory: unref old clock when setting new clock

https://bugzilla.gnome.org/show_bug.cgi?id=796724

5 years agomedia-factory: unref clock in finalize
Brendan Shanks [Fri, 29 Jun 2018 22:20:57 +0000 (15:20 -0700)]
media-factory: unref clock in finalize

https://bugzilla.gnome.org/show_bug.cgi?id=796724

5 years agortsp-onvif-media: fix g-ir-scanner warnings
Tim-Philipp Müller [Thu, 12 Jul 2018 17:57:21 +0000 (18:57 +0100)]
rtsp-onvif-media: fix g-ir-scanner warnings

5 years ago.gitignore: add another example binary
Tim-Philipp Müller [Tue, 10 Jul 2018 22:56:23 +0000 (23:56 +0100)]
.gitignore: add another example binary

5 years agomeson: add new test-appsrc2 example to meson build
Tim-Philipp Müller [Tue, 10 Jul 2018 22:55:20 +0000 (23:55 +0100)]
meson: add new test-appsrc2 example to meson build

5 years agoexamples: fix build of new test-appsrc2 example
Tim-Philipp Müller [Tue, 10 Jul 2018 22:53:41 +0000 (23:53 +0100)]
examples: fix build of new test-appsrc2 example

Need to link against libgstapp-1.0.

5 years agoexamples: Add test-appsrc2
Jan Schmidt [Tue, 10 Jul 2018 15:25:51 +0000 (01:25 +1000)]
examples: Add test-appsrc2

Add an example of feeding both audio and video into an RTSP
pipeline via appsrc.

5 years agoclient: Strip transport parts as whitespaces could be around commas
Louis-Francis Ratté-Boulianne [Fri, 8 Jan 2016 23:12:14 +0000 (18:12 -0500)]
client: Strip transport parts as whitespaces could be around commas

https://bugzilla.gnome.org/show_bug.cgi?id=758428

5 years agortsp-stream: avoid pushing data on unlinked udpsrc pad during setup
Göran Jönsson [Wed, 27 Jun 2018 06:30:42 +0000 (08:30 +0200)]
rtsp-stream: avoid pushing data on unlinked udpsrc pad during setup

Fix race when setting up source elements.

Since we set the source element(s) to PLAYING state before hooking
them up to the downstream funnel, it's possible for the source element
to receive packets before we actually get to linking it to the funnel,
in which case buffers would be pushed out on an unlinked pad, causing
it to error out and stop receiving more data.

We fix this by blocking the source's srcpad until we have linked it.

https://bugzilla.gnome.org/show_bug.cgi?id=796160

5 years agortsp-stream: Fix mismatch between allowed and configured protocols
Ognyan Tonchev [Wed, 21 Mar 2018 09:56:51 +0000 (10:56 +0100)]
rtsp-stream: Fix mismatch between allowed and configured protocols

https://bugzilla.gnome.org/show_bug.cgi?id=796679

5 years agortsp-stream: Emit a signal when the SRTP decoder is created
Ulf Olsson [Wed, 1 Feb 2017 08:44:50 +0000 (09:44 +0100)]
rtsp-stream: Emit a signal when the SRTP decoder is created

https://bugzilla.gnome.org/show_bug.cgi?id=778080

5 years agortsp-stream: Don't require presence of sinks in _get_*_socket()
Patricia Muscalu [Tue, 13 Mar 2018 10:10:35 +0000 (11:10 +0100)]
rtsp-stream: Don't require presence of sinks in _get_*_socket()

Transport specific sink elements are added to the pipeline
in PLAY request and sockets are already created in SETUP so
it's actually wrong to require the presence of sinks in
_get_*_socket() functions.

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agortsp-stream: Update transport for multicast clients as well
Patricia Muscalu [Wed, 14 Feb 2018 09:41:02 +0000 (10:41 +0100)]
rtsp-stream: Update transport for multicast clients as well

If a multicast client requests different transport settings
than the existing one make sure that this new transport
configuruation is propagated to the multicast udp sink.

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agortsp-stream: Set the multicast TTL parameter on multicast udp sinks
Patricia Muscalu [Tue, 13 Feb 2018 10:04:36 +0000 (11:04 +0100)]
rtsp-stream: Set the multicast TTL parameter on multicast udp sinks

And not on unicast udp sinks

https://bugzilla.gnome.org/show_bug.cgi?id=793441

5 years agoUpdate for g_type_class_add_private() deprecation in recent GLib
Tim-Philipp Müller [Sun, 24 Jun 2018 10:44:26 +0000 (12:44 +0200)]
Update for g_type_class_add_private() deprecation in recent GLib

5 years agoFix indentation
Tim-Philipp Müller [Sun, 24 Jun 2018 10:45:49 +0000 (12:45 +0200)]
Fix indentation

5 years agoexamples: Add test-video-disconnect example
Jan Schmidt [Fri, 22 Jun 2018 13:17:08 +0000 (23:17 +1000)]
examples: Add test-video-disconnect example

Simple example which cuts off all clients 10 seconds
after the first one connects.

5 years agortsp-auth: Add support for parsing .htdigest files
Mathieu Duponchelle [Wed, 20 Jun 2018 02:37:11 +0000 (04:37 +0200)]
rtsp-auth: Add support for parsing .htdigest files

Passwords are usually not stored in clear text, but instead
stored already hashed in a .htdigest file.

Add support for parsing such files, add API to allow setting
a custom realm in RTSPAuth, and update the digest example.

https://bugzilla.gnome.org/show_bug.cgi?id=796637

5 years agortspclientsink: fix waiting for multiple streams
Matthew Waters [Tue, 19 Jun 2018 04:53:02 +0000 (14:53 +1000)]
rtspclientsink: fix waiting for multiple streams

We were previously only ever waiting for a single stream to notify it's
blocked status through GstRTSPStreamBlocking.  Actually count streams to
wait for.

Fixes rtspclientsink sending SDP's without out some of the input
streams.

https://bugzilla.gnome.org/show_bug.cgi?id=796624

5 years agodocs: add missing auth methods
Mathieu Duponchelle [Wed, 20 Jun 2018 02:30:04 +0000 (04:30 +0200)]
docs: add missing auth methods

5 years agortsp-stream: only create funnel if it didn't exist already.
Mathieu Duponchelle [Tue, 19 Jun 2018 22:10:18 +0000 (00:10 +0200)]
rtsp-stream: only create funnel if it didn't exist already.

This precented using multiple protocols for the same stream.

https://bugzilla.gnome.org/show_bug.cgi?id=796634

5 years agomeson: build auth-digest example
Mathieu Duponchelle [Tue, 19 Jun 2018 23:35:47 +0000 (01:35 +0200)]
meson: build auth-digest example

5 years agoGet payloader stats only for the sending streams
Patricia Muscalu [Tue, 5 Jun 2018 06:44:44 +0000 (08:44 +0200)]
Get payloader stats only for the sending streams

Get/set payloader properties only for streams that actually
contain a payloader element.

https://bugzilla.gnome.org/show_bug.cgi?id=796523

6 years agoMakefile: Don't hardcode libtool for g-i build
Edward Hervey [Fri, 18 May 2018 12:53:49 +0000 (14:53 +0200)]
Makefile: Don't hardcode libtool for g-i build

Similar to the other commits in core/base/bad

6 years agortsp-onvif-media-factory: export gst_rtsp_onvif_media_factory_requires_backchannel
Johan Bjäreholt [Tue, 8 May 2018 12:13:31 +0000 (14:13 +0200)]
rtsp-onvif-media-factory: export gst_rtsp_onvif_media_factory_requires_backchannel

https://bugzilla.gnome.org/show_bug.cgi?id=796229

6 years agortspclientsink: Don't deadlock in preroll on early close
Jan Schmidt [Tue, 8 May 2018 18:09:02 +0000 (04:09 +1000)]
rtspclientsink: Don't deadlock in preroll on early close

If the connection is closed very early, the flushing
marker might not get set and rtspclientsink can get
deadlocked waiting for preroll forever.

https://bugzilla.gnome.org/show_bug.cgi?id=786961

6 years agomeson: Update option names to omit disable_ and with- prefixes
Nirbheek Chauhan [Sat, 5 May 2018 14:21:52 +0000 (19:51 +0530)]
meson: Update option names to omit disable_ and with- prefixes

Also yield common options to the outer project (gst-build in our case)
so that they don't have to be set manually.

6 years agomeson: use -Wl,-Bsymbolic-functions where supported
Tim-Philipp Müller [Wed, 25 Apr 2018 10:00:32 +0000 (11:00 +0100)]
meson: use -Wl,-Bsymbolic-functions where supported

Just like the autotools build.

6 years agoconfigure: check for -good and -bad plugins only in uninstalled setup
Tim-Philipp Müller [Sun, 22 Apr 2018 19:09:01 +0000 (20:09 +0100)]
configure: check for -good and -bad plugins only in uninstalled setup

Avoids confusing configure messages looking or a -good .pc file
that doesn't exist.

Also use plugindir variables that common macros set while at it.

https://bugzilla.gnome.org/show_bug.cgi?id=795466

6 years agortsp-client: Fix session timeout
Joakim Johansson [Tue, 17 Apr 2018 09:03:11 +0000 (11:03 +0200)]
rtsp-client: Fix session timeout

When streaming data over TCP then is not the keep-alive
functionality working.

The reason is that the function do_send_data have changed
to boolean but the code is still checking the received result
from send_func with GST_RTSP_OK.

The result is that a successful send_func will always lead to
that do_send_data is returning false and the keep-alive will
not be updated.

https://bugzilla.gnome.org/show_bug.cgi?id=795321

6 years agoImplement support for ULP Forward Error Correction
Mathieu Duponchelle [Mon, 2 Apr 2018 20:49:35 +0000 (22:49 +0200)]
Implement support for ULP Forward Error Correction

In this initial commit, interface is only exposed for RECORD,
further work will be needed in rtspsrc to support this for
PLAY.

https://bugzilla.gnome.org/show_bug.cgi?id=794911

6 years agoRevert "rtsp-server: Switch around sendonly/recvonly attributes"
Sebastian Dröge [Tue, 17 Apr 2018 14:47:30 +0000 (17:47 +0300)]
Revert "rtsp-server: Switch around sendonly/recvonly attributes"

This reverts commit 3d275b1345b76151418e3f56ed014d9089ac1a57.

While RFC 3264 (SDP) says that sendonly/recvonly are from the point of view of
the requester, the actual RTSP RFCs (RFC 2326 / 7826) disagree and say
the opposite, just like the ONVIF standard.

Let's follow those RFCs as we're doing RTSP here, and add a property at
a later time if needed to switch to the SDP RFC behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=793964

6 years agoAutomatic update of common submodule
Tim-Philipp Müller [Mon, 16 Apr 2018 09:53:52 +0000 (10:53 +0100)]
Automatic update of common submodule

From 3fa2c9e to ed78bee