get rtcp packets from gst-rtsp-server

Oleg Konovalov oleg.konovalov at seraphimas-hls.com
Thu Oct 14 06:14:04 UTC 2021


Hi Nirbheek, thanks for the answer.
I was able to run an example ( gst-plugins-good-1.18.1/tests/examples/rtp/server-rtpaux.c)   with rtpbin and a pad probe ( just like you suggested). The problem for me with gst-rtsp-server is that I don't know how to access rtpbin and udpsinks inside gst-rtsp-server.
At the moment I'm using

n_streams = gst_rtsp_media_n_streams(gstRTSPMedia);
pstream = gst_rtsp_media_get_stream(GstRTSPMedia, 0);
GSocket * psoc = gst_rtsp_stream_get_rtcp_socket(pstream,G_SOCKET_FAMILY_IPV4);
gssize  size = g_socket_receive( psoc,     buf,   150,     NULL,   NULL);

and i can get rtcp packets.
But this looks kind of a workaround. But it is OK for me while testing some algo.
If someone can provide a "right" solution without spending too much time would be interesting to know.

regards
Oleg K.
________________________________
From: Nirbheek Chauhan <nirbheek.chauhan at gmail.com>
Sent: Thursday, October 14, 2021 7:03 AM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Cc: Oleg Konovalov <oleg.konovalov at seraphimas-hls.com>
Subject: Re: get rtcp packets from gst-rtsp-server

On Wed, Oct 13, 2021 at 3:45 PM Oleg Konovalov via gstreamer-devel
<gstreamer-devel at lists.freedesktop.org> wrote:
> I need to get rtcp packets while running gst-rtsp-server example test-uri.c ( gst-rtsp-server-1.18.1). No idea how to do it.
> Is it possible at all ? Or someone can post some idea and a "way" how to get those rtcp packet ?
>

The easiest way is to use a pad probe on the udpsink that is sending
out the RTCP packets. Just remember that the callback you set there
will be invoked from inside an arbitrary gstreamer thread, so you
should not do non-trivial processing inside that. You should signal a
different thread and do the work there, or invoke it on the main loop.

https://gstreamer.freedesktop.org/documentation/additional/design/probes.html?gi-language=c
https://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html?gi-language=c

Cheers,
Nirbheek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211014/e57ad124/attachment.htm>


More information about the gstreamer-devel mailing list