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

chakra wire.chakri at gmail.com
Mon May 4 15:17:46 UTC 2020


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/


More information about the gstreamer-devel mailing list