From: Wim Taymans Date: Tue, 20 Nov 2012 11:47:49 +0000 (+0100) Subject: test-uri: remove mapping example X-Git-Tag: 1.19.3~495^2~1256 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1023b60959062d49df8a3cfccb6bc1cb28d548ba;p=platform%2Fupstream%2Fgstreamer.git test-uri: remove mapping example --- diff --git a/examples/test-uri.c b/examples/test-uri.c index 62c06e6..5d134a0 100644 --- a/examples/test-uri.c +++ b/examples/test-uri.c @@ -34,6 +34,19 @@ timeout (GstRTSPServer * server) return TRUE; } +static gboolean +remove_map (GstRTSPServer * server) +{ + GstRTSPMediaMapping *mapping; + + g_print ("removing /test mapping\n"); + mapping = gst_rtsp_server_get_media_mapping (server); + gst_rtsp_media_mapping_remove_factory (mapping, "/test"); + g_object_unref (mapping); + + return FALSE; +} + int main (int argc, char *argv[]) { @@ -79,7 +92,11 @@ main (int argc, char *argv[]) if (gst_rtsp_server_attach (server, NULL) == 0) goto failed; + /* do session cleanup every 2 seconds */ g_timeout_add_seconds (2, (GSourceFunc) timeout, server); + /* remove the mapping after 10 seconds, new clients won't be able to use the + * /test url anymore */ + g_timeout_add_seconds (10, (GSourceFunc) remove_map, server); /* start serving */ g_print ("stream ready at rtsp://127.0.0.1:8554/test\n");