rtsp-server closing session server side
Damiano Pinarello
damiano.pinarello at bticino.it
Thu Jan 10 23:27:08 PST 2013
Hi all,
I have created a rtsp-server that manage multiple streams.
For example, the server will manage these urls /test1 /test2 ... on the same port.
Now I want to stop/close, from server side, all sessions that are managing the same
url. A client could be represented by a pipeline with pad rtspsrc.
For more details, I paste below a server code
int h264video_server()
{
GMainLoop *loop;
GstRTSPServer *server;
GstRTSPMediaMapping *mapping;
GstRTSPMediaFactory *factory;
gchar *pipeline;
loop = g_main_loop_new(NULL, FALSE);
server = gst_rtsp_server_new();
gst_rtsp_server_set_service(server, "3050");
g_print("RTSP server: port %s", gst_rtsp_server_get_service(server));
mapping = gst_rtsp_server_get_media_mapping(server);
factory = gst_rtsp_media_factory_new();
pipeline = g_strdup_printf("("
" v4l2src always-copy=FALSE !"
" video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720,framerate=(fraction)30/1 !"
" TIVidenc1 bitRate=6000000 encodingPreset=3 idrFrameInterval=30 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE !"
" rtph264pay config-interval=5 pt=96 name=pay0"
" )");
gst_rtsp_media_factory_set_launch(GST_RTSP_MEDIA_FACTORY(factory), pipeline);
gst_rtsp_media_mapping_add_factory(mapping, "/test1", GST_RTSP_MEDIA_FACTORY(factory));
g_object_unref(mapping);
gst_rtsp_media_factory_set_shared(factory, TRUE);
gst_rtsp_server_attach(server, NULL);
g_timeout_add_seconds(2, (GSourceFunc)timeout, server);
g_main_loop_run(loop);
return 0;
}
Any suggenstions?
Thanks in advance
Damiano
--
Damiano PINARELLO
Embedded Software Developer
Office Phone: +(39) 031 653679 Ext. 4679
FAX phone: +(39) 031 653283
Email: damiano.pinarello at bticino.it
Street address: Via L. Manara 4, 22036 Erba (CO), Italy
WebSite: www.bticino.it
------------------------------------------------------------------------------
Please consider your environmental responsibility before printing this Email
------------------------------------------------------------------------------
This message and any attachments are confidential and they also are legally
privileged in accordance with the NDA. If you have received this message in
error, please notify us and remove it from your system.
------------------------------------------------------------------------------
Ce message, ainsi que tous les fichiers joints à ce message,
peuvent contenir des informations sensibles et/ ou confidentielles
ne devant pas être divulguées. Si vous n'êtes pas le destinataire
de ce message (ou que vous recevez ce message par erreur), nous
vous remercions de le notifier immédiatement à son expéditeur, et
de détruire ce message. Toute copie, divulgation, modification,
utilisation ou diffusion, non autorisée, directe ou indirecte, de
tout ou partie de ce message, est strictement interdite.
This e-mail, and any document attached hereby, may contain
confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any
unauthorized, direct or indirect, copying, disclosure, distribution
or other use of the material or parts thereof is strictly
forbidden.
More information about the gstreamer-devel
mailing list