Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <gst/gst.h>
- #include <gst/rtsp-server/rtsp-server.h>
- int
- main (int argc, char *argv[])
- {
- GMainLoop *loop;
- GstRTSPServer *server;
- GstRTSPMountPoints *mounts;
- GstRTSPMediaFactory *factory;
- gst_init (&argc, &argv);
- if (argc < 2) {
- return -1;
- }
- loop = g_main_loop_new (NULL, FALSE);
- /* create a server instance */
- server = gst_rtsp_server_new ();
- mounts = gst_rtsp_server_get_mount_points (server);
- factory = gst_rtsp_media_factory_new ();
- gst_rtsp_media_factory_set_launch (factory, argv[1]);
- gst_rtsp_mount_points_add_factory (mounts, "/test", factory);
- g_object_unref (mounts);
- gst_rtsp_server_attach (server, NULL);
- /* start serving */
- g_print ("stream ready at rtsp://10.1.100.100:8554/test\n");
- g_main_loop_run (loop);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement