Wire up VCMTiming in FrameBuffer2.
The VCMTiming class is now used to set the render time for frames.
BUG=webrtc:5514
R=stefan@webrtc.org
Review URL: https://codereview.webrtc.org/2138873003 .
Cr-Commit-Position: refs/heads/master@{#13621}
diff --git a/webrtc/modules/video_coding/frame_buffer2_unittest.cc b/webrtc/modules/video_coding/frame_buffer2_unittest.cc
index 5c81d02..674ae29 100644
--- a/webrtc/modules/video_coding/frame_buffer2_unittest.cc
+++ b/webrtc/modules/video_coding/frame_buffer2_unittest.cc
@@ -70,6 +70,7 @@
void(int64_t frameDelayMs,
uint32_t frameSizeBytes,
bool incompleteFrame));
+ MOCK_METHOD1(GetJitterEstimate, int(double rttMultiplier));
};
class FrameObjectFake : public FrameObject {
@@ -178,7 +179,7 @@
SimulatedClock clock_;
VCMTimingFake timing_;
- VCMJitterEstimatorMock jitter_estimator_;
+ ::testing::NiceMock<VCMJitterEstimatorMock> jitter_estimator_;
FrameBuffer buffer_;
std::vector<std::unique_ptr<FrameObject>> frames_;
Random rand_;
@@ -336,5 +337,19 @@
CheckNoFrame(2);
}
+TEST_F(TestFrameBuffer2, ProtectionMode) {
+ uint16_t pid = Rand();
+ uint32_t ts = Rand();
+
+ EXPECT_CALL(jitter_estimator_, GetJitterEstimate(1.0));
+ InsertFrame(pid, 0, ts, false);
+ ExtractFrame();
+
+ buffer_.SetProtectionMode(kProtectionNackFEC);
+ EXPECT_CALL(jitter_estimator_, GetJitterEstimate(0.0));
+ InsertFrame(pid + 1, 0, ts, false);
+ ExtractFrame();
+}
+
} // namespace video_coding
} // namespace webrtc