Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2658)

Unified Diff: content/renderer/media/gpu/rtc_video_decoder.cc

Issue 2093823002: Consider non-keyframes for RTCVideoEncoder error counter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mcasas@ comments. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/gpu/rtc_video_decoder.cc
diff --git a/content/renderer/media/gpu/rtc_video_decoder.cc b/content/renderer/media/gpu/rtc_video_decoder.cc
index 51830b2938b1c1117a81a80cabaf168ea2fb57a2..1729882ab0d39d22e4cd45109d66b36396b351b6 100644
--- a/content/renderer/media/gpu/rtc_video_decoder.cc
+++ b/content/renderer/media/gpu/rtc_video_decoder.cc
@@ -236,6 +236,10 @@ int32_t RTCVideoDecoder::Decode(
reset_bitstream_buffer_id_)) {
// TODO(wuchengli): VDA should handle it. Remove this when
// http://crosbug.com/p/21913 is fixed.
+
+ // If we're are in an error condition, increase the counter.
+ vda_error_counter_ += vda_error_counter_ ? 1 : 0;
+
DVLOG(1) << "The first frame should be a key frame. Drop this.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
@@ -269,8 +273,6 @@ int32_t RTCVideoDecoder::Decode(
base::AutoUnlock auto_unlock(lock_);
Release();
}
-
- TryResetVDAErrorCounter_Locked();
return WEBRTC_VIDEO_CODEC_OK;
}
@@ -279,7 +281,6 @@ int32_t RTCVideoDecoder::Decode(
FROM_HERE,
base::Bind(&RTCVideoDecoder::RequestBufferDecode,
weak_factory_.GetWeakPtr()));
- TryResetVDAErrorCounter_Locked();
return WEBRTC_VIDEO_CODEC_OK;
}
@@ -443,6 +444,8 @@ void RTCVideoDecoder::PictureReady(const media::Picture& picture) {
reset_bitstream_buffer_id_)) {
decode_complete_callback_->Decoded(decoded_image);
}
+ // Reset error counter as we successfully decoded a frame.
+ vda_error_counter_ = 0;
}
}
@@ -889,12 +892,4 @@ void RTCVideoDecoder::ClearPendingBuffers() {
pending_buffers_.clear();
}
-void RTCVideoDecoder::TryResetVDAErrorCounter_Locked() {
- lock_.AssertAcquired();
-
- if (vda_error_counter_ == 0)
- return;
- vda_error_counter_ = 0;
-}
-
} // namespace content
« no previous file with comments | « content/renderer/media/gpu/rtc_video_decoder.h ('k') | content/renderer/media/gpu/rtc_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698