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

Unified Diff: content/renderer/media/gpu/rtc_video_decoder_unittest.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
« no previous file with comments | « content/renderer/media/gpu/rtc_video_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/gpu/rtc_video_decoder_unittest.cc
diff --git a/content/renderer/media/gpu/rtc_video_decoder_unittest.cc b/content/renderer/media/gpu/rtc_video_decoder_unittest.cc
index 1b9261aab1f0717062a4a5fbcf14ee46e0114cde..151e8fcb285357374854cc834e384f08a1c02c9f 100644
--- a/content/renderer/media/gpu/rtc_video_decoder_unittest.cc
+++ b/content/renderer/media/gpu/rtc_video_decoder_unittest.cc
@@ -282,7 +282,8 @@ TEST_F(RTCVideoDecoderTest, IsFirstBufferAfterReset) {
rtc_decoder_->IsFirstBufferAfterReset(1, RTCVideoDecoder::ID_LAST));
}
-
+// Tests/Verifies that |rtc_encoder_| drops incoming frames and its error
+// counter is increased when in an error condition.
TEST_P(RTCVideoDecoderTest, GetVDAErrorCounterForTesting) {
const webrtc::VideoCodecType codec_type = GetParam();
CreateDecoder(codec_type);
@@ -293,6 +294,7 @@ TEST_P(RTCVideoDecoderTest, GetVDAErrorCounterForTesting) {
input_image._encodedWidth = kMinResolutionWidth;
input_image._encodedHeight = kMaxResolutionHeight;
input_image._frameType = webrtc::kVideoFrameDelta;
+ input_image._length = kMinResolutionWidth * kMaxResolutionHeight;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR,
rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0));
RunUntilIdle();
@@ -308,16 +310,11 @@ TEST_P(RTCVideoDecoderTest, GetVDAErrorCounterForTesting) {
rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0));
EXPECT_EQ(1, rtc_decoder_->GetVDAErrorCounterForTesting());
- // Decoder expects a keyframe after reset, so drops any other frames.
+ // Decoder expects a keyframe after reset, so drops any other frames. However,
+ // we should still increment the error counter.
EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR,
rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0));
- EXPECT_EQ(1, rtc_decoder_->GetVDAErrorCounterForTesting());
-
- // Decoder resets error counter after a successfull decode.
- input_image._frameType = webrtc::kVideoFrameKey;
- EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
- rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 10));
- EXPECT_EQ(0, rtc_decoder_->GetVDAErrorCounterForTesting());
+ EXPECT_EQ(2, rtc_decoder_->GetVDAErrorCounterForTesting());
}
INSTANTIATE_TEST_CASE_P(CodecProfiles,
« no previous file with comments | « content/renderer/media/gpu/rtc_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698