gst-rtsp-server default token
horai
ivo.hora at seznam.cz
Sun Feb 23 18:34:49 UTC 2020
Dear all,
Following this example:
https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-auth.c,
I wanted to have gst-rtsp-server with two mountpoints. First one with not
authorization (implemented with default token authorization) the latter with
authorization (user:password).
How can I connect to the first one without any authorization, following
pipeline with user:password removed does not work anymore for 'test'
mountpoint (seems like it request some anonymous or whatever sort of
authorization):
gst-launch-1.0 -v rtspsrc location="rtsp://127.0.0.1:8554/test" latency=0 !
rtph264depay ! h264parse ! vaapih264dec ! videoconvert ! ximagesink
I found a post asking similar question:
http://gstreamer-devel.966125.n4.nabble.com/Remove-all-users-from-RTSP-server-and-allow-unrestricted-access-to-stream-td4690630.html
I have these mount points:
gst_rtsp_mount_points_add_factory (mounts, "/test", factory);
gst_rtsp_media_factory_add_role (factory, "anonymous",
GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE,
GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, FALSE, NULL);
gst_rtsp_mount_points_add_factory (mounts, "/test2", factory);
gst_rtsp_media_factory_add_role (factory, "admin2",
GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE,
GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, TRUE, NULL);
With this authorization:
token =
gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING,
"anonymous", NULL);
gst_rtsp_auth_set_default_token (auth, token);
gst_rtsp_token_unref (token);
/* make user token */
token =
gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING,
"user", NULL);
basic = gst_rtsp_auth_make_basic ("user", "password");
gst_rtsp_auth_add_basic (auth, basic, token);
g_free (basic);
gst_rtsp_token_unref (token);
Thank you
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list