Continuously request keyframes if decoding does not recover.

This is a workaround until downstream projects have been fixed.

BUG=webrtc:8220

Review-Url: https://codereview.webrtc.org/3017613002
Cr-Commit-Position: refs/heads/master@{#19966}
This commit is contained in:
philipel
2017-09-26 02:54:58 -07:00
committed by Commit Bot
parent 3b3622fafc
commit 48462b6ef7
2 changed files with 6 additions and 1 deletions

View File

@ -416,16 +416,19 @@ bool VideoReceiveStream::Decode() {
}
if (frame) {
int64_t now_ms = clock_->TimeInMilliseconds();
RTC_DCHECK_EQ(res, video_coding::FrameBuffer::ReturnReason::kFrameFound);
if (video_receiver_.Decode(frame.get()) == VCM_OK) {
keyframe_required_ = false;
frame_decoded_ = true;
rtp_video_stream_receiver_.FrameDecoded(frame->picture_id);
} else if (!keyframe_required_ || !frame_decoded_) {
} else if (!frame_decoded_ || !keyframe_required_ ||
(last_keyframe_request_ms_ + kMaxWaitForKeyFrameMs < now_ms)) {
keyframe_required_ = true;
// TODO(philipel): Remove this keyframe request when downstream project
// has been fixed.
RequestKeyFrame();
last_keyframe_request_ms_ = now_ms;
}
} else {
RTC_DCHECK_EQ(res, video_coding::FrameBuffer::ReturnReason::kTimeout);

View File

@ -159,6 +159,8 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream,
// If we have successfully decoded any frame.
bool frame_decoded_ = false;
int64_t last_keyframe_request_ms_ = 0;
};
} // namespace internal
} // namespace webrtc