Stopping the rtsp-server

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Stopping the rtsp-server

jlancaster
I am running the rtsp-server on g_main_loop and after a time I want to terminate the loop with the server, the client and all other things related to it, but not the process that launched them.

When I end the loop with g_main_loop_quit the server and client continue to run.

It doesn't seem obvious how to stop the server/client other than to terminate the process that created it, but I don't want to end the process just the server and a clients.

One post says they use g_source_remove().
http://comments.gmane.org/gmane.comp.video.gstreamer.bugs/101109

Please advise.
Jeff Lancaster
Reply | Threaded
Open this post in threaded view
|

Re: Stopping the rtsp-server

Vineeth
Hi i am facing similar issue.

Does anyone know how to solve the issue?

I want to stop the server without killing the process which started the server.

I tried
g_source_remove0
gst_object_unref() of GstRTSPServer

Is there anything else missing?
Please help
Reply | Threaded
Open this post in threaded view
|

Re: Stopping the rtsp-server

saepia
gst_rtsp_server_attach () returns GLib source ID.  So you have to use g_source_remove, and then you can safely unref the server object. Please take a look at notes if you use other main context than default.

https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-rtsp-server/html/GstRTSPServer.html#gst-rtsp-server-attach

m.

2016-07-08 11:21 GMT+02:00 Vineeth <[hidden email]>:
Hi i am facing similar issue.

Does anyone know how to solve the issue?

I want to stop the server without killing the process which started the
server.

I tried
g_source_remove0
gst_object_unref() of GstRTSPServer

Is there anything else missing?
Please help



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Stopping-the-rtsp-server-tp4659945p4678527.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stopping the rtsp-server

Vineeth
I am already doing it..

Please find the below code snippet


creating server:

        gst_server = gst_rtsp_server_new ();
        g_object_set (gst_server, "service", port, NULL);
        mounts = gst_rtsp_server_get_mount_points (gst_server);
        factory = gst_rtsp_media_factory_uri_new ();
        gst_rtsp_media_factory_uri_set_uri (factory, uri);
        gst_rtsp_media_factory_set_shared (factory, TRUE);
        gst_rtsp_mount_points_add_factory (mounts, file_name, GST_RTSP_MEDIA_FACTORY (factory));
        g_object_unref (mounts);
        if ((gst_server_id=gst_rtsp_server_attach (gst_server, NULL)) == 0)
                goto failed;



while stopping server:
                        g_source_remove (gst_server_id);
                        GstRTSPMountPoints *mounts = NULL;
                        mounts = gst_rtsp_server_get_mount_points(gst_server);
                        gst_rtsp_mount_points_remove_factory (mounts, file_name);
                        g_object_unref (mounts);

                        int serv_ref_cnt = GST_OBJECT_REFCOUNT_VALUE(gst_server);
                        int i;
                        for (i = 0; i < serv_ref_cnt; i++)
                                g_object_unref(gst_server);


PS: i am using 1.6.1 version of gstreamer
Reply | Threaded
Open this post in threaded view
|

Re: Stopping the rtsp-server

saepia
Try the most recent version first.

m.

2016-07-08 11:49 GMT+02:00 Vineeth <[hidden email]>:
I am already doing it..

Please find the below code snippet


creating server:

        gst_server = gst_rtsp_server_new ();
        g_object_set (gst_server, "service", port, NULL);
        mounts = gst_rtsp_server_get_mount_points (gst_server);
        factory = gst_rtsp_media_factory_uri_new ();
        gst_rtsp_media_factory_uri_set_uri (factory, uri);
        gst_rtsp_media_factory_set_shared (factory, TRUE);
        gst_rtsp_mount_points_add_factory (mounts, file_name,
GST_RTSP_MEDIA_FACTORY (factory));
        g_object_unref (mounts);
        if ((gst_server_id=gst_rtsp_server_attach (gst_server, NULL)) == 0)
                goto failed;



while stopping server:
                        g_source_remove (gst_server_id);
                        GstRTSPMountPoints *mounts = NULL;
                        mounts = gst_rtsp_server_get_mount_points(gst_server);
                        gst_rtsp_mount_points_remove_factory (mounts, file_name);
                        g_object_unref (mounts);

                        int serv_ref_cnt = GST_OBJECT_REFCOUNT_VALUE(gst_server);
                        int i;
                        for (i = 0; i < serv_ref_cnt; i++)
                                g_object_unref(gst_server);


PS: i am using 1.6.1 version of gstreamer



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Stopping-the-rtsp-server-tp4659945p4678532.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stopping the rtsp-server

mickie
Hi All,

Is it feasible to have multiple RTSP server instance in the same process?
I am working on an application which has got 2 independent pipeline running
under the same process. I have used test-appsrc2 in examples as reference
and created 2 server instance with different ports which works for the very
first time. However if I stop and delete the pipelines and start everything
from scratch, The server doesn't seem to be streaming. Once I restart the
process, It works for the first time again.
I do,
cleaning up the session pool ,source_remove of server id,  removing the
factory, unref the server

I need some guidance in how to implement the server for streaming. Do I need
to have 2 different process for 2 server instance?  I have gone through the
reference, still couldn't get answer for this. Any lead would be great help.

Thanks,
M



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel