Destroy Gstreamer RTSP Server Object without exiting main application

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

Destroy Gstreamer RTSP Server Object without exiting main application

rhythm87
I'm creating a GstRTSPServer, and associating a service i.e. port to it using
GstRtspServer.RTSPServer.set_service(). Now I want to destroy or kill the
server so as to free the port, but without exiting my main application, so
that port can be reused. How can I do the same without exiting my main
application.

P.S.: I referred to  Free Desktop Docs
<https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-rtsp-server/html/GstRTSPServer.html>  
but couldn't find a method for the same. I'm using python bindings for the
same.

Please suggest.



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

Re: Destroy Gstreamer RTSP Server Object without exiting main application

Michael MacIntosh
Hello,

When you attach your server to the GMainContext using
gst_rtsp_server_attach, that function returns a gsource pointer, which
you can use to destroy it when you are done.

You can find the source using g_main_context_find_source_by_id

https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-main-context-find-source-by-id

And then calling g_source_destroy on that GSource pointer.

That should free up the port.

Hope that helps!


On 1/31/2018 11:02 PM, rhythm87 wrote:

> I'm creating a GstRTSPServer, and associating a service i.e. port to it using
> GstRtspServer.RTSPServer.set_service(). Now I want to destroy or kill the
> server so as to free the port, but without exiting my main application, so
> that port can be reused. How can I do the same without exiting my main
> application.
>
> P.S.: I referred to  Free Desktop Docs
> <https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-rtsp-server/html/GstRTSPServer.html>
> but couldn't find a method for the same. I'm using python bindings for the
> same.
>
> Please suggest.
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.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: Destroy Gstreamer RTSP Server Object without exiting main application

rhythm87
Hi,
I have tried what you asked but destroying the source doesn't make the port
available, although after destroying the source I couldn't find any source
with same source_id, but the port still remains bound to the RTSP server
until I exit my main application.
For the record, following is the code I using to do the same RTSP server
test <https://gist.github.com/code-player/a26b06ac8c6a835ae2393c465d984471>  

Please suggest if I'm missing something.



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

Re: Destroy Gstreamer RTSP Server Object without exiting main application

rhythm87
Hi,
After spending more time with RTSP Server, I was able to figure out that it
can be done, by unrefering the context I'm attaching to the server.

So, context.unref(), frees the locked port by RTSP Server.

Regards,
Rhythm



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