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

Unified Diff: webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc

Issue 1467183002: Add new method AcmReceiver::last_packet_sample_rate_hz() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@neteq-last-output-rate
Patch Set: Updates after second review Created 5 years, 1 month 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/main/acm2/acm_receiver_unittest_oldapi.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc
index 3bda1168d42afdcfc3e58d88207cf072d6e053be..8f43ac456a2dd449159d055a953914f133d658b6 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc
@@ -330,7 +330,7 @@ TEST_F(AcmReceiverTestOldApi,
// Has received, only, DTX. Last Audio codec is undefined.
EXPECT_EQ(-1, receiver_->LastAudioCodec(&codec));
- EXPECT_EQ(-1, receiver_->last_audio_codec_id());
+ EXPECT_FALSE(receiver_->last_packet_sample_rate_hz());
for (auto id : kCodecId) {
const CodecIdInst c(id);
@@ -344,7 +344,8 @@ TEST_F(AcmReceiverTestOldApi,
// of type "speech."
ASSERT_TRUE(packet_sent_);
ASSERT_EQ(kAudioFrameSpeech, last_frame_type_);
- EXPECT_EQ(c.id, receiver_->last_audio_codec_id());
+ EXPECT_EQ(rtc::Optional<int>(c.inst.plfreq),
+ receiver_->last_packet_sample_rate_hz());
// Set VAD on to send DTX. Then check if the "Last Audio codec" returns
// the expected codec.
@@ -356,7 +357,8 @@ TEST_F(AcmReceiverTestOldApi,
InsertOnePacketOfSilence(c.id);
ASSERT_TRUE(packet_sent_);
}
- EXPECT_EQ(c.id, receiver_->last_audio_codec_id());
+ EXPECT_EQ(rtc::Optional<int>(c.inst.plfreq),
+ receiver_->last_packet_sample_rate_hz());
EXPECT_EQ(0, receiver_->LastAudioCodec(&codec));
EXPECT_TRUE(CodecsEqual(c.inst, codec));
}

Powered by Google App Engine
This is Rietveld 408576698