Commit graph

1653 commits

Author SHA1 Message Date
Matthew Waters
b2d5e4db52 meson: Don't generate doc cache when no plugins are enabled
Fixes gst-build with -Dauto-features=disabled -Drtsp_server=enabled
2019-08-23 16:59:48 +10:00
Xavier Claessens
c2deb7f64b test-onvif-client: stdin is not defined in MSVC 2019-08-16 13:38:01 -04:00
Mathieu Duponchelle
7073ade1a6 rtsp-media: add missing Since tag 2019-08-12 16:09:02 +00:00
Mathieu Duponchelle
859e59b944 test-onvif-client: STDIN_FILENO is not portable
If not defined, define it to _fileno(stdin) on Windows, 0
everywhere else
2019-08-08 15:52:53 +02:00
Mathieu Duponchelle
df1f9f38ce test-onvif-server: downgrade logging 2019-08-07 21:04:33 +02:00
Mathieu Duponchelle
0bdae677d3 examples: add ONVIF client / server example 2019-08-07 18:04:03 +02:00
Mathieu Duponchelle
72504eee99 rtsp-client: define all seek accuracy flags from setup_play_mode
We then pass those to adjust_play_mode, which needs to operate
on the "final" seek flags, as previously the code in rtsp-media
was assuming that accuracy seek flags (accurate / key_unit) should
not be set if the flags passed to the seek method were already set.
2019-08-07 18:04:03 +02:00
Sebastian Dröge
446315b36c rtsp-media: Try to get dynamic payloaders by name from their bin first
First try "pay", then "pay_%s" (where %s == pad name). And only then
fall back to the code that simply takes the first payloader that is
found.

The current code usually works (but is racy) because it will always take
the payloader that was last added (due to g_list_prepend() when adding
elements) in pad-added and that's usually the correct one. But if a new
payloader is added between pad-added and us trying to get it, we would
get the wrong payloader.
2019-07-22 19:44:28 +03:00
Mathieu Duponchelle
507e6f1db2 client test: expect any port in transport
setup_multicast_client sets a 5000-5010 range for the client
ports, it is incorrect to expect the transport to always use
5000-5001

Fixes #73
2019-07-20 16:16:22 +00:00
Mathieu Duponchelle
571f119fea onvif tests: use g_cond_wait() correctly
g_cond_wait() has to be called in a loop until required conditions
are met

Fixes #71
2019-07-17 15:39:45 +02:00
Göran Jönsson
d1d404912e rtsp-stream: Not wait on receiver streams when pre-rolling
Without this patch there are problem pre-rolling when using audio back
channel.

Without this patch a probe will be created for all streams including
the stream for audio backchannel. To pre-roll all this pads have to
receive data. Since the stream for audio backchannel is a receiver this
will never happen.

The solution is to never create any probes for streams that are for
incomming data and instead set them as blocking already from beginning.
2019-06-28 13:31:34 +02:00
Tim-Philipp Müller
7b2adb015d onvif-media: fix "void function returning a value" compiler warning 2019-06-25 13:19:44 +01:00
Mathieu Duponchelle
ab37286300 rtsp-media: make sure streams are blocked when sending seek
The recent ONVIF work exposed a race condition when dealing with
multiple streams: one of the sinks may preroll before other streams
have started flushing. This led to the pipeline posting async-done
prematurely, when some streams were actually still in the middle
of performing a flushing seek. The newly-added code looks up a
sticky segment event on the first stream in order to respond to
the PLAY request with accurate Scale and Speed headers. In the
failure condition, the first stream was flushing, and thus had
no sticky segment event, leading to the PLAY request failing,
and in turn the test.
2019-06-12 22:19:27 +02:00
Michael Bunk
b545c10e8f Fix typos 2019-06-07 13:42:24 +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
Mathieu Duponchelle
7640cb8f21 rtsp-client: add gst_rtsp_client_get_stream_transport()
This will be used in the onvif tests in order to validate the
data transmitted over TCP: for streaming to continue after a
data message has been provided to client->send_func, the client
is responsible for marking the message as sent on the relevant
stream transport.
2019-06-06 18:45:17 +02:00
Mathieu Duponchelle
52d20df0f4 client: Scale implies TRICK_MODE 2019-06-04 14:32:51 +02:00
Mathieu Duponchelle
b9cc3e867a client: compare booleans, not pointers to them 2019-06-04 14:32:51 +02:00
Nikita Bobkov
f31f79f60e Reverse playback support
GStreamer plays segment from stop to start when doing reverse playback.
RTSP implies that media should be played from start of Range header to
its stop. Hence we swap start and stop times before passing them to
gst_element_seek.

Also make gst_rtsp_stream_query_stop always return value that can be
used as stop time of Range header.
2019-06-04 14:32:51 +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
65d9aa327c rtsp-client: allow sub classes to adjust the seek
Adds a new virtual function, adjust_play_mode(), that allows
sub classes to adjust the seek done on the media. The sub class can
modify the values of the the seek flags and the rate.

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
Niels De Graef
e788fc4e88 meson: Bump minimal GLib version to 2.44
This means we can use some newer features and get rid of some
boilerplate code using the G_DECLARE_* macros.

As discussed on IRC, 2.44 is old enough by now to start depending on it.
2019-06-02 21:39:33 +02:00
Mathieu Duponchelle
768975f71b docs: remove obsolete gtk-doc related files 2019-05-31 18:53:36 +02:00
Mathieu Duponchelle
da22533780 doc: remove xml from comments 2019-05-29 23:20:09 +02:00
Thibault Saunier
ef88a27317 docs: Stop building the doc cache by default
And update the cache

Fixes https://gitlab.freedesktop.org/gstreamer/gst-docs/issues/36
2019-05-16 09:36:06 -04:00
Thibault Saunier
89cc9e9201 docs: Update plugins documentation cache 2019-05-13 22:59:57 -04:00
Thibault Saunier
f4b20b010d doc: Fix some docstrings 2019-05-13 17:00:00 -04:00
Thibault Saunier
5b039416db docs: Port to hotdoc 2019-05-13 11:38:39 -04:00
Sebastian Dröge
abf6be1d7a rtsp-server: Fix various Since markers 2019-04-23 15:09:34 +03:00
Sebastian Dröge
8d3bef4c1e rtsp-server: Add various Since: 1.14 markers 2019-04-23 15:01:32 +03:00
Sebastian Dröge
802a648723 rtsp-server: Add various missing Since: 1.16 markers 2019-04-23 14:56:42 +03:00
Sebastian Dröge
640c5bba41 rtspclientsink: Set async-handling=false for the internal bins
Without this we can easily run into a race condition with async state changes:
- the pipeline is doing an async state change
- we set the internal bins to PLAYING but that's ignored because an
  async state change is currently pending
- the async state change finishes but does not change the state of the
  internal bins because of locked_state==TRUE
- the internal bins stay in PAUSED forever
2019-04-22 10:38:08 +00:00
Sebastian Dröge
c4653ef38b rtspclientsink: Use write_messages() API to send buffer lists in one go
And to write messages with multiple memories also via writev().
2019-04-22 10:38:08 +00:00
Kristofer Bjorkstrom
b578628dc1 rtsp-client: Handle Content-Length limitation
Add functionality to limit the Content-Length.
API addition, Enhancement.

Define an appropriate request size limit and reject requests
exceeding the limit with response status 413 Request Entity Too Large

Related to !182
2019-04-22 09:17:13 +00:00
Tim-Philipp Müller
f586450b99 Back to development 2019-04-19 11:00:07 +01:00
Tim-Philipp Müller
70e0d0b27e Release 1.16.0 2019-04-19 00:34:55 +01:00
Sebastian Dröge
0f0a10525a rtspclientsink: Notify the stream transport about each written message
Otherwise it will never try to send us the next one: it tries to keep
exactly one message in-flight all the time.

In gst-rtsp-server this is done asynchronously via the GstRTSPWatch but
in the client sink we always write data out synchronously.
2019-04-15 17:34:56 +00:00
Göran Jönsson
3cfe88632f rtsp_server: Free thread pool before clean transport cache
If not waiting for free thread pool before clean transport caches, there
can be a crash if a thread is executing in transport list loop in
function send_tcp_message.

Also add a check if priv->send_pool in on_message_sent to avoid that a
new thread is pushed during wait of free thread pool. This is possible
since when waiting for free thread pool mutex have to be unlocked.
2019-04-11 08:02:52 +02:00
Tim-Philipp Müller
cd46712162 Release 1.15.90 2019-04-11 00:35:56 +01:00
Ulf Olsson
d09b7c8e4f rtsp-stream: Add support for GCM (RFC 7714)
Follow-up to !198
2019-04-10 08:43:29 +00:00
Erlend Eriksen
a9d3bcc03e session pool: fix missing klass-> in klass->create_session 2019-03-28 00:27:37 +01:00
Tim-Philipp Müller
0becf0b67d g-i: pass --quiet to g-ir-scanner
This suppresses the annoying 'g-ir-scanner: link: cc ..' output
that we get even if everything works just fine.

We still get g-ir-scanner warnings and compiler warnings if
we pass this option.
2019-03-23 19:16:17 +00:00
Tim-Philipp Müller
6f43461592 g-i: silence 'nested extern' compiler warnings when building scanner binary
We need a nested extern in our init section for the scanner binary
so we can call gst_init to make sure GStreamer types are initialised
(they are not all lazy init via get_type functions, but some are in
exported variables). There doesn't seem to be any other mechanism to
achieve this, so just remove that warning, it's not important at all.
2019-03-23 19:15:48 +00:00
Tim-Philipp Müller
48d7d5846f meson: pass -Wno-unused to compiler if gstreamer debug system is disabled 2019-03-21 11:49:10 +00:00
Göran Jönsson
1fd49d36d1 rtsp-media: Handle set state when preparing.
Handle the situation when  a call to gst_rtsp_media_set_state is done
when media status is preparing.

Also add unit test for this scenario.

The unit test simulate on a media level when two clients share a (live)
media.
Both clients have done SETUP and got responses. Now client 1 is doing
play and client 2 is just closing the connection.

Then without patch there are a problem when
client1 is calling gst_rtsp_media_unsuspend in handle_play_request.
And client2 is doing closing connection we can end up in a call
to gst_rtsp_media_set_state when
priv->status == GST_RTSP_MEDIA_STATUS_PREPARING and all the logic for
shut down media is jumped over .

With this patch and this scenario we wait until
priv->status == GST_RTSP_MEDIA_STATUS_PREPARED and then continue to
execute after that and now we will execute the logic for
shut down media.
2019-03-20 12:26:50 +01:00
Tim-Philipp Müller
f0a9861186 Back to development 2019-03-04 09:13:30 +00:00
Tim-Philipp Müller
14d0b77df6 Release 1.15.2 2019-02-26 11:58:53 +00:00
Göran Jönsson
7e01dfd151 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
2019-02-19 12:12:34 +01:00
Göran Jönsson
afb27f91cf rtsp-server: remove recursive behavior
Introduce a threadpool to send rtp and rtcp to avoid recursive behavior.
2019-02-02 10:42:33 +00:00