Time out sessions

Add support for session timeouts in the example.
This commit is contained in:
Wim Taymans 2009-02-13 20:00:34 +01:00
parent b86451dc76
commit da0ef4a014

View file

@ -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);