Advertisement
Guest User

Untitled

a guest
Dec 20th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. #include <gst/gst.h>
  2.  
  3. #include <gst/rtsp-server/rtsp-server.h>
  4.  
  5. int
  6. main (int argc, char *argv[])
  7. {
  8.   GMainLoop *loop;
  9.   GstRTSPServer *server;
  10.   GstRTSPMountPoints *mounts;
  11.   GstRTSPMediaFactory *factory;
  12.  
  13.   gst_init (&argc, &argv);
  14.  
  15.   if (argc < 2) {
  16.     return -1;
  17.   }
  18.  
  19.   loop = g_main_loop_new (NULL, FALSE);
  20.  
  21.   /* create a server instance */
  22.   server = gst_rtsp_server_new ();
  23.  
  24.   mounts = gst_rtsp_server_get_mount_points (server);
  25.   factory = gst_rtsp_media_factory_new ();
  26.   gst_rtsp_media_factory_set_launch (factory, argv[1]);
  27.  
  28.   gst_rtsp_mount_points_add_factory (mounts, "/test", factory);
  29.  
  30.   g_object_unref (mounts);
  31.  
  32.   gst_rtsp_server_attach (server, NULL);
  33.  
  34.   /* start serving */
  35.   g_print ("stream ready at rtsp://10.1.100.100:8554/test\n");
  36.   g_main_loop_run (loop);
  37.  
  38.   return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement