From 77511b156e1dbc45c7dd0f24bb2832c9145fd535 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 30 Jan 2015 16:50:36 +0100 Subject: [PATCH] rtpsession: Add new on-receiving-rtcp signal This will be emitted whenever an RTCP packet is received. Different to on-feedback-rtcp, this signal gets every complete RTCP packet and not just the individual feedback packets. --- gst/rtpmanager/rtpsession.c | 20 ++++++++++++++++++++ gst/rtpmanager/rtpsession.h | 1 + 2 files changed, 21 insertions(+) diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index d5af155cca..cdcd686a01 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -50,6 +50,7 @@ enum SIGNAL_ON_FEEDBACK_RTCP, SIGNAL_SEND_RTCP, SIGNAL_SEND_RTCP_FULL, + SIGNAL_ON_RECEIVING_RTCP, LAST_SIGNAL }; @@ -340,6 +341,22 @@ rtp_session_class_init (RTPSessionClass * klass) G_STRUCT_OFFSET (RTPSessionClass, send_rtcp), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, 1, G_TYPE_UINT64); + /** + * RTPSession::on-receiving-rtcp + * @session: the object which received the signal + * @buffer: the #GstBuffer containing the RTCP packet that was received + * + * This signal is emitted when receiving an RTCP packet before it is handled + * by the session. It can be used to extract custom information from RTCP packets. + * + * Since: 1.6 + */ + rtp_session_signals[SIGNAL_ON_RECEIVING_RTCP] = + g_signal_new ("on-sending-rtcp", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_receiving_rtcp), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, + GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE); + g_object_class_install_property (gobject_class, PROP_INTERNAL_SSRC, g_param_spec_uint ("internal-ssrc", "Internal SSRC", "The internal SSRC used for the session (deprecated)", @@ -2560,6 +2577,9 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer, GST_DEBUG ("received RTCP packet"); + g_signal_emit (sess, rtp_session_signals[SIGNAL_ON_RECEIVING_RTCP], 0, + buffer); + RTP_SESSION_LOCK (sess); /* update pinfo stats */ update_packet_info (sess, &pinfo, FALSE, FALSE, FALSE, buffer, current_time, diff --git a/gst/rtpmanager/rtpsession.h b/gst/rtpmanager/rtpsession.h index 11763ac3ca..3f565a601f 100644 --- a/gst/rtpmanager/rtpsession.h +++ b/gst/rtpmanager/rtpsession.h @@ -302,6 +302,7 @@ struct _RTPSessionClass { void (*on_feedback_rtcp) (RTPSession *sess, guint type, guint fbtype, guint sender_ssrc, guint media_ssrc, GstBuffer *fci); gboolean (*send_rtcp) (RTPSession *sess, GstClockTime max_delay); + void (*on_receiving_rtcp) (RTPSession *sess, GstBuffer *buffer); }; GType rtp_session_get_type (void); -- 2.34.1