platform/upstream/gstreamer.git
4 years agortsp-media: Unblock all streams
David Svensson Fors [Mon, 29 Oct 2018 16:02:41 +0000 (17:02 +0100)]
rtsp-media: Unblock all streams

When unsuspending and going to PLAYING, unblock all streams instead of
only those that are linked (the linked streams are the ones for which
SETUP has been called). GST_FLOW_NOT_LINKED will be returned when
pushing buffers on unlinked streams.

This change is because playback using single-threaded demuxers like
matroska-demux could be blocked if SETUP was not called for all media.
Demuxers that use GstFlowCombiner (including gstoggdemux, gstavidemux,
gstflvdemux, qtdemux, and matroska-demux) will handle
GST_FLOW_NOT_LINKED automatically.

Fixes #39

4 years agortsp-media: Wait on async when needed.
Göran Jönsson [Wed, 11 Sep 2019 05:08:37 +0000 (07:08 +0200)]
rtsp-media: Wait on async when needed.

Wait on asyn-done when needed in gst_rtsp_media_seek_trickmode.

In the unit test the pause from adjust_play_mode will cause a preroll
and after that async-done will be produced.
Without this patch there are no one consuming this async-done and when
later when seek fluch is done in gst_rtsp_media_seek_trickmode then it
wait for async-done. But then it wrongly find the async-done prodused by
adjus_play_mode and continue executing without waiting for the preroll
to finish.

4 years agortsp-client: RTP Info when completed_sender
Kristofer Bjorkstrom [Mon, 30 Sep 2019 13:13:15 +0000 (15:13 +0200)]
rtsp-client: RTP Info when completed_sender

Change condition that should be fulfilled regarding RTPInfo.
Replace !gst_rtsp_media_is_receive_only with
gst_rtsp_media_has_completed_sender. It is more correct to actually look
for a sender pipeline that is complete. Only then a RTPInfo should
exist.

gst_rtsp_media_is_receive_only gives different answears depending on
state of server.
If Describe is called wth URL+options for backchannel SDP will give only
audio and only backchannel a=sendonly
If Describe is called on URL+options that gives both audio and video
direction from server to client, pipelines are created. Thus
receive_only will return false, even though Setup only would setup
backchannel.

RTP-Info is only for outgoing streams. Thus one should look if outgoing
streams are complete.

4 years agortsp-client: RTP Info exists conditionally in PLAY
Kristofer [Wed, 25 Sep 2019 09:14:08 +0000 (09:14 +0000)]
rtsp-client: RTP Info exists conditionally in PLAY

If RTP Info is missing and it is not a receiver only, eg. audio
backchannel. Then return GST_RTSP_STS_INTERNAL_SERVER_ERROR.
In rfc2326 it says RTP-info is req. but in RFC7826 it is conditional.

Since 1.14 there is audio backchannel support. Thus RTP-info is
conditional now. When audio backchannel only mode, there is no RTP-info.

Fixes #82

4 years agotest-onvif-client: remove unused query
Mathieu Duponchelle [Thu, 5 Sep 2019 14:23:26 +0000 (16:23 +0200)]
test-onvif-client: remove unused query

4 years agortsp-client: RTP Info must exist in PLAY response
Kristofer Björkström [Fri, 30 Aug 2019 12:00:52 +0000 (14:00 +0200)]
rtsp-client: RTP Info must exist in PLAY response

If RTP Info is missing. Then return GST_RTSP_STS_INTERNAL_SERVER_ERROR

Fixes #76

4 years agotest-onvif-client: perform accurate seeks
Mathieu Duponchelle [Thu, 29 Aug 2019 19:37:24 +0000 (21:37 +0200)]
test-onvif-client: perform accurate seeks

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/336

Also, modify how we compute the position: position queries in
PAUSED mode fail to account for the newly-prerolled frame, leading
to frame skips when performing seeks in that state. Instead,
compute the current position from the last sample.

4 years agoUse complete streams for scale and speed.
Göran Jönsson [Wed, 21 Aug 2019 12:57:25 +0000 (14:57 +0200)]
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.

4 years agoexamples/onvif-server: fix werror build with clang
Matthew Waters [Mon, 26 Aug 2019 12:24:12 +0000 (22:24 +1000)]
examples/onvif-server: fix werror build with clang

../subprojects/gst-rtsp-server/examples/test-onvif-server.c:346:65: warning: implicit conversion from enumeration type 'const GstSegmentFlags' to different enumeration type 'GstSeekFlags' [-Wenum-conversion]
        self->incoming_segment->format, self->incoming_segment->flags,
                                        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
../subprojects/gst-rtsp-server/examples/test-onvif-server.c:53:1: warning: unused function 'REPLAY_IS_BIN' [-Wunused-function]
G_DECLARE_FINAL_TYPE (ReplayBin, replay_bin, REPLAY, BIN, GstBin);
^
/usr/include/glib-2.0/gobject/gtype.h:1407:26: note: expanded from macro 'G_DECLARE_FINAL_TYPE'
  static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) {                                         \
                         ^
<scratch space>:77:1: note: expanded from here
REPLAY_IS_BIN
^
../subprojects/gst-rtsp-server/examples/test-onvif-server.c:525:1: warning: unused function 'ONVIF_FACTORY' [-Wunused-function]
G_DECLARE_FINAL_TYPE (OnvifFactory, onvif_factory, ONVIF, FACTORY,
^
/usr/include/glib-2.0/gobject/gtype.h:1405:33: note: expanded from macro 'G_DECLARE_FINAL_TYPE'
  static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) {                                     \
                                ^
<scratch space>:9:1: note: expanded from here
ONVIF_FACTORY
^
../subprojects/gst-rtsp-server/examples/test-onvif-server.c:525:1: warning: unused function 'ONVIF_IS_FACTORY' [-Wunused-function]
/usr/include/glib-2.0/gobject/gtype.h:1407:26: note: expanded from macro 'G_DECLARE_FINAL_TYPE'
  static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) {                                         \
                         ^
<scratch space>:12:1: note: expanded from here
ONVIF_IS_FACTORY
^

4 years agomeson: Don't generate doc cache when no plugins are enabled
Matthew Waters [Fri, 23 Aug 2019 06:21:36 +0000 (16:21 +1000)]
meson: Don't generate doc cache when no plugins are enabled

Fixes gst-build with -Dauto-features=disabled -Drtsp_server=enabled

4 years agotest-onvif-client: stdin is not defined in MSVC
Xavier Claessens [Fri, 16 Aug 2019 17:38:01 +0000 (13:38 -0400)]
test-onvif-client: stdin is not defined in MSVC

4 years agortsp-media: add missing Since tag
Mathieu Duponchelle [Mon, 12 Aug 2019 16:03:36 +0000 (18:03 +0200)]
rtsp-media: add missing Since tag

4 years agotest-onvif-client: STDIN_FILENO is not portable
Mathieu Duponchelle [Thu, 8 Aug 2019 13:52:53 +0000 (15:52 +0200)]
test-onvif-client: STDIN_FILENO is not portable

If not defined, define it to _fileno(stdin) on Windows, 0
everywhere else

4 years agotest-onvif-server: downgrade logging
Mathieu Duponchelle [Wed, 7 Aug 2019 19:04:33 +0000 (21:04 +0200)]
test-onvif-server: downgrade logging

4 years agoexamples: add ONVIF client / server example
Mathieu Duponchelle [Sat, 27 Jul 2019 03:14:49 +0000 (05:14 +0200)]
examples: add ONVIF client / server example

4 years agortsp-client: define all seek accuracy flags from setup_play_mode
Mathieu Duponchelle [Sat, 27 Jul 2019 03:14:28 +0000 (05:14 +0200)]
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.

4 years agortsp-media: Try to get dynamic payloaders by name from their bin first
Sebastian Dröge [Mon, 22 Jul 2019 16:32:43 +0000 (19:32 +0300)]
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.

4 years agoclient test: expect any port in transport
Mathieu Duponchelle [Wed, 17 Jul 2019 13:51:08 +0000 (15:51 +0200)]
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

4 years agoonvif tests: use g_cond_wait() correctly
Mathieu Duponchelle [Mon, 15 Jul 2019 15:06:42 +0000 (17:06 +0200)]
onvif tests: use g_cond_wait() correctly

g_cond_wait() has to be called in a loop until required conditions
are met

Fixes #71

4 years agortsp-stream: Not wait on receiver streams when pre-rolling
Göran Jönsson [Fri, 28 Jun 2019 10:28:41 +0000 (12:28 +0200)]
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.

4 years agoonvif-media: fix "void function returning a value" compiler warning
Tim-Philipp Müller [Tue, 25 Jun 2019 12:19:44 +0000 (13:19 +0100)]
onvif-media: fix "void function returning a value" compiler warning

4 years agortsp-media: make sure streams are blocked when sending seek
Mathieu Duponchelle [Wed, 12 Jun 2019 20:19:27 +0000 (22:19 +0200)]
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.

4 years agoFix typos
Michael Bunk [Fri, 7 Jun 2019 08:51:19 +0000 (10:51 +0200)]
Fix typos

4 years agoonvif: Implement and test the Streaming Specification
Mathieu Duponchelle [Thu, 4 Apr 2019 22:48:07 +0000 (00:48 +0200)]
onvif: Implement and test the Streaming Specification

https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf

4 years agortsp-client: add gst_rtsp_client_get_stream_transport()
Mathieu Duponchelle [Mon, 5 Nov 2018 14:34:20 +0000 (15:34 +0100)]
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.

4 years agoclient: Scale implies TRICK_MODE
Mathieu Duponchelle [Tue, 6 Nov 2018 23:33:01 +0000 (00:33 +0100)]
client: Scale implies TRICK_MODE

4 years agoclient: compare booleans, not pointers to them
Mathieu Duponchelle [Tue, 6 Nov 2018 23:32:29 +0000 (00:32 +0100)]
client: compare booleans, not pointers to them

4 years agoReverse playback support
Nikita Bobkov [Tue, 13 Nov 2018 20:28:45 +0000 (21:28 +0100)]
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.

4 years agortsp-client: add support for Scale and Speed header
Branko Subasic [Fri, 12 Oct 2018 06:53:04 +0000 (08:53 +0200)]
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

4 years agortsp-client: allow sub classes to adjust the seek
Branko Subasic [Mon, 1 Oct 2018 16:51:49 +0000 (18:51 +0200)]
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

4 years agortsp-media: allow specifying rate when seeking
Branko Subasic [Thu, 27 Sep 2018 17:09:01 +0000 (19:09 +0200)]
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

4 years agomeson: Bump minimal GLib version to 2.44
Niels De Graef [Sun, 2 Jun 2019 19:39:33 +0000 (21:39 +0200)]
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.

4 years agodocs: remove obsolete gtk-doc related files
Mathieu Duponchelle [Fri, 31 May 2019 16:53:36 +0000 (18:53 +0200)]
docs: remove obsolete gtk-doc related files

4 years agodoc: remove xml from comments
Mathieu Duponchelle [Wed, 29 May 2019 21:20:09 +0000 (23:20 +0200)]
doc: remove xml from comments

4 years agodocs: Stop building the doc cache by default
Thibault Saunier [Thu, 16 May 2019 13:23:53 +0000 (09:23 -0400)]
docs: Stop building the doc cache by default

And update the cache

Fixes https://gitlab.freedesktop.org/gstreamer/gst-docs/issues/36

4 years agodocs: Update plugins documentation cache
Thibault Saunier [Tue, 14 May 2019 02:59:57 +0000 (22:59 -0400)]
docs: Update plugins documentation cache

4 years agodoc: Fix some docstrings
Thibault Saunier [Tue, 23 Apr 2019 16:30:02 +0000 (12:30 -0400)]
doc: Fix some docstrings

4 years agodocs: Port to hotdoc
Thibault Saunier [Mon, 22 Oct 2018 09:29:24 +0000 (11:29 +0200)]
docs: Port to hotdoc

5 years agortsp-server: Fix various Since markers
Sebastian Dröge [Tue, 23 Apr 2019 12:09:34 +0000 (15:09 +0300)]
rtsp-server: Fix various Since markers

5 years agortsp-server: Add various Since: 1.14 markers
Sebastian Dröge [Tue, 23 Apr 2019 12:01:32 +0000 (15:01 +0300)]
rtsp-server: Add various Since: 1.14 markers

5 years agortsp-server: Add various missing Since: 1.16 markers
Sebastian Dröge [Tue, 23 Apr 2019 11:38:05 +0000 (14:38 +0300)]
rtsp-server: Add various missing Since: 1.16 markers

5 years agortspclientsink: Set async-handling=false for the internal bins
Sebastian Dröge [Mon, 15 Apr 2019 17:54:24 +0000 (20:54 +0300)]
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

5 years agortspclientsink: Use write_messages() API to send buffer lists in one go
Sebastian Dröge [Mon, 15 Apr 2019 17:51:30 +0000 (20:51 +0300)]
rtspclientsink: Use write_messages() API to send buffer lists in one go

And to write messages with multiple memories also via writev().

5 years agortsp-client: Handle Content-Length limitation
Kristofer Bjorkstrom [Wed, 27 Mar 2019 15:21:03 +0000 (16:21 +0100)]
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

5 years agoBack to development
Tim-Philipp Müller [Fri, 19 Apr 2019 09:40:29 +0000 (10:40 +0100)]
Back to development

5 years agoRelease 1.16.0
Tim-Philipp Müller [Thu, 18 Apr 2019 23:34:54 +0000 (00:34 +0100)]
Release 1.16.0

5 years agortspclientsink: Notify the stream transport about each written message
Sebastian Dröge [Mon, 15 Apr 2019 17:33:01 +0000 (20:33 +0300)]
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.

5 years agortsp_server: Free thread pool before clean transport cache
Göran Jönsson [Tue, 2 Apr 2019 06:05:03 +0000 (08:05 +0200)]
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.

5 years agoRelease 1.15.90
Tim-Philipp Müller [Wed, 10 Apr 2019 23:35:55 +0000 (00:35 +0100)]
Release 1.15.90

5 years agortsp-stream: Add support for GCM (RFC 7714)
Ulf Olsson [Wed, 10 Apr 2019 08:32:53 +0000 (10:32 +0200)]
rtsp-stream: Add support for GCM (RFC 7714)

Follow-up to !198

5 years agosession pool: fix missing klass-> in klass->create_session
Erlend Eriksen [Wed, 27 Mar 2019 23:27:37 +0000 (00:27 +0100)]
session pool: fix missing klass-> in klass->create_session

5 years agog-i: pass --quiet to g-ir-scanner
Tim-Philipp Müller [Sat, 23 Mar 2019 19:16:17 +0000 (19:16 +0000)]
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.

5 years agog-i: silence 'nested extern' compiler warnings when building scanner binary
Tim-Philipp Müller [Sat, 23 Mar 2019 19:15:48 +0000 (19:15 +0000)]
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.

5 years agomeson: pass -Wno-unused to compiler if gstreamer debug system is disabled
Tim-Philipp Müller [Thu, 21 Mar 2019 11:49:10 +0000 (11:49 +0000)]
meson: pass -Wno-unused to compiler if gstreamer debug system is disabled

5 years agortsp-media: Handle set state when preparing.
Göran Jönsson [Thu, 14 Mar 2019 06:37:26 +0000 (07:37 +0100)]
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.

5 years agoBack to development
Tim-Philipp Müller [Mon, 4 Mar 2019 09:13:30 +0000 (09:13 +0000)]
Back to development

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