How to interrupt a video stream programmaticaly?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to interrupt a video stream programmaticaly?

Rodrigo Pimenta Carvalho
Hi.

I'm using the test-video.c example.
In the test-video source code I put:

    GstRTSPSessionPool *pool;
    pool = gst_rtsp_server_get_session_pool (server);
    gst_rtsp_session_pool_set_max_sessions(pool, 3);  //to avoid more than 3 sessions

It means that I can run the command 'gst-launch-1.0' 3 times and see 3 windows with the color bar. In this case, if I try to launch the  4th color bar, I will get the Error (503): Service Unavailable, wich is obvious. However, If I close one of the 3 color bars, I will be able to launch another one successfully.

It is clear to me that when I close one color bar window, the stream is interrupted and a session is freed.
I would like to understand how to interrupt a stream and free a session programmatically, because I working with QtGstreamer and I have to codify such action.

So, what does the gst-launch-1.0 execute when the color bar window is closed? That is, what is the code in GStreamer to interrupt and free a session? When can I find such code?

If I find the answer, I will be able to understand what to do in QtGstreamer.
Any hint will be very helpful!
Best regards.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to interrupt a video stream programmaticaly?

Mandar Joshi
> I would like to understand how to interrupt a stream and free a session
> programmatically,

Get the "GstRTSPClient *client" from "client-connected" signal of
GstRTSPServer and when you want to disconnect this client, use the
following code

GstRTSPSessionPool *pool = gst_rtsp_client_get_session_pool (client);
gst_rtsp_session_pool_filter (pool, func, NULL);


where func is

GstRTSPFilterResult func (GstRTSPSessionPool *pool, GstRTSPSession
*session, gpointer user_data) {
   return GST_RTSP_FILTER_REMOVE;
}


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

Re: How to interrupt a video stream programmaticaly?

Rodrigo Pimenta Carvalho

Ok. Thank you very much .

I will analyze your hint.

Then, I will analyze a code with Qt5GStreamer, to figure out how to do the same thing in Qt.


Best regards.



RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: Mandar Joshi [via GStreamer-devel] <ml-node+[hidden email]>
Enviado: quinta-feira, 9 de março de 2017 23:30
Para: Rodrigo Pimenta Carvalho
Assunto: Re: How to interrupt a video stream programmaticaly?
 
> I would like to understand how to interrupt a stream and free a session
> programmatically,

Get the "GstRTSPClient *client" from "client-connected" signal of
GstRTSPServer and when you want to disconnect this client, use the
following code

GstRTSPSessionPool *pool = gst_rtsp_client_get_session_pool (client);
gst_rtsp_session_pool_filter (pool, func, NULL);


where func is

GstRTSPFilterResult func (GstRTSPSessionPool *pool, GstRTSPSession
*session, gpointer user_data) {
   return GST_RTSP_FILTER_REMOVE;
}


Regards
Mandar Joshi
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



If you reply to this email, your message will be added to the discussion below:
http://gstreamer-devel.966125.n4.nabble.com/How-to-interrupt-a-video-stream-programmaticaly-tp4682136p4682146.html
To unsubscribe from How to interrupt a video stream programmaticaly?, click here.
NAML
Loading...