From da0ef4a01414f5b5b3daa85d6695a409b97e741d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 13 Feb 2009 20:00:34 +0100 Subject: [PATCH] Time out sessions Add support for session timeouts in the example. --- examples/test-video.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/test-video.c b/examples/test-video.c index b03bc6c..5ed8b1d 100644 --- a/examples/test-video.c +++ b/examples/test-video.c @@ -21,6 +21,19 @@ #include + +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); -- 2.7.4