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 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 | 2212 |
2213 // Check interaction with adjust_agc_delta. Both should be respected, for | 2213 // Check interaction with adjust_agc_delta. Both should be respected, for |
2214 // backwards compatibility. | 2214 // backwards compatibility. |
2215 options.adjust_agc_delta.Set(-10); | 2215 options.adjust_agc_delta.Set(-10); |
2216 EXPECT_TRUE(engine_.SetOptions(options)); | 2216 EXPECT_TRUE(engine_.SetOptions(options)); |
2217 | 2217 |
2218 EXPECT_EQ(0, voe_.GetAgcConfig(agc_config)); | 2218 EXPECT_EQ(0, voe_.GetAgcConfig(agc_config)); |
2219 EXPECT_EQ(13, agc_config.targetLeveldBOv); | 2219 EXPECT_EQ(13, agc_config.targetLeveldBOv); |
2220 } | 2220 } |
2221 | 2221 |
2222 TEST_F(WebRtcVoiceEngineTestFake, RxAgcConfigViaOptions) { | |
2223 EXPECT_TRUE(SetupEngine()); | |
2224 int channel_num = voe_.GetLastChannel(); | |
2225 send_parameters_.options.rx_agc_target_dbov.Set(6); | |
2226 send_parameters_.options.rx_agc_digital_compression_gain.Set(0); | |
2227 send_parameters_.options.rx_agc_limiter.Set(true); | |
2228 send_parameters_.options.rx_auto_gain_control.Set(true); | |
2229 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); | |
2230 | |
2231 webrtc::AgcConfig agc_config; | |
2232 EXPECT_EQ(0, engine_.voe()->processing()->GetRxAgcConfig( | |
2233 channel_num, agc_config)); | |
2234 EXPECT_EQ(6, agc_config.targetLeveldBOv); | |
2235 EXPECT_EQ(0, agc_config.digitalCompressionGaindB); | |
2236 EXPECT_TRUE(agc_config.limiterEnable); | |
2237 } | |
2238 | |
2239 TEST_F(WebRtcVoiceEngineTestFake, SampleRatesViaOptions) { | 2222 TEST_F(WebRtcVoiceEngineTestFake, SampleRatesViaOptions) { |
2240 EXPECT_TRUE(SetupEngine()); | 2223 EXPECT_TRUE(SetupEngine()); |
2241 cricket::AudioOptions options; | 2224 cricket::AudioOptions options; |
2242 options.recording_sample_rate.Set(48000u); | 2225 options.recording_sample_rate.Set(48000u); |
2243 options.playout_sample_rate.Set(44100u); | 2226 options.playout_sample_rate.Set(44100u); |
2244 EXPECT_TRUE(engine_.SetOptions(options)); | 2227 EXPECT_TRUE(engine_.SetOptions(options)); |
2245 | 2228 |
2246 unsigned int recording_sample_rate, playout_sample_rate; | 2229 unsigned int recording_sample_rate, playout_sample_rate; |
2247 EXPECT_EQ(0, voe_.RecordingSampleRate(&recording_sample_rate)); | 2230 EXPECT_EQ(0, voe_.RecordingSampleRate(&recording_sample_rate)); |
2248 EXPECT_EQ(0, voe_.PlayoutSampleRate(&playout_sample_rate)); | 2231 EXPECT_EQ(0, voe_.PlayoutSampleRate(&playout_sample_rate)); |
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3299 cricket::WebRtcVoiceEngine engine; | 3282 cricket::WebRtcVoiceEngine engine; |
3300 EXPECT_TRUE(engine.Init(rtc::Thread::Current())); | 3283 EXPECT_TRUE(engine.Init(rtc::Thread::Current())); |
3301 rtc::scoped_ptr<webrtc::Call> call( | 3284 rtc::scoped_ptr<webrtc::Call> call( |
3302 webrtc::Call::Create(webrtc::Call::Config())); | 3285 webrtc::Call::Create(webrtc::Call::Config())); |
3303 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(), | 3286 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(), |
3304 call.get()); | 3287 call.get()); |
3305 cricket::AudioRecvParameters parameters; | 3288 cricket::AudioRecvParameters parameters; |
3306 parameters.codecs = engine.codecs(); | 3289 parameters.codecs = engine.codecs(); |
3307 EXPECT_TRUE(channel.SetRecvParameters(parameters)); | 3290 EXPECT_TRUE(channel.SetRecvParameters(parameters)); |
3308 } | 3291 } |
OLD | NEW |