mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
rtpsession: Remember the corresponding media SSRC for RTX sources
This allows timing out the RTX source and sending BYE for it when the actual media source belonging to it is timed out. This change only applies to sending sources from this session. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/360 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3112>
This commit is contained in:
parent
d5c072fadd
commit
72b6dabd32
3 changed files with 23 additions and 2 deletions
|
@ -4167,7 +4167,8 @@ session_cleanup (const gchar * key, RTPSource * source, ReportData * data)
|
|||
/* this is an internal source that is not using our suggested ssrc.
|
||||
* since there must be another source using this ssrc, we can remove
|
||||
* this one instead of making it a receiver forever */
|
||||
if (source->ssrc != sess->suggested_ssrc) {
|
||||
if (source->ssrc != sess->suggested_ssrc
|
||||
&& source->media_ssrc != sess->suggested_ssrc) {
|
||||
rtp_source_mark_bye (source, "timed out");
|
||||
/* do not schedule bye here, since we are inside the RTCP timeout
|
||||
* processing and scheduling bye will interfere with SR/RR sending */
|
||||
|
|
|
@ -825,6 +825,7 @@ rtp_source_update_send_caps (RTPSource * src, GstCaps * caps)
|
|||
GstStructure *s;
|
||||
guint val;
|
||||
gint ival;
|
||||
guint ssrc, rtx_ssrc = -1;
|
||||
gboolean rtx;
|
||||
|
||||
/* nothing changed, return */
|
||||
|
@ -833,7 +834,17 @@ rtp_source_update_send_caps (RTPSource * src, GstCaps * caps)
|
|||
|
||||
s = gst_caps_get_structure (caps, 0);
|
||||
|
||||
rtx = (gst_structure_get_uint (s, "rtx-ssrc", &val) && val == src->ssrc);
|
||||
if (!gst_structure_get_uint (s, "ssrc", &ssrc))
|
||||
return;
|
||||
gst_structure_get_uint (s, "rtx-ssrc", &rtx_ssrc);
|
||||
|
||||
if (src->ssrc != ssrc && src->ssrc != rtx_ssrc) {
|
||||
GST_WARNING ("got ssrc %u/%u that doesn't match with this source's ssrc %u",
|
||||
ssrc, rtx_ssrc, src->ssrc);
|
||||
return;
|
||||
}
|
||||
|
||||
rtx = (rtx_ssrc == src->ssrc);
|
||||
|
||||
if (gst_structure_get_int (s, rtx ? "rtx-payload" : "payload", &ival))
|
||||
src->payload = ival;
|
||||
|
@ -859,6 +870,12 @@ rtp_source_update_send_caps (RTPSource * src, GstCaps * caps)
|
|||
src->seqnum_offset);
|
||||
|
||||
gst_caps_replace (&src->send_caps, caps);
|
||||
|
||||
if (rtx) {
|
||||
src->media_ssrc = ssrc;
|
||||
} else {
|
||||
src->media_ssrc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -137,6 +137,9 @@ struct _RTPSource {
|
|||
/*< private >*/
|
||||
guint32 ssrc;
|
||||
|
||||
/* If not -1 then this is the SSRC of the corresponding media RTPSource */
|
||||
guint32 media_ssrc;
|
||||
|
||||
guint16 generation;
|
||||
GHashTable *reported_in_sr_of; /* set of SSRCs */
|
||||
|
||||
|
|
Loading…
Reference in a new issue