Commit graph

113 commits

Author SHA1 Message Date
Kristofer
1a01d20e40 rtsp-client: Lock shared media
For shared media we got race conditions. Concurrently rtsp clients might
suspend or unsuspend the shared media and thus change the state without
the clients expecting that.
By introducing a lock that can be taken by callers such as rtsp_client
one can force rtsp clients calling, eg. PLAY, SETUP and that uses shared media,
to handle the media sequentially thus allowing one client to finish its
rtsp call before another client calls on the same media.

https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/86
Fixes #86
2019-10-16 13:20:54 +00:00
Göran Jönsson
16bc937ed9 Use complete streams for scale and speed.
Without this patch it's always stream0 that is used to get segment event
that is used to set scale and speed. This even if client not doing SETUP
for stream0. At least in suspend mode reset this not working since then
it's just random if send_rtp_sink have got any segment event. There are
no check if send_rtp_sink for stream0 got any data before media is
prerolled after PLAY request.
2019-08-29 07:15:37 +02:00
Mathieu Duponchelle
0f498eabf4 onvif: Implement and test the Streaming Specification
https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf
2019-06-06 18:45:17 +02:00
Branko Subasic
bc74589601 rtsp-client: add support for Scale and Speed header
Add support for the RTSP Scale and Speed headers by setting the rate in
the seek to (scale*speed). We then check the resulting segment for rate
and applied rate, and use them as values for the Speed and Scale headers
respectively.

https://bugzilla.gnome.org/show_bug.cgi?id=754575
2019-06-04 14:32:51 +02:00
Branko Subasic
421ac85150 rtsp-media: allow specifying rate when seeking
Add new function gst_rtsp_media_seek_full_with_rate() which allows the
caller to specify the rate for the seek. Also added functions in
rtsp-stream and rtsp-media for retreiving current rate and applied rate.

https://bugzilla.gnome.org/show_bug.cgi?id=754575
2019-06-04 14:32:51 +02:00
Patricia Muscalu
c394de2348 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
2018-09-28 13:27:48 +03:00
Patricia Muscalu
a7bb684e9b Add new API for setting/getting maximum multicast ttl value
Change-Id: I5ef4758188c14785e17fb8fbf42a3dc0cb054233

https://bugzilla.gnome.org/show_bug.cgi?id=793441
2018-08-14 14:31:41 +03:00
Sebastian Dröge
443c2b73e5 Revert "Add new API for setting/getting maximum multicast ttl value"
This reverts commit 7f0ae77e40.

Commits where accidentially squashed together
2018-08-14 14:25:42 +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
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
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
72dc8acd86 rtsp: Add support for ONVIF backchannel
This adds a new RTSP server, client, media-factory and media subclass
for handling the specifics of the backchannel. Ideally this later can be
extended with other ONVIF specific features.
2018-02-16 11:04:53 +02:00
Tim-Philipp Müller
58aa58f049 rtsp-server: add missing GST_EXPORT and export deprecated funcs 2017-11-26 13:03:39 +00:00
Patricia Muscalu
a7732a68e8 Dynamically reconfigure pipeline in PLAY based on transports
The initial pipeline does not contain specific transport
elements. The receiver and the sender parts are added
after PLAY.
If the media is shared, the streams are dynamically
reconfigured after each PLAY.

https://bugzilla.gnome.org/show_bug.cgi?id=788340
2017-11-15 19:56:15 +02:00
Thibault Saunier
9706199efb Start support for RTSP 2.0
This adds basic support for new 2.0 features, though the protocol is
subposdely backward incompatible, most semantics are the sames.

This commit adds:

- features:
 * version negotiation
 * pipelined requests support
 * Media-Properties support
 * Accept-Ranges support

- APIs:
  * gst_rtsp_media_seekable

The RTSP methods that have been removed when using 2.0 now return
BAD_REQUEST.

https://bugzilla.gnome.org/show_bug.cgi?id=781446
2017-10-05 13:23:48 -03:00
Tim-Philipp Müller
b344248630 Mark symbols explicitly for export with GST_EXPORT 2017-05-18 10:35:18 +01:00
Sebastian Dröge
9fab555cc5 rtsp-server: Implement clock signalling according to RFC7273
For NTP and PTP clocks we signal the actual clock that is used and signal
the direct media clock offset.

For all other clocks we at least signal that it's the local sender clock.

This allows receivers to know which clock was used to generate the media and
its RTP timestamps. Receivers can then implement network synchronization,
either absolute or at least relative by getting the sender clock rate directly
via NTP/PTP instead of estimating it from RTP timestamps and packet receive
times.

https://bugzilla.gnome.org/show_bug.cgi?id=760005
2016-04-03 11:22:31 +03:00
Sebastian Dröge
69d04f3838 rtsp-media: Add support for setting the multicast interface
https://bugzilla.gnome.org/show_bug.cgi?id=763000
2016-03-25 12:52:12 +02:00
Sebastian Dröge
7a41d396ae rtsp-media: Add API to directly configure a clock on the media pipelines 2015-12-30 18:40:43 +02:00
Sebastian Dröge
c8f179948e rtsp-media: Add property to decide if sending media should be stopped when a client disconnects without TEARDOWN
Without TEARDOWN it might be desireable to keep the media running and continue
sending data to the client, even if the RTSP connection itself is
disconnected.

Only do this for session medias that have only UDP transports. If there's at
least on TCP transport, it will stop working and cause problems when the
connection is disconnected.

https://bugzilla.gnome.org/show_bug.cgi?id=758999
2015-12-28 10:51:56 +02:00
Xavier Claessens
0ea68a1b0f rtsp-server: Add g_autoptr() support to all types
https://bugzilla.gnome.org/show_bug.cgi?id=754464
2015-12-14 13:52:17 -05:00
Jan Schmidt
9bfcdba42b rtsp-media: Fix small typo causing gtk-doc to complain 2015-09-03 22:16:30 +10:00
Sebastian Dröge
8700468499 rtsp-server: Use single-include rtsp header to make sure we get all definitions 2015-05-20 17:05:47 +03:00
Sebastian Dröge
a93ed7e5d4 rtsp-media: Use flags to distinguish between PLAY and RECORD media 2015-02-06 09:42:50 +01:00
Sebastian Dröge
35b2b10cf4 rtsp-media: Expose latency setting for setting the rtpbin latency 2015-02-06 09:42:50 +01:00
Sebastian Dröge
ccf6c6eb53 Add initial support for RECORD
We currently only support media that is RECORD or PLAY only, not both at once.

https://bugzilla.gnome.org/show_bug.cgi?id=743175
2015-02-06 09:42:42 +01:00
Matthew Waters
4f40781fff media: implement ssrc-multiplexed retransmission support
based off RFC 4588 and the server-rtpaux example in -good
2014-12-16 16:41:08 +01:00
Hyunjun Ko
a8e604355c media: correct misspelled words in description
https://bugzilla.gnome.org/show_bug.cgi?id=733244
2014-07-16 12:50:48 +01:00
Ognyan Tonchev
0fb7922e9b media: Make suspend()/unsuspend() virtual
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730109
2014-05-15 15:42:18 +02:00
Ognyan Tonchev
80474e9e5e media: make media_prepare virtual
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728029
2014-04-12 06:04:13 +02:00
Ognyan Tonchev
5eca958d5e media: add signal to notify of pending state changes 2014-01-21 14:25:42 +01:00
Wim Taymans
ae1fe21436 stream: add property to configure profiles 2014-01-07 12:39:58 +01:00
Aleix Conchillo Flaqué
3fdae13fb7 media: add setup_sdp vmethod
gst/rtsp-server/rtsp-media.[ch]: added setup_sdp vmethod and public
gst_rtsp_media_setup_sdp.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720155
2013-12-19 15:10:30 +01:00
Tim-Philipp Müller
91fac8eb29 rtsp-server: add padding to many public structures
Not mini objects though, since they are not subclassable
anyway, nor kept on the stack or inlined in a structure.
2013-12-12 00:36:07 +00:00
Aleix Conchillo Flaqué
ab3651d339 media: add new create_rtpbin vmethod
* gst/rtsp-server/rtsp-media.[ch]: add new create_rtpbin vmethod.

  https://bugzilla.gnome.org/show_bug.cgi?id=719734
2013-12-09 17:14:26 +01:00
Wim Taymans
2f17369e9d media: add suspend modes
Add support for different suspend modes. The stream is suspended right after
producing the SDP and after PAUSE. Different suspend modes are available that
affect the state of the pipeline. NONE leaves the pipeline state unchanged and
is the current and old behaviour, PAUSE will set the pipeline to the PAUSED
state and RESET will bring the pipeline to the NULL state.
A stream is also unsuspended when it goes back to PLAYING, for RESET streams,
this means that the pipeline needs to be prerolled again.

Base on patches by Ognyan Tonchev <ognyan@axis.com>

See https://bugzilla.gnome.org/show_bug.cgi?id=711257
2013-11-28 16:18:39 +01:00
Youness Alaoui
a95ab4b29e Add vmethod for rtsp-media subclass to access rtpbin 2013-08-02 16:59:04 +02:00
Youness Alaoui
050b16ad84 Add API to rtsp-media set the pipeline's state 2013-08-02 16:53:07 +02:00
Wim Taymans
d357fc55af docs: more updates 2013-07-11 12:24:33 +02:00
Wim Taymans
ccceb1de11 docs: update docs 2013-07-11 12:18:26 +02:00
Wim Taymans
d1e4baab6c media: Accept a thread in _prepare
Remove out own threadpool handling and use the provided thread and
maincontext for the bus messages and the state changes.
2013-07-10 17:08:14 +02:00
Wim Taymans
0499a1ec7d media: make it possible to set permissions
Make it possible to set permissions on media and media factory objects
2013-07-09 14:33:43 +02:00
Wim Taymans
12583e819c media: add optional context for bus messages
Add an optional mainloop to _prepare that will handle the bus messages instead
of always using the shared mainloop.
2013-07-08 11:10:20 +02:00
Wim Taymans
19cffc7999 auth: remove auth from media and factory
Remove the auth object from media and factory. We want to have the RTSPClient
authenticate and authorize resources, there is no need to place another auth
manager on the media/factory.
2013-07-05 20:53:19 +02:00
Wim Taymans
3999bd4e4e media: add method to find a stream by control url 2013-07-03 15:14:39 +02:00
Youness Alaoui
0b94f50eab Add query_position and query_stop vmethods to rtsp-media 2013-06-25 15:23:36 +02:00
Wim Taymans
aab1198516 media: add _get_element() method
Add method to get the element used when creating the media.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703008
2013-06-24 23:56:57 +02:00
David Svensson Fors
6151072a2e media: convert_range replaces get_range_times
get_range_times worked for handling UTC ranges for seeks, but we also
need to convert back from NPT to the requested unit in
get_range_string. convert_range is now used for both.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702084
2013-06-14 16:11:34 +02:00
David Svensson Fors
7efa871c1f media: possibility to override range time conversion
Make it possible to override the conversion from GstRTSPTimeRange to
GstClockTimes, that is done before seeking on the media
pipeline. Overriding can be useful for UTC ranges, where the default
conversion gives nanoseconds since 1900.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701191
2013-06-03 14:29:05 +02:00
Wim Taymans
b80b8824be media: listen to pad-removed signals
Listen to the pad-removed signal and remove the stream associated with the
removed pad.
Add signal to be notified of the removed pad.
Remove the fakesink in unprepare()
Fix signatures of the signal methods
2013-04-22 17:34:37 +02:00