mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
Time out sessions
Add support for session timeouts in the example.
This commit is contained in:
parent
b86451dc76
commit
da0ef4a014
1 changed files with 15 additions and 0 deletions
|
@ -21,6 +21,19 @@
|
|||
|
||||
#include <gst/rtsp-server/rtsp-server.h>
|
||||
|
||||
|
||||
static gboolean
|
||||
timeout (GstRTSPServer *server, gboolean ignored)
|
||||
{
|
||||
GstRTSPSessionPool *pool;
|
||||
|
||||
pool = gst_rtsp_server_get_session_pool (server);
|
||||
gst_rtsp_session_pool_cleanup (pool);
|
||||
g_object_unref (pool);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
@ -61,6 +74,8 @@ main (int argc, char *argv[])
|
|||
/* attach the server to the default maincontext */
|
||||
gst_rtsp_server_attach (server, NULL);
|
||||
|
||||
g_timeout_add_seconds (2, (GSourceFunc) timeout, server);
|
||||
|
||||
/* start serving */
|
||||
g_main_loop_run (loop);
|
||||
|
||||
|
|
Loading…
Reference in a new issue