From 7067d01d2a9e46a52f347cfa777e5a50f1d41494 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 20 Sep 2007 14:34:57 +0000 Subject: gst/rtpmanager/: Add notification of active SSRCs to various RTP elements. Fixes #478566. Original commit message from CVS: * gst/rtpmanager/gstrtpbin.c: (on_ssrc_active), (create_session), (gst_rtp_bin_class_init): * gst/rtpmanager/gstrtpbin.h: * gst/rtpmanager/gstrtpsession.c: (on_ssrc_active), (gst_rtp_session_class_init), (gst_rtp_session_init), (gst_rtp_session_event_send_rtp_sink): * gst/rtpmanager/gstrtpsession.h: * gst/rtpmanager/rtpsession.c: (rtp_session_class_init), (on_ssrc_active), (rtp_session_process_rb): * gst/rtpmanager/rtpsession.h: Add notification of active SSRCs to various RTP elements. Fixes #478566. --- gst/rtpmanager/rtpsession.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'gst/rtpmanager/rtpsession.c') diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index fa9b84db..0f907efd 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -36,6 +36,7 @@ enum SIGNAL_ON_NEW_SSRC, SIGNAL_ON_SSRC_COLLISION, SIGNAL_ON_SSRC_VALIDATED, + SIGNAL_ON_SSRC_ACTIVE, SIGNAL_ON_BYE_SSRC, SIGNAL_ON_BYE_TIMEOUT, SIGNAL_ON_TIMEOUT, @@ -119,6 +120,18 @@ rtp_session_class_init (RTPSessionClass * klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_ssrc_validated), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); + /** + * RTPSession::on-ssrc_active: + * @session: the object which received the signal + * @src: the active RTPSource + * + * Notify of a SSRC that is active, i.e., sending RTCP. + */ + rtp_session_signals[SIGNAL_ON_SSRC_ACTIVE] = + g_signal_new ("on-ssrc-active", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_ssrc_active), + NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, + G_TYPE_OBJECT); /** * RTPSession::on-bye-ssrc: * @session: the object which received the signal @@ -281,6 +294,14 @@ on_ssrc_validated (RTPSession * sess, RTPSource * source) RTP_SESSION_LOCK (sess); } +static void +on_ssrc_active (RTPSession * sess, RTPSource * source) +{ + RTP_SESSION_UNLOCK (sess); + g_signal_emit (sess, rtp_session_signals[SIGNAL_ON_SSRC_ACTIVE], 0, source); + RTP_SESSION_LOCK (sess); +} + static void on_bye_ssrc (RTPSession * sess, RTPSource * source) { @@ -1080,6 +1101,8 @@ rtp_session_process_rb (RTPSession * sess, RTPSource * source, * the other sender to see if we are better or worse. */ rtp_source_process_rb (source, arrival->time, fractionlost, packetslost, exthighestseq, jitter, lsr, dlsr); + + on_ssrc_active (sess, source); } } } -- cgit v1.2.1