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

Unified Diff: webrtc/modules/audio_coding/test/APITest.cc

Issue 1853183002: Change NetEq::GetPlayoutTimestamp to return an rtc::Optional<uint32_t> (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding back the old PlayoutTimestamp method, now DEPRECATED Created 4 years, 8 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: webrtc/modules/audio_coding/test/APITest.cc
diff --git a/webrtc/modules/audio_coding/test/APITest.cc b/webrtc/modules/audio_coding/test/APITest.cc
index bf04d7c8252f0ed95264ceee19aa5849404549d3..a2506ba01139aad63728ff40c8b39634ce17f4ff 100644
--- a/webrtc/modules/audio_coding/test/APITest.cc
+++ b/webrtc/modules/audio_coding/test/APITest.cc
@@ -666,7 +666,6 @@ void APITest::TestDelay(char side) {
EventTimerWrapper* myEvent = EventTimerWrapper::Create();
uint32_t inTimestamp = 0;
- uint32_t outTimestamp = 0;
double estimDelay = 0;
double averageEstimDelay = 0;
@@ -688,7 +687,8 @@ void APITest::TestDelay(char side) {
CHECK_ERROR_MT(myACM->SetMinimumPlayoutDelay(*myMinDelay));
inTimestamp = myChannel->LastInTimestamp();
- CHECK_ERROR_MT(myACM->PlayoutTimestamp(&outTimestamp));
+ rtc::Optional<uint32_t> outTimestamp = myACM->PlayoutTimestamp();
+ CHECK_ERROR_MT(outTimestamp ? 0 : -1);
if (!_randomTest) {
myEvent->StartTimer(true, 30);
@@ -698,11 +698,12 @@ void APITest::TestDelay(char side) {
myEvent->Wait(1000);
inTimestamp = myChannel->LastInTimestamp();
- CHECK_ERROR_MT(myACM->PlayoutTimestamp(&outTimestamp));
+ outTimestamp = myACM->PlayoutTimestamp();
+ CHECK_ERROR_MT(outTimestamp ? 0 : -1);
//std::cout << outTimestamp << std::endl << std::flush;
- estimDelay = (double) ((uint32_t)(inTimestamp - outTimestamp))
- / ((double) myACM->ReceiveFrequency() / 1000.0);
+ estimDelay = (double)((uint32_t)(inTimestamp - *outTimestamp)) /
+ ((double)myACM->ReceiveFrequency() / 1000.0);
estimDelayCB.Update(estimDelay);

Powered by Google App Engine
This is Rietveld 408576698