| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2008 Google Inc. | 3 * Copyright 2008 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2890 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); | 2890 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); |
| 2891 cricket::StreamParams stream; | 2891 cricket::StreamParams stream; |
| 2892 stream.ssrcs.push_back(kSsrc2); | 2892 stream.ssrcs.push_back(kSsrc2); |
| 2893 EXPECT_TRUE(channel_->AddRecvStream(stream)); | 2893 EXPECT_TRUE(channel_->AddRecvStream(stream)); |
| 2894 cricket::WebRtcVoiceMediaChannel* media_channel = | 2894 cricket::WebRtcVoiceMediaChannel* media_channel = |
| 2895 static_cast<cricket::WebRtcVoiceMediaChannel*>(channel_); | 2895 static_cast<cricket::WebRtcVoiceMediaChannel*>(channel_); |
| 2896 EXPECT_LT(media_channel->voe_channel(), | 2896 EXPECT_LT(media_channel->voe_channel(), |
| 2897 media_channel->GetReceiveChannelId(kSsrc2)); | 2897 media_channel->GetReceiveChannelId(kSsrc2)); |
| 2898 } | 2898 } |
| 2899 | 2899 |
| 2900 TEST_F(WebRtcVoiceEngineTestFake, SetOutputScaling) { | 2900 TEST_F(WebRtcVoiceEngineTestFake, SetOutputVolume) { |
| 2901 EXPECT_TRUE(SetupEngine()); | 2901 EXPECT_TRUE(SetupEngine()); |
| 2902 float scale, left, right; | 2902 float scale; |
| 2903 EXPECT_TRUE(channel_->SetOutputScaling(0, 1, 2)); | 2903 EXPECT_TRUE(channel_->SetOutputVolume(0, 2)); |
| 2904 int channel_id = voe_.GetLastChannel(); | 2904 int channel_id = voe_.GetLastChannel(); |
| 2905 EXPECT_EQ(0, voe_.GetChannelOutputVolumeScaling(channel_id, scale)); | 2905 EXPECT_EQ(0, voe_.GetChannelOutputVolumeScaling(channel_id, scale)); |
| 2906 EXPECT_EQ(0, voe_.GetOutputVolumePan(channel_id, left, right)); | 2906 EXPECT_DOUBLE_EQ(2, scale); |
| 2907 EXPECT_DOUBLE_EQ(1, left * scale); | |
| 2908 EXPECT_DOUBLE_EQ(2, right * scale); | |
| 2909 | 2907 |
| 2910 EXPECT_FALSE(channel_->SetOutputScaling(kSsrc2, 1, 2)); | 2908 EXPECT_FALSE(channel_->SetOutputVolume(kSsrc2, 0.5)); |
| 2911 cricket::StreamParams stream; | 2909 cricket::StreamParams stream; |
| 2912 stream.ssrcs.push_back(kSsrc2); | 2910 stream.ssrcs.push_back(kSsrc2); |
| 2913 EXPECT_TRUE(channel_->AddRecvStream(stream)); | 2911 EXPECT_TRUE(channel_->AddRecvStream(stream)); |
| 2914 | 2912 |
| 2915 EXPECT_TRUE(channel_->SetOutputScaling(kSsrc2, 2, 1)); | 2913 EXPECT_TRUE(channel_->SetOutputVolume(kSsrc2, 3)); |
| 2916 channel_id = voe_.GetLastChannel(); | 2914 channel_id = voe_.GetLastChannel(); |
| 2917 EXPECT_EQ(0, voe_.GetChannelOutputVolumeScaling(channel_id, scale)); | 2915 EXPECT_EQ(0, voe_.GetChannelOutputVolumeScaling(channel_id, scale)); |
| 2918 EXPECT_EQ(0, voe_.GetOutputVolumePan(channel_id, left, right)); | 2916 EXPECT_DOUBLE_EQ(3, scale); |
| 2919 EXPECT_DOUBLE_EQ(2, left * scale); | |
| 2920 EXPECT_DOUBLE_EQ(1, right * scale); | |
| 2921 } | 2917 } |
| 2922 | 2918 |
| 2923 TEST_F(WebRtcVoiceEngineTestFake, SetsSyncGroupFromSyncLabel) { | 2919 TEST_F(WebRtcVoiceEngineTestFake, SetsSyncGroupFromSyncLabel) { |
| 2924 const uint32_t kAudioSsrc = 123; | 2920 const uint32_t kAudioSsrc = 123; |
| 2925 const std::string kSyncLabel = "AvSyncLabel"; | 2921 const std::string kSyncLabel = "AvSyncLabel"; |
| 2926 | 2922 |
| 2927 EXPECT_TRUE(SetupEngine()); | 2923 EXPECT_TRUE(SetupEngine()); |
| 2928 cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kAudioSsrc); | 2924 cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kAudioSsrc); |
| 2929 sp.sync_label = kSyncLabel; | 2925 sp.sync_label = kSyncLabel; |
| 2930 // Creating two channels to make sure that sync label is set properly for both | 2926 // Creating two channels to make sure that sync label is set properly for both |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3299 cricket::WebRtcVoiceEngine engine; | 3295 cricket::WebRtcVoiceEngine engine; |
| 3300 EXPECT_TRUE(engine.Init(rtc::Thread::Current())); | 3296 EXPECT_TRUE(engine.Init(rtc::Thread::Current())); |
| 3301 rtc::scoped_ptr<webrtc::Call> call( | 3297 rtc::scoped_ptr<webrtc::Call> call( |
| 3302 webrtc::Call::Create(webrtc::Call::Config())); | 3298 webrtc::Call::Create(webrtc::Call::Config())); |
| 3303 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(), | 3299 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(), |
| 3304 call.get()); | 3300 call.get()); |
| 3305 cricket::AudioRecvParameters parameters; | 3301 cricket::AudioRecvParameters parameters; |
| 3306 parameters.codecs = engine.codecs(); | 3302 parameters.codecs = engine.codecs(); |
| 3307 EXPECT_TRUE(channel.SetRecvParameters(parameters)); | 3303 EXPECT_TRUE(channel.SetRecvParameters(parameters)); |
| 3308 } | 3304 } |
| OLD | NEW |