Discussion:
[Bug 767021] New: RTSP server won't be destroyed until media is pre-rolled (or 20s timeout)
"GStreamer" (GNOME Bugzilla)
2016-05-30 13:15:27 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

Bug ID: 767021
Summary: RTSP server won't be destroyed until media is
pre-rolled (or 20s timeout)
Classification: Platform
Product: GStreamer
Version: unspecified
OS: Linux
Status: NEW
Severity: normal
Priority: Normal
Component: gst-rtsp-server
Assignee: gstreamer-***@lists.freedesktop.org
Reporter: ***@gmail.com
QA Contact: gstreamer-***@lists.freedesktop.org
GNOME version: ---

Created attachment 328727
--> https://bugzilla.gnome.org/attachment.cgi?id=328727&action=edit
test case

My application has an RTSP server that can be started/stopped by the user. When
shutting down the server, I disconnect all clients, unref the server, and call
gst_rtsp_thread_pool_cleanup() to be sure all resources has been cleaned.

If a client connects just before I stop the server, it will wait for pre-roll
in gst_rtsp_media_get_status(). If pre-roll never happens it will unblock on a
20s timeout.

I think in the case that the client disconnects, it should unblock that
condition.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-05-31 17:58:36 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

--- Comment #1 from Xavier Claessens <***@gmail.com> ---
Hm, looks like g_source_destroy() on the RTSP server's source fix my problem.
Probably because it prevents new clients to connect while I'm trying to
shutdown the server.

Maybe a proper gst_rtsp_server_shutdown() method could help dealing with that
case.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-05-31 18:16:24 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

--- Comment #2 from Xavier Claessens <***@gmail.com> ---
Actually just got a crash with that backtrace, while a thread was inside
gst_rtsp_thread_pool_cleanup():

#0 0x6206aa90 in default_get_thread (pool=0x63757258, type=<optimized out>,
ctx=0x696cfc28) at rtsp-thread-pool.c:496
#1 0x6207c786 in find_media (client=***@entry=0x64382098,
ctx=***@entry=0x696cfc28, path=***@entry=0x637bcfb0 "/live",
matched=***@entry=0x0) at rtsp-client.c:695
#2 0x6207e9a2 in handle_describe_request (ctx=0x696cfc28, client=0x64382098)
at rtsp-client.c:2227
#3 handle_request (request=<optimized out>, client=0x64382098) at
rtsp-client.c:2884
#4 gst_rtsp_client_handle_message (client=0x64382098, message=<optimized out>)
at rtsp-client.c:3474
#5 0x62099ad6 in gst_rtsp_source_dispatch_read (stream=<optimized out>,
watch=0x63760ed0) at gstrtspconnection.c:3368
#6 0x62261498 in g_main_dispatch (context=0x65bf8568) at gmain.c:3237
#7 g_main_context_dispatch (context=***@entry=0x65bf8568) at gmain.c:3898
#8 0x62261640 in g_main_context_iterate (context=0x65bf8568,
block=***@entry=1, dispatch=***@entry=1, self=<optimized out>) at
gmain.c:3969
#9 0x622618e8 in g_main_loop_run (loop=0x641cb380) at gmain.c:4163
#10 0x6206a59e in do_loop (thread=0x6442fce0) at rtsp-thread-pool.c:329
#11 0x622760f4 in g_thread_pool_thread_proxy (data=<optimized out>) at
gthreadpool.c:307
#12 0x62275b76 in g_thread_proxy (data=0x6375a5b0) at gthread.c:778
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-06-02 13:39:49 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

Xavier Claessens <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-06-02 13:39:53 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

--- Comment #3 from Xavier Claessens <***@gmail.com> ---
Created attachment 328955
--> https://bugzilla.gnome.org/attachment.cgi?id=328955&action=edit
Add gst_rtsp_server_shutdown()

When shutting down an RTSP server, a client could be in the process of
connecting, preparing its media, etc.

Most importantly, the client could be blocking waiting for the media pre-roll.
To unblock that situation, the client becomes responsible to call _unprepare()
on its media as soon as it reached the "preparing" state.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-06-02 14:02:11 UTC
Permalink
This post might be inappropriate. Click to display it.
"GStreamer" (GNOME Bugzilla)
2016-06-02 17:16:29 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

Xavier Claessens <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #328955|0 |1
is obsolete| |

--- Comment #5 from Xavier Claessens <***@gmail.com> ---
Created attachment 328984
--> https://bugzilla.gnome.org/attachment.cgi?id=328984&action=edit
Add gst_rtsp_server_shutdown()

When shutting down an RTSP server, a client could be in the process of
connecting, preparing its media, etc.

Most importantly, the client could be blocking waiting for the media pre-roll.
To unblock that situation, the client becomes responsible to call _unprepare()
on its media as soon as it reached the "preparing" state.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-10-13 13:07:16 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

Xavier Claessens <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Depends on| |750111

--- Comment #6 from Xavier Claessens <***@gmail.com> ---
Proposed patch uses the "preparing" signal added in the patch proposed for bug
#750111
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-10-20 10:43:13 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

Sebastian Dröge (slomo) <***@coaxion.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #328984|none |needs-work
status| |

--- Comment #7 from Sebastian Dröge (slomo) <***@coaxion.net> ---
Review of attachment 328984:
--> (https://bugzilla.gnome.org/review?bug=767021&attachment=328984)

::: gst/rtsp-server/rtsp-media.c
@@ +3011,3 @@
+ if (priv->status == GST_RTSP_MEDIA_STATUS_UNPREPARED ||
+ priv->status == GST_RTSP_MEDIA_STATUS_UNPREPARING ||
+ priv->status == GST_RTSP_MEDIA_STATUS_ERROR)

In UNPREPARING we should probably wait? And in ERROR there might still be
something to shut down

::: gst/rtsp-server/rtsp-server.c
@@ +1478,3 @@
+ * gst_rtsp_thread_pool_cleanup().
+ *
+ * Since: 1.10

Since: 1.12 :)
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-11-03 15:38:44 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021
Bug 767021 depends on bug 750111, which changed state.

Bug 750111 Summary: rtsp-media: emit signal for preparing dynamic payloads
https://bugzilla.gnome.org/show_bug.cgi?id=750111

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |OBSOLETE
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-11-03 15:39:57 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=767021

GStreamer system administrator <***@gstreamer.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |OBSOLETE

--- Comment #8 from GStreamer system administrator <***@gstreamer.net> ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance:
https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/22.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
Loading...