mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
gstrtpsession: Fallback for FIR to PLI if PLI isn't available
This commit is contained in:
parent
52f95fa7ee
commit
7350d2adfa
1 changed files with 19 additions and 6 deletions
|
@ -1383,22 +1383,35 @@ gst_rtp_session_request_remote_key_unit (GstRtpSession * rtpsession,
|
||||||
gboolean fir, pli;
|
gboolean fir, pli;
|
||||||
const GstStructure *s = gst_caps_get_structure (caps, 0);
|
const GstStructure *s = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
if (all_headers &&
|
if (!gst_structure_get_boolean (s, "rtcp-fb-nack-fir", &fir))
|
||||||
gst_structure_get_boolean (s, "rtcp-fb-nack-fir", &fir) && fir) {
|
fir = FALSE;
|
||||||
/* 500 ms acceptable delay for FIR request is a guesstimate, it could
|
|
||||||
|
if (!gst_structure_get_boolean (s, "rtcp-fb-nack-pli", &pli))
|
||||||
|
pli = FALSE;
|
||||||
|
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
|
if (!pli && !fir)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
/* When we need all headers, use FIR if possible falling back to PLI if
|
||||||
|
* it's available */
|
||||||
|
if (all_headers) {
|
||||||
|
/* 500 ms acceptable delay for urgent request is a guesstimate, it could
|
||||||
* be made configurable if needed
|
* be made configurable if needed
|
||||||
*/
|
*/
|
||||||
|
/* If we don't have fir, fall back to pli */
|
||||||
|
rtp_session_request_key_unit (rtpsession->priv->session, ssrc, fir);
|
||||||
rtp_session_request_early_rtcp (rtpsession->priv->session,
|
rtp_session_request_early_rtcp (rtpsession->priv->session,
|
||||||
gst_clock_get_time (rtpsession->priv->sysclock), 500 * GST_MSECOND);
|
gst_clock_get_time (rtpsession->priv->sysclock), 500 * GST_MSECOND);
|
||||||
rtp_session_request_key_unit (rtpsession->priv->session, ssrc, TRUE);
|
|
||||||
requested = TRUE;
|
requested = TRUE;
|
||||||
} else if (gst_structure_get_boolean (s, "rtcp-fb-nack-pli", &pli) && pli) {
|
} else if (pli) {
|
||||||
rtp_session_request_key_unit (rtpsession->priv->session, ssrc, FALSE);
|
rtp_session_request_key_unit (rtpsession->priv->session, ssrc, FALSE);
|
||||||
requested = TRUE;
|
requested = TRUE;
|
||||||
}
|
}
|
||||||
gst_caps_unref (caps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
return requested;
|
return requested;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue