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

Unified Diff: webrtc/api/webrtcsession_unittest.cc

Issue 1788583004: Enable setting the maximum bitrate limit in RtpSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased on top of the latest master branch Created 4 years, 9 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 | « webrtc/api/webrtcsession.cc ('k') | webrtc/media/base/fakemediaengine.h » ('j') | no next file with comments »
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 c0fff5251301b58a09508ef03e31f96289f9c57d..77c4854680bf141d2c1ae194f74ee0ad1b59edb2 100644
--- a/webrtc/api/webrtcsession_unittest.cc
+++ b/webrtc/api/webrtcsession_unittest.cc
@@ -3385,6 +3385,25 @@ 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.
+
+ Init();
+ SendAudioVideoStream1();
+ CreateAndSetRemoteOfferAndLocalAnswer();
+ cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0);
+ ASSERT_TRUE(channel != NULL);
+ uint32_t send_ssrc = channel->send_streams()[0].first_ssrc();
+ webrtc::RtpParameters params = session_->GetAudioRtpParameters(send_ssrc);
+
+ EXPECT_EQ(0, params.encodings.size());
+ params.encodings.push_back(webrtc::RtpEncodingParameters());
+ EXPECT_FALSE(session_->SetAudioRtpParameters(send_ssrc, params));
+}
+
TEST_F(WebRtcSessionTest, SetAudioSend) {
Init();
SendAudioVideoStream1();
@@ -3451,6 +3470,34 @@ TEST_F(WebRtcSessionTest, SetVideoPlayout) {
EXPECT_TRUE(channel->sinks().begin()->second == NULL);
}
+TEST_F(WebRtcSessionTest, SetVideoMaxSendBitrate) {
+ Init();
+ SendAudioVideoStream1();
+ CreateAndSetRemoteOfferAndLocalAnswer();
+ cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(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_->GetVideoRtpParameters(send_ssrc);
+ EXPECT_EQ(1, params.encodings.size());
+ EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps);
+ params.encodings[0].max_bitrate_bps = 1000;
+ EXPECT_TRUE(session_->SetVideoRtpParameters(send_ssrc, params));
+
+ // Read back the parameters and verify they have been changed.
+ params = session_->GetVideoRtpParameters(send_ssrc);
+ EXPECT_EQ(1, params.encodings.size());
+ EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
+
+ // Verify that the video 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, SetVideoSend) {
Init();
SendAudioVideoStream1();
« no previous file with comments | « webrtc/api/webrtcsession.cc ('k') | webrtc/media/base/fakemediaengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698