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

Unified Diff: webrtc/api/webrtcsession_unittest.cc

Issue 1847353004: Allow applications to control audio send bitrate through RtpParameters. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: More CR feedback 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
« no previous file with comments | « no previous file | webrtc/media/base/mediachannel.h » ('j') | webrtc/media/engine/webrtcvoiceengine.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/webrtcsession_unittest.cc
diff --git a/webrtc/api/webrtcsession_unittest.cc b/webrtc/api/webrtcsession_unittest.cc
index 18c1a95116e5e812c0f784137c5fb28a463e895c..f4b41d355a52b10653201199d884719e75df599e 100644
--- a/webrtc/api/webrtcsession_unittest.cc
+++ b/webrtc/api/webrtcsession_unittest.cc
@@ -3385,23 +3385,32 @@ TEST_F(WebRtcSessionTest, SetAudioPlayout) {
EXPECT_EQ(1, volume);
}
-TEST_F(WebRtcSessionTest, AudioMaxSendBitrateNotImplemented) {
- // This test verifies that RtpParameters for audio RtpSenders cannot be
- // changed.
- // TODO(skvlad): Update the test after adding support for bitrate limiting in
- // WebRtcAudioSendStream.
-
+TEST_F(WebRtcSessionTest, SetAudioMaxSendBitrate) {
Init();
SendAudioVideoStream1();
CreateAndSetRemoteOfferAndLocalAnswer();
cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0);
ASSERT_TRUE(channel != NULL);
uint32_t send_ssrc = channel->send_streams()[0].first_ssrc();
+ EXPECT_EQ(-1, channel->max_bps());
webrtc::RtpParameters params = session_->GetAudioRtpParameters(send_ssrc);
+ EXPECT_EQ(1, params.encodings.size());
pthatcher1 2016/04/12 18:04:23 This should be ASSERT_EQ since the next line may c
+ EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps);
+ params.encodings[0].max_bitrate_bps = 1000;
+ EXPECT_TRUE(session_->SetAudioRtpParameters(send_ssrc, params));
- EXPECT_EQ(0, params.encodings.size());
- params.encodings.push_back(webrtc::RtpEncodingParameters());
- EXPECT_FALSE(session_->SetAudioRtpParameters(send_ssrc, params));
+ // Read back the parameters and verify they have been changed.
+ params = session_->GetAudioRtpParameters(send_ssrc);
+ EXPECT_EQ(1, params.encodings.size());
+ EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
+
+ // Verify that the audio channel received the new parameters.
+ params = channel->GetRtpParameters(send_ssrc);
+ EXPECT_EQ(1, params.encodings.size());
+ EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
+
+ // Verify that the global bitrate limit has not been changed.
+ EXPECT_EQ(-1, channel->max_bps());
}
TEST_F(WebRtcSessionTest, SetAudioSend) {
« no previous file with comments | « no previous file | webrtc/media/base/mediachannel.h » ('j') | webrtc/media/engine/webrtcvoiceengine.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698