How to connect on-receiving-rtcp signal in rtpsession?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to connect on-receiving-rtcp signal in rtpsession?

Philippe Lalevée
Hello,
Maybe it's a trivial question...
I see "on-receiving-rtcp" and "on-sending-rtcp" signals in the rtpsession source code (lines 283 and 376), but not when I execute "gst-inspect-1.0 rtpsession", or when I try to use it in
       g_signal_connect(send_rtpbin, "on-sending-rtcp", G_CALLBACK(on_sending_rtcp_cb), NULL);
    g_signal_connect(recv_rtpbin, "on-receiving-rtcp", G_CALLBACK(on_receiving_rtcp_cb), NULL);

Could you give some tips to use these signals?
Thanks in advance
Philippe

Context: Ubuntu 18.10 and GStreamer 1.14.4
--
Philippe Lalevée


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

Re: How to connect on-receiving-rtcp signal in rtpsession?

Sebastian Dröge-3
On Wed, 2018-12-26 at 16:58 +0100, Philippe Lalevée wrote:

> Hello,
> Maybe it's a trivial question...
> I see "on-receiving-rtcp" and "on-sending-rtcp" signals in the
> rtpsession source code (lines 283 and 376), but not when I execute
> "gst-inspect-1.0 rtpsession", or when I try to use it in
> >        g_signal_connect(send_rtpbin, "on-sending-rtcp",
> > G_CALLBACK(on_sending_rtcp_cb), NULL);
> >     g_signal_connect(recv_rtpbin, "on-receiving-rtcp",
> > G_CALLBACK(on_receiving_rtcp_cb), NULL);
>  
> Could you give some tips to use these signals?
They are signals on the rtpsession object, not the GStreamer element.
That's why you don't see them in gst-inspect-1.0 for example.

You can get the rtpsession object from the "internal-session" property
on the rtpsession element.

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


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

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to connect on-receiving-rtcp signal in rtpsession?

Philippe Lalevée
Hello,
Thanks Sebastian for your reply.

On 27/12/2018 at 10:23, Sebastian Dröge wrote :
You can get the rtpsession object from the "internal-session" property
on the rtpsession element.
Is that piece of code correct to associate a callback with the signal?
static gboolean on_sending_rtcp_cb(GstElement *bin, guint sessid, GstBuffer *buffer, gboolean early,
                                   GstElement *what_is_it)
GstElement *rtpbin;
GObject *session;
RTPSession *rtpsession;
...
g_signal_emit_by_name(rtpbin, "get-internal-session", 0, &session);
g_object_get(session, "internal-session", &rtpsession);
g_signal_connect(rtpsession, "on-sending-rtcp", G_CALLBACK(on_sending_rtcp_cb), NULL);
...
Else could you give (me) an example of how to do that?
Best regards
Philippe

--
Philippe Lalevée, Mines Saint-Etienne

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

Re: How to connect on-receiving-rtcp signal in rtpsession?

Philippe Lalevée
Hello,
While awaiting the response of Sebastian, please help me ;-)
because I could not get the rtpsession object from the "internal-session" property on the rtpsession element, I tried to intercept RTCP packets by setting a callback to sinks connected with RTCP streams, using:
gst_pad_add_probe(srcpad, GST_PAD_PROBE_TYPE_BUFFER, (GstPadProbeCallback) rtcp_probe_cb, NULL, NULL);
Is it the same as intercepting "on-{sending|receiving}-rtcp" signals?

Thanks in advance,
Philippe

Le 27/12/2018 à 15:49, Philippe Lalevée a écrit :
Hello,
Thanks Sebastian for your reply.

On 27/12/2018 at 10:23, Sebastian Dröge wrote :
You can get the rtpsession object from the "internal-session" property
on the rtpsession element.
Is that piece of code correct to associate a callback with the signal?
static gboolean on_sending_rtcp_cb(GstElement *bin, guint sessid, GstBuffer *buffer, gboolean early,
                                   GstElement *what_is_it)
GstElement *rtpbin;
GObject *session;
RTPSession *rtpsession;
...
g_signal_emit_by_name(rtpbin, "get-internal-session", 0, &session);
g_object_get(session, "internal-session", &rtpsession);
g_signal_connect(rtpsession, "on-sending-rtcp", G_CALLBACK(on_sending_rtcp_cb), NULL);
...
Else could you give (me) an example of how to do that?
Best regards
Philippe

--
Philippe Lalevée, Mines Saint-Etienne

--
Philippe Lalevée
Directeur du campus GCP - Directeur du CMP
Tél. : 26715 (04 42 61 67 15)

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

Re: How to connect on-receiving-rtcp signal in rtpsession?

Philippe Lalevée
Hello,
I finally managed to connect "on-receiving-rtcp" and "on-sending-rtcp" signals.  The problem was that the files gstrtpsession.h, rtpsession.h, rtpsource.h and rtpstats.h are not present after installation of the package "libgstreamer-plugins-good1.0-dev" under Ubuntu.  I had to install gst-plugins-good-1.14.4 sources to get these files.  I point out that 'make install' of gst-plugins-good does not install them.  Is there another way to do?

On Jan 09, 2016; 3:36am, Steven Presser sent a message titled "Can't get EOS using RTP/RTCP" on this list
(https://lists.freedesktop.org/archives/gstreamer-devel/2016-January/056048.html). As I have the same problem, I would like to know if it has been solved.

Happy New Year to all
Philippe

Le 31/12/2018 à 17:21, Philippe Lalevée a écrit :
Hello,
While awaiting the response of Sebastian, please help me ;-)
because I could not get the rtpsession object from the "internal-session" property on the rtpsession element, I tried to intercept RTCP packets by setting a callback to sinks connected with RTCP streams, using:
gst_pad_add_probe(srcpad, GST_PAD_PROBE_TYPE_BUFFER, (GstPadProbeCallback) rtcp_probe_cb, NULL, NULL);
Is it the same as intercepting "on-{sending|receiving}-rtcp" signals?

Thanks in advance,
Philippe

Le 27/12/2018 à 15:49, Philippe Lalevée a écrit :
Hello,
Thanks Sebastian for your reply.

On 27/12/2018 at 10:23, Sebastian Dröge wrote :
You can get the rtpsession object from the "internal-session" property
on the rtpsession element.
Is that piece of code correct to associate a callback with the signal?
static gboolean on_sending_rtcp_cb(GstElement *bin, guint sessid, GstBuffer *buffer, gboolean early,
                                   GstElement *what_is_it)
GstElement *rtpbin;
GObject *session;
RTPSession *rtpsession;
...
g_signal_emit_by_name(rtpbin, "get-internal-session", 0, &session);
g_object_get(session, "internal-session", &rtpsession);
g_signal_connect(rtpsession, "on-sending-rtcp", G_CALLBACK(on_sending_rtcp_cb), NULL);
...
Else could you give (me) an example of how to do that?
Best regards
Philippe

--
Philippe Lalevée, Mines Saint-Etienne

--
Philippe Lalevée
Directeur du campus GCP - Directeur du CMP
Tél. : 26715 (04 42 61 67 15)

--
Philippe Lalevée
Directeur du campus GCP - Directeur du CMP
Tél. : 26715 (04 42 61 67 15)

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

Re: How to connect on-receiving-rtcp signal in rtpsession?

chakra
Hello,

I have a use case where incoming requests of RTCP for PLI/FIR in webrtcbin
as sender need to passed on upstream and also to create new outgoing RTCP
messages and process incoming RTCP messages. For that as in above discussion
I tried to use 'on-receiving-rtcp' and 'on-sending-rtcp' on RTPSession of
rtpbin

But I am not sure of getting a callback from rtpbin when session is created.
So I tried to use signal 'on-new-ssrc' and pull the session on id as below:

/        GstElement *rtpbin;
        rtpbin = gst_bin_get_by_name(GST_BIN(webrtc1), "rtpbin");
        if (rtpbin) {
            g_signal_connect (rtpbin, "on-new-ssrc",
G_CALLBACK(on_new_ssrc_callback_receiver), webRtcPeerPtr.get());
            g_object_unref(rtpbin);
        }

void on_new_ssrc_callback_receiver(GstElement *rtpbin, guint session, guint
ssrc, gpointer udata) {
    GST_INFO("New SSRC created for session %d as %d ", session, ssrc);
    GObject *sessionRef;
    g_signal_emit_by_name(rtpbin, "get-internal-session", session,
&sessionRef);
    if (sessionRef) {
        GST_INFO("Internal Session found for webrtc recv");
        g_signal_connect(sessionRef, "on-receiving-rtcp",
G_CALLBACK(receiver_on_receiving_rtcp_cb),
                         udata);
        g_signal_connect(sessionRef, "on-sending-rtcp",
G_CALLBACK(receiver_on_sending_rtcp_cb),
                         udata);
    }
}/

Please let me know if this is the right way to get hold of RTPSession from
rtpbin?

If yes, then:

/gboolean receiver_on_sending_rtcp_cb(GstElement *bin, guint sessid,
GstBuffer *buffer, gpointer udata) {
    GST_DEBUG("Triggered on sending receiver RTCP");
    return TRUE;
}

gboolean receiver_on_receiving_rtcp_cb(GstElement *bin, guint sessid,
GstBuffer *buffer, gpointer udata) {
    GST_INFO("Triggered on receiving receiver RTCP");
    gboolean result = gst_rtcp_buffer_validate(buffer);
    GST_INFO("RTCP Buffer valid: %d ", result);
    return TRUE;
}/

Here callbacks are triggered, but the validate is always false and logs
error as below:


/** (server:526): CRITICAL **: 17:47:09.534:
gst_rtcp_buffer_validate_reduced: assertion 'GST_IS_BUFFER (buffer)' failed
0:01:49.838483400   526 0x7fe078003b20 INFO           app_gst
VideoPipelineHandlerImpl.cpp:745:receiver_on_receiving_rtcp_cb: RTCP Buffer
valid: 0
0:01:50.035287700   526 0x7fe078003b20 INFO           app_gst
VideoPipelineHandlerImpl.cpp:743:receiver_on_receiving_rtcp_cb: Triggered on
receiving receiver RTCP

** (server:526): CRITICAL **: 17:47:09.731:
gst_rtcp_buffer_validate_reduced: assertion 'GST_IS_BUFFER (buffer)' failed
0:01:50.035371000   526 0x7fe078003b20 INFO           app_gst
VideoPipelineHandlerImpl.cpp:745:receiver_on_receiving_rtcp_cb: RTCP Buffer
valid: 0
0:01:50.035380800   526 0x7fe078003b20 INFO           app_gst
VideoPipelineHandlerImpl.cpp:743:receiver_on_receiving_rtcp_cb: Triggered on
receiving receiver RTCP/


I tried both methods, gst_rtcp_buffer_validate and
gst_rtcp_buffer_validate_reduced but same results...

Please let me know if this is the right way to consume incoming RTCP
messages if not some suggestions would really help



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel