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

Unified Diff: talk/session/media/channel_unittest.cc

Issue 1397773002: Change SetOutputScaling to set a single level, not left/right levels. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase+rename Created 5 years, 2 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 | « talk/session/media/channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/session/media/channel_unittest.cc
diff --git a/talk/session/media/channel_unittest.cc b/talk/session/media/channel_unittest.cc
index b861d0a4efee8f76f6ba21073a4bb368581e8231..1b14cdac9e8396578084eccc4bf2965ec2dee41d 100644
--- a/talk/session/media/channel_unittest.cc
+++ b/talk/session/media/channel_unittest.cc
@@ -2189,26 +2189,23 @@ TEST_F(VoiceChannelTest, TestScaleVolume1to1Call) {
CreateChannels(RTCP, RTCP);
EXPECT_TRUE(SendInitiate());
EXPECT_TRUE(SendAccept());
- double left, right;
+ double volume;
- // Default is (1.0, 1.0).
- EXPECT_TRUE(media_channel1_->GetOutputScaling(0, &left, &right));
- EXPECT_DOUBLE_EQ(1.0, left);
- EXPECT_DOUBLE_EQ(1.0, right);
+ // Default is (1.0).
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume));
+ EXPECT_DOUBLE_EQ(1.0, volume);
// invalid ssrc.
- EXPECT_FALSE(media_channel1_->GetOutputScaling(3, &left, &right));
+ EXPECT_FALSE(media_channel1_->GetOutputVolume(3, &volume));
- // Set scale to (1.5, 0.5).
- EXPECT_TRUE(channel1_->SetOutputScaling(0, 1.5, 0.5));
- EXPECT_TRUE(media_channel1_->GetOutputScaling(0, &left, &right));
- EXPECT_DOUBLE_EQ(1.5, left);
- EXPECT_DOUBLE_EQ(0.5, right);
+ // Set scale to (1.5).
+ EXPECT_TRUE(channel1_->SetOutputVolume(0, 1.5));
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume));
+ EXPECT_DOUBLE_EQ(1.5, volume);
- // Set scale to (0, 0).
- EXPECT_TRUE(channel1_->SetOutputScaling(0, 0.0, 0.0));
- EXPECT_TRUE(media_channel1_->GetOutputScaling(0, &left, &right));
- EXPECT_DOUBLE_EQ(0.0, left);
- EXPECT_DOUBLE_EQ(0.0, right);
+ // Set scale to (0).
+ EXPECT_TRUE(channel1_->SetOutputVolume(0, 0.0));
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume));
+ EXPECT_DOUBLE_EQ(0.0, volume);
}
// Test that we can scale the output volume properly for multiway calls.
@@ -2219,43 +2216,34 @@ TEST_F(VoiceChannelTest, TestScaleVolumeMultiwayCall) {
EXPECT_TRUE(AddStream1(1));
EXPECT_TRUE(AddStream1(2));
- double left, right;
- // Default is (1.0, 1.0).
- EXPECT_TRUE(media_channel1_->GetOutputScaling(0, &left, &right));
- EXPECT_DOUBLE_EQ(1.0, left);
- EXPECT_DOUBLE_EQ(1.0, right);
- EXPECT_TRUE(media_channel1_->GetOutputScaling(1, &left, &right));
- EXPECT_DOUBLE_EQ(1.0, left);
- EXPECT_DOUBLE_EQ(1.0, right);
- EXPECT_TRUE(media_channel1_->GetOutputScaling(2, &left, &right));
- EXPECT_DOUBLE_EQ(1.0, left);
- EXPECT_DOUBLE_EQ(1.0, right);
+ double volume;
+ // Default is (1.0).
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume));
+ EXPECT_DOUBLE_EQ(1.0, volume);
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(1, &volume));
+ EXPECT_DOUBLE_EQ(1.0, volume);
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(2, &volume));
+ EXPECT_DOUBLE_EQ(1.0, volume);
// invalid ssrc.
- EXPECT_FALSE(media_channel1_->GetOutputScaling(3, &left, &right));
-
- // Set scale to (1.5, 0.5) for ssrc = 1.
- EXPECT_TRUE(channel1_->SetOutputScaling(1, 1.5, 0.5));
- EXPECT_TRUE(media_channel1_->GetOutputScaling(1, &left, &right));
- EXPECT_DOUBLE_EQ(1.5, left);
- EXPECT_DOUBLE_EQ(0.5, right);
- EXPECT_TRUE(media_channel1_->GetOutputScaling(2, &left, &right));
- EXPECT_DOUBLE_EQ(1.0, left);
- EXPECT_DOUBLE_EQ(1.0, right);
- EXPECT_TRUE(media_channel1_->GetOutputScaling(0, &left, &right));
- EXPECT_DOUBLE_EQ(1.0, left);
- EXPECT_DOUBLE_EQ(1.0, right);
-
- // Set scale to (0, 0) for all ssrcs.
- EXPECT_TRUE(channel1_->SetOutputScaling(0, 0.0, 0.0));
- EXPECT_TRUE(media_channel1_->GetOutputScaling(0, &left, &right));
- EXPECT_DOUBLE_EQ(0.0, left);
- EXPECT_DOUBLE_EQ(0.0, right);
- EXPECT_TRUE(media_channel1_->GetOutputScaling(1, &left, &right));
- EXPECT_DOUBLE_EQ(0.0, left);
- EXPECT_DOUBLE_EQ(0.0, right);
- EXPECT_TRUE(media_channel1_->GetOutputScaling(2, &left, &right));
- EXPECT_DOUBLE_EQ(0.0, left);
- EXPECT_DOUBLE_EQ(0.0, right);
+ EXPECT_FALSE(media_channel1_->GetOutputVolume(3, &volume));
+
+ // Set scale to (1.5) for ssrc = 1.
+ EXPECT_TRUE(channel1_->SetOutputVolume(1, 1.5));
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(1, &volume));
+ EXPECT_DOUBLE_EQ(1.5, volume);
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(2, &volume));
+ EXPECT_DOUBLE_EQ(1.0, volume);
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume));
+ EXPECT_DOUBLE_EQ(1.0, volume);
+
+ // Set scale to (0) for all ssrcs.
+ EXPECT_TRUE(channel1_->SetOutputVolume(0, 0.0));
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume));
+ EXPECT_DOUBLE_EQ(0.0, volume);
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(1, &volume));
+ EXPECT_DOUBLE_EQ(0.0, volume);
+ EXPECT_TRUE(media_channel1_->GetOutputVolume(2, &volume));
+ EXPECT_DOUBLE_EQ(0.0, volume);
}
TEST_F(VoiceChannelTest, SendBundleToBundle) {
« no previous file with comments | « talk/session/media/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698