From 0093a38f7c4d0e5be726732e7e0bf029595e2f27 Mon Sep 17 00:00:00 2001 From: Johannes Kron Date: Tue, 23 Feb 2021 22:59:40 +0100 Subject: [PATCH] Fix low-latency renderer with unset playout delays The low-latency renderer is activated by the RTP header extension playout-delay if the min value is set to 0 and the max value is set to something greater than 0. According to the specification of the playout-delay header extension it doesn't have to be set for every frame but only if it is changed. The bug that this CL fixes occured if a playout delay had been set previously but some frames without any specified playout-delay were received. In this case max composition delay would not be set and the low-latency renderer algorithm would be disabled for the rest of the session. Bug: chromium:1138888 Change-Id: I12d10715fd5ec29f6ee78296ddfe975d7edab8a9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208581 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Johannes Kron Cr-Commit-Position: refs/heads/master@{#33330} --- modules/video_coding/generic_decoder.cc | 4 +--- modules/video_coding/generic_decoder.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/video_coding/generic_decoder.cc b/modules/video_coding/generic_decoder.cc index 28c97f08f5..3d48a3e9b4 100644 --- a/modules/video_coding/generic_decoder.cc +++ b/modules/video_coding/generic_decoder.cc @@ -110,8 +110,7 @@ void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, decodedImage.set_packet_infos(frameInfo->packet_infos); decodedImage.set_rotation(frameInfo->rotation); - if (low_latency_renderer_enabled_ && frameInfo->playout_delay.min_ms == 0 && - frameInfo->playout_delay.max_ms > 0) { + if (low_latency_renderer_enabled_) { absl::optional max_composition_delay_in_frames = _timing->MaxCompositionDelayInFrames(); if (max_composition_delay_in_frames) { @@ -253,7 +252,6 @@ int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, Timestamp now) { _frameInfos[_nextFrameInfoIdx].decodeStart = now; _frameInfos[_nextFrameInfoIdx].renderTimeMs = frame.RenderTimeMs(); _frameInfos[_nextFrameInfoIdx].rotation = frame.rotation(); - _frameInfos[_nextFrameInfoIdx].playout_delay = frame.PlayoutDelay(); _frameInfos[_nextFrameInfoIdx].timing = frame.video_timing(); _frameInfos[_nextFrameInfoIdx].ntp_time_ms = frame.EncodedImage().ntp_time_ms_; diff --git a/modules/video_coding/generic_decoder.h b/modules/video_coding/generic_decoder.h index ea9f1149d9..b5953239f6 100644 --- a/modules/video_coding/generic_decoder.h +++ b/modules/video_coding/generic_decoder.h @@ -35,7 +35,6 @@ struct VCMFrameInformation { void* userData; VideoRotation rotation; VideoContentType content_type; - PlayoutDelay playout_delay; EncodedImage::Timing timing; int64_t ntp_time_ms; RtpPacketInfos packet_infos;