Commit graph

1051 commits

Author SHA1 Message Date
Patricia Muscalu 499e437e50 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
2018-08-14 14:10:41 +03:00
Patricia Muscalu a9db3e7f09 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
2018-08-14 14:10:23 +03:00
Patricia Muscalu 7f0ae77e40 Add new API for setting/getting maximum multicast ttl value
https://bugzilla.gnome.org/show_bug.cgi?id=793441
2018-08-14 14:10:20 +03:00
Mathieu Duponchelle 3357094440 rtsp-stream: avoid duplicating the first multicast client
In dcb4533fed , 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
2018-08-14 14:10:02 +03:00
Thibault Saunier 20dc49749c rtsp-server: Add gstreamer-base gir dir in autotools 2018-08-06 15:33:04 -04:00
Mathieu Duponchelle 12f8abb549 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
2018-08-01 20:42:34 +02:00
Sebastian Dröge 37e75cb8ea rtsp-stream: Slightly simplify locking 2018-07-23 18:03:51 +03:00
David Svensson Fors 12169f1e84 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
2018-07-23 17:45:00 +03:00
David Svensson Fors 287345f6ac 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.
2018-07-23 17:44:15 +03:00
Carlos Rafael Giani 12c2dd6e1c rtsp-media: unref clock (if set) when finalizing
https://bugzilla.gnome.org/show_bug.cgi?id=796814
2018-07-16 23:56:09 +01:00
Tim-Philipp Müller 7f7a210b84 media-factory: unref old clock when setting new clock
https://bugzilla.gnome.org/show_bug.cgi?id=796724
2018-07-12 19:02:40 +01:00
Brendan Shanks f304096994 media-factory: unref clock in finalize
https://bugzilla.gnome.org/show_bug.cgi?id=796724
2018-07-12 19:02:40 +01:00
Tim-Philipp Müller 1cd6c0340e rtsp-onvif-media: fix g-ir-scanner warnings 2018-07-12 19:02:40 +01:00
Louis-Francis Ratté-Boulianne 604240f7eb client: Strip transport parts as whitespaces could be around commas
https://bugzilla.gnome.org/show_bug.cgi?id=758428
2018-07-06 16:13:33 -04:00
Göran Jönsson c1fab570d8 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
2018-06-27 12:25:45 +02:00
Ognyan Tonchev f110016ac6 rtsp-stream: Fix mismatch between allowed and configured protocols
https://bugzilla.gnome.org/show_bug.cgi?id=796679
2018-06-26 15:41:07 +02:00
Ulf Olsson 4d25e04bd7 rtsp-stream: Emit a signal when the SRTP decoder is created
https://bugzilla.gnome.org/show_bug.cgi?id=778080
2018-06-26 15:38:33 +02:00
Patricia Muscalu 4007050335 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
2018-06-26 14:01:02 +02:00
Patricia Muscalu dcb4533fed 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
2018-06-26 11:08:45 +02:00
Patricia Muscalu 1a38de2b17 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
2018-06-26 10:59:25 +02:00
Tim-Philipp Müller 2eb4d1b810 Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 12:48:11 +02:00
Tim-Philipp Müller e82ba1e52f Fix indentation 2018-06-24 12:45:49 +02:00
Mathieu Duponchelle 5ede2a5c5c 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
2018-06-21 15:47:39 +02:00
Matthew Waters b5a61f488d 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
2018-06-21 20:56:46 +10:00
Mathieu Duponchelle 3b70c68e6e 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
2018-06-20 01:36:57 +02:00
Patricia Muscalu 768fb5695c 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
2018-06-13 10:13:12 +03:00
Edward Hervey 89e6ee73b1 Makefile: Don't hardcode libtool for g-i build
Similar to the other commits in core/base/bad
2018-05-18 14:54:46 +02:00
Johan Bjäreholt 913eae2e7e rtsp-onvif-media-factory: export gst_rtsp_onvif_media_factory_requires_backchannel
https://bugzilla.gnome.org/show_bug.cgi?id=796229
2018-05-18 08:57:28 +01:00
Jan Schmidt b3a4df7ab8 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
2018-05-09 04:09:02 +10:00
Joakim Johansson 808b49cbfc 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
2018-04-20 10:13:53 +03:00
Mathieu Duponchelle bfc35ae1ae 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
2018-04-19 18:25:31 +02:00
Sebastian Dröge 9f5d3ee7a8 Revert "rtsp-server: Switch around sendonly/recvonly attributes"
This reverts commit 3d275b1345.

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
2018-04-17 17:50:05 +03:00
Sebastian Dröge ef878da703 gst: Run everything through gst-indent again 2018-04-04 10:06:06 +03:00
Branko Subasic 48ad01beba rtsp-media: query the position on active streams if media is complete
If the media is complete, i.e. one or more streams have been configured
with sinks, then we want to query the position on those streams only.
A query on an incomplete stream may return a position that originates from
an earlier preroll.

https://bugzilla.gnome.org/show_bug.cgi?id=794964
2018-04-04 10:05:38 +03:00
Tim-Philipp Müller e3bbd40f0e rtspclientsink: make sure not to use freed string
Set transport string to NULL after freeing it, so that
at worst we get a NULL pointer if constructing a new
transport string fails (which shouldn't really fail here).
Also check return value of that, just in case.

CID 1433768.
2018-04-02 12:35:04 +01:00
Mathieu Duponchelle c36d6b477c rtsp-client: do not free string passed to take_header 2018-03-30 23:34:01 +02:00
Mathieu Duponchelle 8bf341ad02 rtsp-stream: do not take lock in request_aux_receiver
Added it right before pushing the previous commit, it is
incorrect and deadlocks because this function gets called
from the join_bin thread, which already holds the lock,
that's the reason why request_aux_sender didn't take the
lock either.
2018-03-30 23:10:10 +02:00
Mathieu Duponchelle 988db52016 rtsp-server: add API to enable retransmission requests
"do-retransmission" was previously set when rtx-time != 0,
which made no sense as do-retransmission is used to enable
the sending of retransmission requests, where as rtx-time
is used by the peer to enable storing of buffers in order
to respond to retransmission requests.

rtsp-media now also provides a callback for the
request-aux-receiver signal.

https://bugzilla.gnome.org/show_bug.cgi?id=794822
2018-03-30 17:55:32 +02:00
Mathieu Duponchelle 7894328029 rtspclientsink: add rtx ssrc to mikey's crypto sessions
https://bugzilla.gnome.org/show_bug.cgi?id=794813
2018-03-30 17:55:32 +02:00
Mathieu Duponchelle c683cadcdf rtspclientsink: Handle the KeyMgmt header in ANNOUNCE response
This in order to be able to decrypt the RTCP backchannel

https://bugzilla.gnome.org/show_bug.cgi?id=794813
2018-03-30 17:55:32 +02:00
Mathieu Duponchelle ae0e08dac2 rtsp-client: Send KeyMgmt header in ANNOUNCE response
When sending back an encrypted RTCP back channel, it is useful
for the client to know the encryption key.

https://bugzilla.gnome.org/show_bug.cgi?id=794813
2018-03-30 17:55:32 +02:00
Mathieu Duponchelle a093f4442b rtsp-stream: extract handle_keymgmt from rtsp-client
rtspclientsink will also need to parse KeyMgmt headers
sent by the server to decrypt the RTCP backchannel stream

https://bugzilla.gnome.org/show_bug.cgi?id=794813
2018-03-30 17:55:32 +02:00
Mathieu Duponchelle 7f9b8c2107 rtspclientsink: Fix client ports for the RTCP backchannel
This was broken since the work for delayed transport creation
was merged: the creation of the transports string depends on
calling stream_get_server_port, which only starts returning
something meaningful after a call to stream_allocate_udp_sockets
has been made, this function expects a transport that we parse
from the transport string ...

Significant refactoring is in order, but does not look entirely
trivial, for now we put a band aid on and create a second transport
string after the stream has been completed, to pass it in
the request headers instead of the previous, incomplete one.

https://bugzilla.gnome.org/show_bug.cgi?id=794789
2018-03-30 17:55:32 +02:00
Göran Jönsson 3a129300f0 rtsp-client:Error handling when equal http session cookie
There are some clients that are sending same session cookie on random
basis.

https://bugzilla.gnome.org/show_bug.cgi?id=753616
2018-03-21 17:39:02 -04:00
Sebastian Dröge 3d21e8d4c8 rtsp-media-factory-uri: Fix compilation with latest GLib
rtsp-media-factory-uri.c: In function ‘rtsp_media_factory_uri_create_element’:
rtsp-media-factory-uri.c:621:17: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
   data->factory = g_object_ref (factory);
                 ^
2018-03-20 16:21:37 +02:00
Tim-Philipp Müller 2df75442d0 rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 13:37:13 +00:00
Sebastian Dröge e5527e4403 rtsp-onvif-media-factory: Document that backchannel pipelines must end with async=false sinks
https://bugzilla.gnome.org/show_bug.cgi?id=794143
2018-03-07 12:20:05 +02:00
Mathieu Duponchelle 1288faeae7 permissions: add Since tags and example for new API 2018-03-02 16:24:23 +01:00
Mathieu Duponchelle e356cf33f2 permissions: more bindings-friendly API
https://bugzilla.gnome.org/show_bug.cgi?id=793975
2018-03-02 16:21:37 +01:00
Sebastian Dröge 0dc6170582 rtsp-client: Place netaddress meta on packets received via TCP
This allows us to later map signals from rtpbin/rtpsource back to the
corresponding stream transport, and allows to do keep-alive based on
RTCP packets in case of TCP media transport.

https://bugzilla.gnome.org/show_bug.cgi?id=789646
2018-02-28 21:12:43 +02:00