From: Knut Saastad Date: Wed, 14 Oct 2020 21:17:53 +0000 (+0200) Subject: rtpvp9depay: detect incomplete frames and bail out X-Git-Tag: 1.19.3~509^2~368 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa505867a9a98959f62c195df94719640221f42a;p=platform%2Fupstream%2Fgstreamer.git rtpvp9depay: detect incomplete frames and bail out If a packet with the B bit set arrives but we haven't received a packet with the marker or E bits set to end the previous frame, we know the current frame was incomplete. Part-of: --- diff --git a/gst/rtp/gstrtpvp8depay.c b/gst/rtp/gstrtpvp8depay.c index 396aa75..6fe65a3 100644 --- a/gst/rtp/gstrtpvp8depay.c +++ b/gst/rtp/gstrtpvp8depay.c @@ -238,7 +238,7 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp) guint size = gst_rtp_buffer_get_payload_len (rtp); if (G_UNLIKELY (GST_BUFFER_IS_DISCONT (rtp->buffer))) { - GST_LOG_OBJECT (self, "Discontinuity, flushing adapter"); + GST_DEBUG_OBJECT (self, "Discontinuity, flushing adapter"); gst_adapter_clear (self->adapter); self->started = FALSE; @@ -275,7 +275,7 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp) if ((data[1] & 0x20) != 0 || (data[1] & 0x10) != 0) hdrsize++; } - GST_DEBUG_OBJECT (depay, "hdrsize %u, size %u, picture id 0x%x", hdrsize, + GST_LOG_OBJECT (depay, "hdrsize %u, size %u, picture id 0x%x", hdrsize, size, picture_id); if (G_UNLIKELY (hdrsize >= size)) goto too_small; @@ -293,7 +293,7 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp) goto done; } - GST_DEBUG_OBJECT (depay, "Found the start of the frame"); + GST_LOG_OBJECT (depay, "Found the start of the frame"); if (self->stop_lost_events) { send_last_lost_event_if_needed (self, picture_id); @@ -312,7 +312,7 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp) GstBuffer *out; guint8 header[10]; - GST_DEBUG_OBJECT (depay, + GST_LOG_OBJECT (depay, "Found the end of the frame (%" G_GSIZE_FORMAT " bytes)", gst_adapter_available (self->adapter)); if (gst_adapter_available (self->adapter) < 10) @@ -343,6 +343,7 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp) guint profile, width, height; GST_BUFFER_FLAG_UNSET (out, GST_BUFFER_FLAG_DELTA_UNIT); + GST_DEBUG_OBJECT (self, "Processed keyframe"); profile = (header[0] & 0x0e) >> 1; width = GST_READ_UINT16_LE (header + 6) & 0x3fff; @@ -379,7 +380,7 @@ done: return NULL; too_small: - GST_LOG_OBJECT (self, "Invalid rtp packet (too small), ignoring"); + GST_DEBUG_OBJECT (self, "Invalid rtp packet (too small), ignoring"); gst_adapter_clear (self->adapter); self->started = FALSE; diff --git a/gst/rtp/gstrtpvp8pay.c b/gst/rtp/gstrtpvp8pay.c index 56edb53..717eaea 100644 --- a/gst/rtp/gstrtpvp8pay.c +++ b/gst/rtp/gstrtpvp8pay.c @@ -402,6 +402,10 @@ gst_rtp_vp8_pay_parse_frame (GstRtpVP8Pay * self, GstBuffer * buffer, self->partition_offset[i + 1] = size; gst_buffer_unmap (buffer, &map); + + if (keyframe) + GST_DEBUG_OBJECT (self, "Parsed keyframe"); + return TRUE; error: