Hi,
I am using a rtspserver with an appsink element. I am currently having issues when trying to dispose and recreate a rtspserver. To delete the server I am doing to following operations: g_main_loop_quit() g_source_remove() to remove the source from attaching the server. g_main_loop_unref() g_object_unref(server) I can create a new server on the same port but I cant connect to it with a client. Also I had an issue when trying to delete the server while a client is connected, it would crash because a udpsrc element was stuck in the play state. As a workaround I am stopping the appsink "need-data" callback before destroying the server. I can't find any example of how to properly dispose of a server because the existing examples seem to depend on the main process exit. Thanks, Serj. _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi,
On Thu, Mar 10, 2016 at 10:02 AM, Serj TorresSoldado <[hidden email]> wrote: > Hi, > > I am using a rtspserver with an appsink element. > > I am currently having issues when trying to dispose and recreate a > rtspserver. To delete the server I am doing to following operations: > > g_main_loop_quit() > g_source_remove() to remove the source from attaching the server. > g_main_loop_unref() > g_object_unref(server) > > I can create a new server on the same port but I cant connect to it with a > client. > > Also I had an issue when trying to delete the server while a client is > connected, it would crash because a udpsrc element was stuck in the play > state. As a workaround I am stopping the appsink "need-data" callback before > destroying the server. > > I can't find any example of how to properly dispose of a server because the > existing examples seem to depend on the main process exit. > flush-on-eos=true), catch it on the bus handler then later do a mail_loop quit unref that object, remove the factory (gst_rtsp_mount_points_remove_factory ()), unref the mounts object, unref the factory object and lastly unref the server object. Cheers, --Prabhakar Lad _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thank you Prabhakar. I couldn't get it to cleanly close down the server. The following is the simplest example I could make to reproduce this. #include <gst/gst.h> #include <gst/rtsp-server/rtsp-server.h> static gboolean timeout(GMainLoop *loop) { g_main_loop_quit(loop); return FALSE; } int main(int argc, char *argv[]) { GMainLoop *loop; GstRTSPServer *server; gst_init(NULL, NULL); loop = g_main_loop_new(NULL, FALSE); server = gst_rtsp_server_new(); g_object_set(server, "service", "8555", NULL); gst_rtsp_server_attach(server, NULL); g_timeout_add_seconds(2, (GSourceFunc) timeout, loop); g_main_loop_run(loop); gst_object_unref(server); g_main_loop_unref(loop); loop = g_main_loop_new(NULL, FALSE); server = gst_rtsp_server_new(); g_object_set(server, "service", "8555", NULL); gst_rtsp_server_attach(server, NULL); g_timeout_add_seconds(2, (GSourceFunc) timeout, loop); g_main_loop_run(loop); gst_object_unref(server); g_main_loop_unref(loop); return 0; } The weird thing I found out is that commenting the gst_init() resolves the issue.. On 10 March 2016 at 13:08, Lad, Prabhakar <[hidden email]> wrote: Hi, _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Do, 2016-03-10 at 14:49 +0000, Serj TorresSoldado wrote:
> Thank you Prabhakar. > > I couldn't get it to cleanly close down the server. The following is > the simplest example I could make to reproduce this. > [...] > gst_rtsp_server_attach(server, NULL); attach() is returning a GSource id, which you have to detach/destroy from the main context again. > The weird thing I found out is that commenting the gst_init() > resolves the issue.. I'm surprised anything works at all then :) -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) Download Attachment |
I'm afraid I wasn't removing the source with g_source_remove(). Thank you for you help. On 11 March 2016 at 06:44, Sebastian Dröge <[hidden email]> wrote: On Do, 2016-03-10 at 14:49 +0000, Serj TorresSoldado wrote: _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |