Commit graph

7 commits

Author SHA1 Message Date
Sebastian Dröge 55c961a4dc rtsp-server: media-factory: Make sure a shared media is actually still usable
Previously it was possible that a shared media was just in the process
of being unprepared because the last client disappeared, while another
client retrieved it from the cache and then tried to use it. Unless the
media was reusable this would've then failed unnecessarily.

To avoid this it is necessary to lock the media directly in
gst_rtsp_media_factory_construct() and return a locked media. After
locking the cached media it is necessary to check if the media was ever
unprepared or is actually reusable and based on that either reuse it or
create a new media.

This minimally changes the gst_rtsp_media_factory_construct() API to
always return a locked media, and adds a new
gst_rtsp_media_can_be_shared() function to check if a media can actually
be shared in practice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4606>
2023-05-19 11:09:48 +00:00
Tim-Philipp Müller 2abf3e363d gst-rtsp-server: re-indent with GNU indent 2.2.12
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4182>
2023-03-17 03:18:54 +00:00
Peter Stensson ec605e7b52 rtsp-server: Add support for adjusting request response on pipeline errors
The idea is to give the application the possibility to adjust the error
code when responding to a request. For that purpose the pipeline's bus
messages are emitted to subscribers through a signal handle-message.
The subscribers can then check those messages for errors and adjust
the response error code by overriding the virtual method
adjust_error_code().

Fixes #1294

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2972>
2022-10-11 07:42:28 +02:00
Bruce Liang ebd8bd8f13 rtsp-client: Fix url for generating key in media factory
The mount point at / can be accessed by both the URL forms rtsp://<IP>:<PORT> and rtsp://<IP>:<PORT>/.
To make media factory generating the same key for both the URL forms, the url sent to gst_rtsp_media_factory_construct() needs to be normalized first.
This commit creates a new GstRTSPUrl as the normalized url to send to gst_rtsp_media_factory_construct().

Fixes:https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1297

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2681>
2022-07-12 10:01:35 +00:00
Branko Subasic 41d436e56e gst-rtsp-server: fix race in rtsp-client
When tunneling over HTTP, if connection on the second channel happens
before the control timer is created we may trigger an assert in
rtsp_ctrl_timeout_remove(). Avoid that by taking the priv->lock before
attaching the client thread to the context.

Fixes #1025

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1867>
2022-03-07 09:15:11 +00:00
Ognyan Tonchev 7ba665995f rtsp-client: make sure sessmedia will not get freed while used
handle_*_request() functions were all retrieving the session media from
the session by calling gst_rtsp_session_get_media () which is a transfer-none
call. If a session timeout happens at that time, the session media may get freed
making the pointer invalid..

Fixes #757

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1053>
2021-10-06 19:42:43 +00:00
Thibault Saunier a43d7eaef4 Move files from gst-rtsp-server into the "subprojects/gst-rtsp-server/" subdir 2021-09-24 16:15:21 -03:00
Renamed from gst/rtsp-server/rtsp-client.c (Browse further)