<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello!</p>
    <p>I would like to use this framework to re-stream an UDP stream
      (h264 stream from ffmpeg) without transcoding and videoscaling
      like a RTSP media server.</p>
    <p>I wrote a code as for samples, but it does not work stable,
      sometimes it works and sometimes it doesn't while the udp source
      is stable and working.</p>
    <p>What did I do wrong or is it possible operation what I want?</p>
    <p>BR.</p>
    <p>Labi<br>
    </p>
    <blockquote>
      <p>t_server serv;<br>
        guint id;<br>
        <br>
        gst_init(NULL, NULL);<br>
        <br>
        serv.loop = g_main_loop_new(NULL, FALSE);<br>
        serv.server = gst_rtsp_server_new();<br>
        serv.mounts = gst_rtsp_server_get_mount_points(serv.server);<br>
        <br>
        gst_rtsp_server_set_address(serv.server, "192.168.1.132");<br>
        gst_rtsp_server_set_service(serv.server, "8001");<br>
        <br>
        gchar sessionid[256];<br>
        sprintf(sessionid, "Session_%d_%d", GetTickCount(), rand());<br>
        <br>
        auto &&session = gst_rtsp_session_new(sessionid);<br>
        gst_rtsp_session_prevent_expire(session);<br>
        <br>
        serv.factory = gst_rtsp_media_factory_new();<br>
        <br>
        gst_rtsp_media_factory_set_shared(serv.factory, FALSE);<br>
        gst_rtsp_media_factory_set_latency(serv.factory, 2000);<br>
        <br>
        gst_rtsp_mount_points_add_factory(serv.mounts, "input",
        serv.factory);<br>
        <br>
        g_object_unref(serv.mounts);<br>
        <br>
        gst_rtsp_media_factory_set_launch(serv.factory, "uridecodebin
        uri=udp://224.0.1.1:1001 ! rtph264pay config-interval=1
        name=pay0 pt=96");<br>
        <br>
        if (id=gst_rtsp_server_attach(serv.server, NULL) == 0) <br>
        {<br>
            return -1;<br>
        }<br>
            <br>
        GMainContext *glib_context = g_main_context_default();<br>
        <br>
        bool quit_indicator = false;<br>
        while (quit_indicator == false)<br>
        {<br>
            g_main_context_iteration(glib_context, /*allow
        blocking=*/false);<br>
        }<br>
        <br>
        /* cleanup */<br>
        g_main_loop_quit(serv.loop);<br>
        g_source_remove(id);<br>
        g_object_unref(serv.server);<br>
        g_main_loop_unref(serv.loop);<br>
      </p>
    </blockquote>
  </body>
</html>