<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size:12pt">Hi Nirbheek, thanks for the answer.</span>
<div style="font-size:12pt">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. <br>
</div>
<div style="font-size:12pt">At the moment I'm using <br>
</div>
<div style="font-size:12pt"><br>
</div>
<div style="font-size:12pt">n_streams = gst_rtsp_media_n_streams(gstRTSPMedia);</div>
<div style="font-size:12pt">pstream = gst_rtsp_media_get_stream(GstRTSPMedia, 0);</div>
<div style="font-size:12pt">GSocket * psoc = gst_rtsp_stream_get_rtcp_socket(pstream,G_SOCKET_FAMILY_IPV4);</div>
<div style="font-size:12pt">gssize  size = g_socket_receive( psoc,     buf,   150,     NULL,   NULL);</div>
<div style="font-size:12pt"><br>
</div>
<div style="font-size:12pt">and i can get rtcp packets. <br>
</div>
<div style="font-size:12pt">But this looks kind of a workaround. But it is OK for me while testing some algo.</div>
<div style="font-size:12pt">If someone can provide a "right" solution without spending too much time would be interesting to know.</div>
<div style="font-size:12pt"><br>
</div>
<div style="font-size:12pt">regards</div>
<span style="font-size:12pt">Oleg K.</span><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Nirbheek Chauhan <nirbheek.chauhan@gmail.com><br>
<b>Sent:</b> Thursday, October 14, 2021 7:03 AM<br>
<b>To:</b> Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org><br>
<b>Cc:</b> Oleg Konovalov <oleg.konovalov@seraphimas-hls.com><br>
<b>Subject:</b> Re: get rtcp packets from gst-rtsp-server</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Wed, Oct 13, 2021 at 3:45 PM Oleg Konovalov via gstreamer-devel<br>
<gstreamer-devel@lists.freedesktop.org> wrote:<br>
> 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.<br>
> Is it possible at all ? Or someone can post some idea and a "way" how to get those rtcp packet ?<br>
><br>
<br>
The easiest way is to use a pad probe on the udpsink that is sending<br>
out the RTCP packets. Just remember that the callback you set there<br>
will be invoked from inside an arbitrary gstreamer thread, so you<br>
should not do non-trivial processing inside that. You should signal a<br>
different thread and do the work there, or invoke it on the main loop.<br>
<br>
<a href="https://gstreamer.freedesktop.org/documentation/additional/design/probes.html?gi-language=c">https://gstreamer.freedesktop.org/documentation/additional/design/probes.html?gi-language=c</a><br>
<a href="https://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html?gi-language=c">https://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html?gi-language=c</a><br>
<br>
Cheers,<br>
Nirbheek<br>
</div>
</span></font></div>
</body>
</html>