Add support for session timeouts in the example.
#include <gst/rtsp-server/rtsp-server.h>
#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[])
{
int
main (int argc, char *argv[])
{
/* attach the server to the default maincontext */
gst_rtsp_server_attach (server, NULL);
/* 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);
/* start serving */
g_main_loop_run (loop);