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.
This commit is contained in:
Sebastian Dröge 2015-01-30 16:50:36 +01:00
parent 9a9d4eccea
commit 77511b156e
2 changed files with 21 additions and 0 deletions

View file

@ -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,

View file

@ -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);