mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-04 15:36:35 +00:00
rtph264pay: add "send SPS/PPS with every key frame" mode
It's not enough to have timeout or event based SPS/PPS information sent in RTP packets. There are some scenarios when key frames may appear more frequently than once a second, in which case the minimum timeout for "config-interval" of 1 second for sending SPS/PPS is not sufficient. It might also be desirable in general to make sure the SPS/PPS is available with every keyframe (packet loss aside), so receivers can actually pick up decoding immediately from the first keyframe if SPS/PPS is not signaled out of band. This patch adds the possibility to send SPS/PPS with every key frame. This mode can be enabled by setting "config-interval" property to -1. In this case the payloader will add SPS and PPS before every key (IDR) frame. https://bugzilla.gnome.org/show_bug.cgi?id=757892
This commit is contained in:
parent
3026d1094b
commit
453a618a9d
1 changed files with 6 additions and 1 deletions
|
@ -127,7 +127,8 @@ gst_rtp_h264_pay_class_init (GstRtpH264PayClass * klass)
|
||||||
g_param_spec_int ("config-interval",
|
g_param_spec_int ("config-interval",
|
||||||
"SPS PPS Send Interval",
|
"SPS PPS Send Interval",
|
||||||
"Send SPS and PPS Insertion Interval in seconds (sprop parameter sets "
|
"Send SPS and PPS Insertion Interval in seconds (sprop parameter sets "
|
||||||
"will be multiplexed in the data stream when detected.) (0 = disabled)",
|
"will be multiplexed in the data stream when detected.) "
|
||||||
|
"(0 = disabled, -1 = send with every IDR frame)",
|
||||||
-1, 3600, DEFAULT_CONFIG_INTERVAL,
|
-1, 3600, DEFAULT_CONFIG_INTERVAL,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
||||||
);
|
);
|
||||||
|
@ -829,6 +830,10 @@ gst_rtp_h264_pay_payload_nal (GstRTPBasePayload * basepayload,
|
||||||
GST_DEBUG_OBJECT (rtph264pay, "no previous SPS/PPS time, send now");
|
GST_DEBUG_OBJECT (rtph264pay, "no previous SPS/PPS time, send now");
|
||||||
send_spspps = TRUE;
|
send_spspps = TRUE;
|
||||||
}
|
}
|
||||||
|
} else if (nalType == IDR_TYPE_ID && rtph264pay->spspps_interval == -1) {
|
||||||
|
GST_DEBUG_OBJECT (rtph264pay, "sending SPS/PPS before current IDR frame");
|
||||||
|
/* send SPS/PPS before every IDR frame */
|
||||||
|
send_spspps = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send_spspps || rtph264pay->send_spspps) {
|
if (send_spspps || rtph264pay->send_spspps) {
|
||||||
|
|
Loading…
Reference in a new issue