* because we stop sending. */
ret = gst_pad_push_event (rtpsession->send_rtp_src, event);
current_time = gst_clock_get_time (rtpsession->priv->sysclock);
+
GST_DEBUG_OBJECT (rtpsession, "scheduling BYE message");
rtp_session_mark_all_bye (rtpsession->priv->session, "End Of Stream");
rtp_session_schedule_bye (rtpsession->priv->session, current_time);
priv = rtpsession->priv;
- ssrc = rtp_session_get_internal_ssrc (priv->session);
+ ssrc = rtp_session_suggest_ssrc (priv->session);
/* we can basically accept anything but we prefer to receive packets with our
* internal SSRC so that we don't have to patch it. Create a structure with
sess->total_sources++;
if (RTP_SOURCE_IS_ACTIVE (src))
sess->stats.active_sources++;
- if (src->internal)
+ if (src->internal) {
sess->stats.internal_sources++;
+ if (sess->suggested_ssrc != src->ssrc)
+ sess->suggested_ssrc = src->ssrc;
+ }
}
/* must be called with the session lock, the returned source needs to be
}
/**
+ * rtp_session_suggest_ssrc:
+ * @sess: a #RTPSession
+ *
+ * Suggest an unused SSRC in @sess.
+ *
+ * Returns: a free unused SSRC
+ */
+guint32
+rtp_session_suggest_ssrc (RTPSession * sess)
+{
+ guint32 result;
+
+ g_return_val_if_fail (RTP_IS_SESSION (sess), 0);
+
+ RTP_SESSION_LOCK (sess);
+ result = sess->suggested_ssrc;
+ RTP_SESSION_UNLOCK (sess);
+
+ return result;
+}
+
+/**
* rtp_session_add_source:
* @sess: a #RTPSession
* @src: #RTPSource to add
guint rtcp_rs_bandwidth;
RTPSource *source;
+ guint32 suggested_ssrc;
/* for sender/receiver counting */
guint32 key;
void rtp_session_set_internal_ssrc (RTPSession *sess, guint32 ssrc);
guint32 rtp_session_get_internal_ssrc (RTPSession *sess);
+guint32 rtp_session_suggest_ssrc (RTPSession *sess);
gboolean rtp_session_add_source (RTPSession *sess, RTPSource *src);
guint rtp_session_get_num_sources (RTPSession *sess);