From c99db9a42b060ce5e2268afddb276c0da9a65fcd Mon Sep 17 00:00:00 2001 From: Jan Vermaete Date: Sat, 11 Feb 2023 19:55:41 +0100 Subject: [PATCH] rtsp-server: test-launch: added the argument mount/m to specify the mountpoint Default is the previous hardcoded "/test" Part-of: --- subprojects/gst-rtsp-server/examples/test-launch.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-rtsp-server/examples/test-launch.c b/subprojects/gst-rtsp-server/examples/test-launch.c index b21df8ed4c..9d86913bf3 100644 --- a/subprojects/gst-rtsp-server/examples/test-launch.c +++ b/subprojects/gst-rtsp-server/examples/test-launch.c @@ -22,14 +22,18 @@ #include #define DEFAULT_RTSP_PORT "8554" +#define DEFAULT_MOUNT "/test" #define DEFAULT_DISABLE_RTCP FALSE static char *port = (char *) DEFAULT_RTSP_PORT; +static char *mount = (char *) DEFAULT_MOUNT; static gboolean disable_rtcp = DEFAULT_DISABLE_RTCP; static GOptionEntry entries[] = { {"port", 'p', 0, G_OPTION_ARG_STRING, &port, "Port to listen on (default: " DEFAULT_RTSP_PORT ")", "PORT"}, + {"mount", 'm', 0, G_OPTION_ARG_STRING, &mount, + "Mountpoint (default: " DEFAULT_MOUNT ")", "MOUNT"}, {"disable-rtcp", '\0', 0, G_OPTION_ARG_NONE, &disable_rtcp, "Whether RTCP should be disabled (default false)", NULL}, {NULL} @@ -76,8 +80,8 @@ main (int argc, char *argv[]) gst_rtsp_media_factory_set_shared (factory, TRUE); gst_rtsp_media_factory_set_enable_rtcp (factory, !disable_rtcp); - /* attach the test factory to the /test url */ - gst_rtsp_mount_points_add_factory (mounts, "/test", factory); + /* attach the test factory to the mount url */ + gst_rtsp_mount_points_add_factory (mounts, mount, factory); /* don't need the ref to the mapper anymore */ g_object_unref (mounts); @@ -86,7 +90,7 @@ main (int argc, char *argv[]) gst_rtsp_server_attach (server, NULL); /* start serving */ - g_print ("stream ready at rtsp://127.0.0.1:%s/test\n", port); + g_print ("stream ready at rtsp://127.0.0.1:%s%s\n", port, mount); g_main_loop_run (loop); return 0;