From cbc676119957c12635e8798fc29a420a09eff88e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 26 Aug 2022 18:42:44 +0300 Subject: [PATCH] rtpvp8depay: If configured to wait for keyframes after packet loss, also do that if incomplete frames are detected This can happen if the data inside the packets is incomplete without the seqnums being discontinuous because of ULPFEC being used. Part-of: --- subprojects/gst-plugins-good/gst/rtp/gstrtpvp8depay.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/rtp/gstrtpvp8depay.c b/subprojects/gst-plugins-good/gst/rtp/gstrtpvp8depay.c index 99d7554..3428f43 100644 --- a/subprojects/gst-plugins-good/gst/rtp/gstrtpvp8depay.c +++ b/subprojects/gst-plugins-good/gst/rtp/gstrtpvp8depay.c @@ -354,6 +354,13 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp) gst_adapter_clear (self->adapter); self->started = FALSE; + if (self->wait_for_keyframe) + self->waiting_for_keyframe = TRUE; + if (self->request_keyframe) + gst_pad_push_event (GST_RTP_BASE_DEPAYLOAD_SINKPAD (depay), + gst_video_event_new_upstream_force_key_unit (GST_CLOCK_TIME_NONE, + TRUE, 0)); + send_new_lost_event (self, GST_BUFFER_PTS (rtp->buffer), picture_id, "Incomplete frame detected"); sent_lost_event = TRUE; @@ -368,6 +375,14 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp) send_last_lost_event (self); self->stop_lost_events = FALSE; } + + if (self->wait_for_keyframe) + self->waiting_for_keyframe = TRUE; + if (self->request_keyframe) + gst_pad_push_event (GST_RTP_BASE_DEPAYLOAD_SINKPAD (depay), + gst_video_event_new_upstream_force_key_unit (GST_CLOCK_TIME_NONE, + TRUE, 0)); + goto done; } -- 2.7.4