mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
videodecoder: Use a frame duration for QoS
We prefer to use the frame stop position for checking for QoS since we don't want to drop a frame which is only partially late. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6689>
This commit is contained in:
parent
a7d0b07406
commit
2aba1c86e9
1 changed files with 9 additions and 5 deletions
|
@ -3652,11 +3652,15 @@ gst_video_decoder_clip_and_push_buf (GstVideoDecoder * decoder, GstBuffer * buf)
|
|||
goto done;
|
||||
}
|
||||
|
||||
/* Is buffer too late (QoS) ? */
|
||||
if (priv->do_qos && GST_CLOCK_TIME_IS_VALID (priv->earliest_time)
|
||||
&& GST_CLOCK_TIME_IS_VALID (cstart)) {
|
||||
GstClockTime deadline =
|
||||
gst_segment_to_running_time (segment, GST_FORMAT_TIME, cstart);
|
||||
/* Check if the buffer is too late (QoS). */
|
||||
if (priv->do_qos && GST_CLOCK_TIME_IS_VALID (priv->earliest_time)) {
|
||||
GstClockTime deadline = GST_CLOCK_TIME_NONE;
|
||||
/* We prefer to use the frame stop position for checking for QoS since we
|
||||
* don't want to drop a frame which is partially late */
|
||||
if (GST_CLOCK_TIME_IS_VALID (cstop))
|
||||
deadline = gst_segment_to_running_time (segment, GST_FORMAT_TIME, cstop);
|
||||
else if (GST_CLOCK_TIME_IS_VALID (cstart))
|
||||
deadline = gst_segment_to_running_time (segment, GST_FORMAT_TIME, cstart);
|
||||
if (GST_CLOCK_TIME_IS_VALID (deadline) && deadline < priv->earliest_time) {
|
||||
GST_WARNING_OBJECT (decoder,
|
||||
"Dropping frame due to QoS. start:%" GST_TIME_FORMAT " deadline:%"
|
||||
|
|
Loading…
Reference in a new issue