RTSP Server notification for client connection/disconnection

Amaury Denoyelle amaury.denoyelle at gmail.com
Thu Aug 21 02:20:51 PDT 2014


Hello,

I'm currently working with gst-rtsp-server v1.4. I want to be notified when new client are connected/disconnected to my server. I need several infos about client : ip address, port and requested video name (rtsp mount point uri).

I have already tried different solutions, with several flaws for all of them:
- Using "client-connected" signal of GstRTSPServer : it seems there is no way to retrieve video requested with this signal. Also, there is no "client-disconnected" signal, so I need to connect for every client on "teardown-request" for example, but if I fear some overhead with this solution (I'm not quite experience with GObject/signals system).
- Using same signal "client-connected", and in handler, connect to GstRTSPClient "describe-request"/"teardown-request". Again, it looks like a pretty costly solution to me, as I need to connect signal for every new clients.
- Adding a hook (g_signal_add_emission_hook) on udpsink "client-added"/"client-removed" signals. It works quite well, except I'm notified two times per connection/disconnection. I believed it's because there is several udpsink for each rtsp pipeline.

The last solution I think about is instead of using hook for udpsink, find a way to retrieve udpsink element from rtsp pipeline, and attach signal to one element instance. This way, I can avoid the two-times notification. Sadly, I do not know how to retrieve udpsink instance. My first idea was to create my own factory, providing a custom pipeline to GstRTSPServer, and use gst_bin_by_name_recurse_up to retrieve udpsink, but again, it's quite a not-so-fast solution.

Do you think I need to try my last idea, or is it a better solution?

Thank you for your time and help :)

Amaury


More information about the gstreamer-devel mailing list