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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine_unittest.cc

Issue 1984983002: Remove use of RtpHeaderExtension and clean up (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed nit Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include <memory> 11 #include <memory>
12 12
13 #include "webrtc/pc/channel.h" 13 #include "webrtc/pc/channel.h"
14 #include "webrtc/base/arraysize.h" 14 #include "webrtc/base/arraysize.h"
15 #include "webrtc/base/byteorder.h" 15 #include "webrtc/base/byteorder.h"
16 #include "webrtc/base/gunit.h" 16 #include "webrtc/base/gunit.h"
17 #include "webrtc/call.h" 17 #include "webrtc/call.h"
18 #include "webrtc/p2p/base/faketransportcontroller.h" 18 #include "webrtc/p2p/base/faketransportcontroller.h"
19 #include "webrtc/test/field_trial.h" 19 #include "webrtc/test/field_trial.h"
20 #include "webrtc/media/base/fakemediaengine.h" 20 #include "webrtc/media/base/fakemediaengine.h"
21 #include "webrtc/media/base/fakenetworkinterface.h" 21 #include "webrtc/media/base/fakenetworkinterface.h"
22 #include "webrtc/media/base/fakertp.h" 22 #include "webrtc/media/base/fakertp.h"
23 #include "webrtc/media/base/mediaconstants.h" 23 #include "webrtc/media/base/mediaconstants.h"
24 #include "webrtc/media/engine/fakewebrtccall.h" 24 #include "webrtc/media/engine/fakewebrtccall.h"
25 #include "webrtc/media/engine/fakewebrtcvoiceengine.h" 25 #include "webrtc/media/engine/fakewebrtcvoiceengine.h"
26 #include "webrtc/media/engine/webrtcvoiceengine.h" 26 #include "webrtc/media/engine/webrtcvoiceengine.h"
27 #include "webrtc/modules/audio_device/include/mock_audio_device.h" 27 #include "webrtc/modules/audio_device/include/mock_audio_device.h"
28 28
29 using cricket::kRtpAudioLevelHeaderExtension;
30 using cricket::kRtpAbsoluteSenderTimeHeaderExtension;
31 using testing::Return; 29 using testing::Return;
32 using testing::StrictMock; 30 using testing::StrictMock;
33 31
34 namespace { 32 namespace {
35 33
36 const cricket::AudioCodec kPcmuCodec(0, "PCMU", 8000, 64000, 1); 34 const cricket::AudioCodec kPcmuCodec(0, "PCMU", 8000, 64000, 1);
37 const cricket::AudioCodec kIsacCodec(103, "ISAC", 16000, 32000, 1); 35 const cricket::AudioCodec kIsacCodec(103, "ISAC", 16000, 32000, 1);
38 const cricket::AudioCodec kOpusCodec(111, "opus", 48000, 64000, 2); 36 const cricket::AudioCodec kOpusCodec(111, "opus", 48000, 64000, 2);
39 const cricket::AudioCodec kG722CodecVoE(9, "G722", 16000, 64000, 1); 37 const cricket::AudioCodec kG722CodecVoE(9, "G722", 16000, 64000, 1);
40 const cricket::AudioCodec kG722CodecSdp(9, "G722", 8000, 64000, 1); 38 const cricket::AudioCodec kG722CodecSdp(9, "G722", 8000, 64000, 1);
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 EXPECT_EQ(expected_codec_bitrate, GetCodecBitrate(kSsrc1)); 280 EXPECT_EQ(expected_codec_bitrate, GetCodecBitrate(kSsrc1));
283 } 281 }
284 282
285 void TestSetSendRtpHeaderExtensions(const std::string& ext) { 283 void TestSetSendRtpHeaderExtensions(const std::string& ext) {
286 EXPECT_TRUE(SetupSendStream()); 284 EXPECT_TRUE(SetupSendStream());
287 285
288 // Ensure extensions are off by default. 286 // Ensure extensions are off by default.
289 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc1).rtp.extensions.size()); 287 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc1).rtp.extensions.size());
290 288
291 // Ensure unknown extensions won't cause an error. 289 // Ensure unknown extensions won't cause an error.
292 send_parameters_.extensions.push_back(cricket::RtpHeaderExtension( 290 send_parameters_.extensions.push_back(
293 "urn:ietf:params:unknownextention", 1)); 291 webrtc::RtpExtension("urn:ietf:params:unknownextention", 1));
294 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 292 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
295 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc1).rtp.extensions.size()); 293 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc1).rtp.extensions.size());
296 294
297 // Ensure extensions stay off with an empty list of headers. 295 // Ensure extensions stay off with an empty list of headers.
298 send_parameters_.extensions.clear(); 296 send_parameters_.extensions.clear();
299 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 297 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
300 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc1).rtp.extensions.size()); 298 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc1).rtp.extensions.size());
301 299
302 // Ensure extension is set properly. 300 // Ensure extension is set properly.
303 const int id = 1; 301 const int id = 1;
304 send_parameters_.extensions.push_back(cricket::RtpHeaderExtension(ext, id)); 302 send_parameters_.extensions.push_back(webrtc::RtpExtension(ext, id));
305 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 303 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
306 EXPECT_EQ(1u, GetSendStreamConfig(kSsrc1).rtp.extensions.size()); 304 EXPECT_EQ(1u, GetSendStreamConfig(kSsrc1).rtp.extensions.size());
307 EXPECT_EQ(ext, GetSendStreamConfig(kSsrc1).rtp.extensions[0].name); 305 EXPECT_EQ(ext, GetSendStreamConfig(kSsrc1).rtp.extensions[0].uri);
308 EXPECT_EQ(id, GetSendStreamConfig(kSsrc1).rtp.extensions[0].id); 306 EXPECT_EQ(id, GetSendStreamConfig(kSsrc1).rtp.extensions[0].id);
309 307
310 // Ensure extension is set properly on new stream. 308 // Ensure extension is set properly on new stream.
311 EXPECT_TRUE(channel_->AddSendStream( 309 EXPECT_TRUE(channel_->AddSendStream(
312 cricket::StreamParams::CreateLegacy(kSsrc2))); 310 cricket::StreamParams::CreateLegacy(kSsrc2)));
313 EXPECT_NE(call_.GetAudioSendStream(kSsrc1), 311 EXPECT_NE(call_.GetAudioSendStream(kSsrc1),
314 call_.GetAudioSendStream(kSsrc2)); 312 call_.GetAudioSendStream(kSsrc2));
315 EXPECT_EQ(1u, GetSendStreamConfig(kSsrc2).rtp.extensions.size()); 313 EXPECT_EQ(1u, GetSendStreamConfig(kSsrc2).rtp.extensions.size());
316 EXPECT_EQ(ext, GetSendStreamConfig(kSsrc2).rtp.extensions[0].name); 314 EXPECT_EQ(ext, GetSendStreamConfig(kSsrc2).rtp.extensions[0].uri);
317 EXPECT_EQ(id, GetSendStreamConfig(kSsrc2).rtp.extensions[0].id); 315 EXPECT_EQ(id, GetSendStreamConfig(kSsrc2).rtp.extensions[0].id);
318 316
319 // Ensure all extensions go back off with an empty list. 317 // Ensure all extensions go back off with an empty list.
320 send_parameters_.codecs.push_back(kPcmuCodec); 318 send_parameters_.codecs.push_back(kPcmuCodec);
321 send_parameters_.extensions.clear(); 319 send_parameters_.extensions.clear();
322 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 320 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
323 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc1).rtp.extensions.size()); 321 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc1).rtp.extensions.size());
324 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc2).rtp.extensions.size()); 322 EXPECT_EQ(0u, GetSendStreamConfig(kSsrc2).rtp.extensions.size());
325 } 323 }
326 324
327 void TestSetRecvRtpHeaderExtensions(const std::string& ext) { 325 void TestSetRecvRtpHeaderExtensions(const std::string& ext) {
328 EXPECT_TRUE(SetupRecvStream()); 326 EXPECT_TRUE(SetupRecvStream());
329 327
330 // Ensure extensions are off by default. 328 // Ensure extensions are off by default.
331 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size()); 329 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size());
332 330
333 // Ensure unknown extensions won't cause an error. 331 // Ensure unknown extensions won't cause an error.
334 recv_parameters_.extensions.push_back(cricket::RtpHeaderExtension( 332 recv_parameters_.extensions.push_back(
335 "urn:ietf:params:unknownextention", 1)); 333 webrtc::RtpExtension("urn:ietf:params:unknownextention", 1));
336 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); 334 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
337 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size()); 335 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size());
338 336
339 // Ensure extensions stay off with an empty list of headers. 337 // Ensure extensions stay off with an empty list of headers.
340 recv_parameters_.extensions.clear(); 338 recv_parameters_.extensions.clear();
341 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); 339 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
342 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size()); 340 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size());
343 341
344 // Ensure extension is set properly. 342 // Ensure extension is set properly.
345 const int id = 2; 343 const int id = 2;
346 recv_parameters_.extensions.push_back(cricket::RtpHeaderExtension(ext, id)); 344 recv_parameters_.extensions.push_back(webrtc::RtpExtension(ext, id));
347 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); 345 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
348 EXPECT_EQ(1u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size()); 346 EXPECT_EQ(1u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size());
349 EXPECT_EQ(ext, GetRecvStreamConfig(kSsrc1).rtp.extensions[0].name); 347 EXPECT_EQ(ext, GetRecvStreamConfig(kSsrc1).rtp.extensions[0].uri);
350 EXPECT_EQ(id, GetRecvStreamConfig(kSsrc1).rtp.extensions[0].id); 348 EXPECT_EQ(id, GetRecvStreamConfig(kSsrc1).rtp.extensions[0].id);
351 349
352 // Ensure extension is set properly on new stream. 350 // Ensure extension is set properly on new stream.
353 EXPECT_TRUE(channel_->AddRecvStream( 351 EXPECT_TRUE(channel_->AddRecvStream(
354 cricket::StreamParams::CreateLegacy(kSsrc2))); 352 cricket::StreamParams::CreateLegacy(kSsrc2)));
355 EXPECT_NE(call_.GetAudioReceiveStream(kSsrc1), 353 EXPECT_NE(call_.GetAudioReceiveStream(kSsrc1),
356 call_.GetAudioReceiveStream(kSsrc2)); 354 call_.GetAudioReceiveStream(kSsrc2));
357 EXPECT_EQ(1u, GetRecvStreamConfig(kSsrc2).rtp.extensions.size()); 355 EXPECT_EQ(1u, GetRecvStreamConfig(kSsrc2).rtp.extensions.size());
358 EXPECT_EQ(ext, GetRecvStreamConfig(kSsrc2).rtp.extensions[0].name); 356 EXPECT_EQ(ext, GetRecvStreamConfig(kSsrc2).rtp.extensions[0].uri);
359 EXPECT_EQ(id, GetRecvStreamConfig(kSsrc2).rtp.extensions[0].id); 357 EXPECT_EQ(id, GetRecvStreamConfig(kSsrc2).rtp.extensions[0].id);
360 358
361 // Ensure all extensions go back off with an empty list. 359 // Ensure all extensions go back off with an empty list.
362 recv_parameters_.extensions.clear(); 360 recv_parameters_.extensions.clear();
363 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); 361 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
364 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size()); 362 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc1).rtp.extensions.size());
365 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc2).rtp.extensions.size()); 363 EXPECT_EQ(0u, GetRecvStreamConfig(kSsrc2).rtp.extensions.size());
366 } 364 }
367 365
368 webrtc::AudioSendStream::Stats GetAudioSendStreamStats() const { 366 webrtc::AudioSendStream::Stats GetAudioSendStreamStats() const {
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 class WebRtcVoiceEngineWithSendSideBweTest : public WebRtcVoiceEngineTestFake { 2244 class WebRtcVoiceEngineWithSendSideBweTest : public WebRtcVoiceEngineTestFake {
2247 public: 2245 public:
2248 WebRtcVoiceEngineWithSendSideBweTest() 2246 WebRtcVoiceEngineWithSendSideBweTest()
2249 : WebRtcVoiceEngineTestFake("WebRTC-Audio-SendSideBwe/Enabled/") {} 2247 : WebRtcVoiceEngineTestFake("WebRTC-Audio-SendSideBwe/Enabled/") {}
2250 }; 2248 };
2251 2249
2252 TEST_F(WebRtcVoiceEngineWithSendSideBweTest, 2250 TEST_F(WebRtcVoiceEngineWithSendSideBweTest,
2253 SupportsTransportSequenceNumberHeaderExtension) { 2251 SupportsTransportSequenceNumberHeaderExtension) {
2254 cricket::RtpCapabilities capabilities = engine_->GetCapabilities(); 2252 cricket::RtpCapabilities capabilities = engine_->GetCapabilities();
2255 ASSERT_FALSE(capabilities.header_extensions.empty()); 2253 ASSERT_FALSE(capabilities.header_extensions.empty());
2256 for (const cricket::RtpHeaderExtension& extension : 2254 for (const webrtc::RtpExtension& extension : capabilities.header_extensions) {
2257 capabilities.header_extensions) { 2255 if (extension.uri == webrtc::RtpExtension::kTransportSequenceNumberUri) {
2258 if (extension.uri == cricket::kRtpTransportSequenceNumberHeaderExtension) { 2256 EXPECT_EQ(webrtc::RtpExtension::kTransportSequenceNumberDefaultId,
2259 EXPECT_EQ(cricket::kRtpTransportSequenceNumberHeaderExtensionDefaultId,
2260 extension.id); 2257 extension.id);
2261 return; 2258 return;
2262 } 2259 }
2263 } 2260 }
2264 FAIL() << "Transport sequence number extension not in header-extension list."; 2261 FAIL() << "Transport sequence number extension not in header-extension list.";
2265 } 2262 }
2266 2263
2267 // Test support for audio level header extension. 2264 // Test support for audio level header extension.
2268 TEST_F(WebRtcVoiceEngineTestFake, SendAudioLevelHeaderExtensions) { 2265 TEST_F(WebRtcVoiceEngineTestFake, SendAudioLevelHeaderExtensions) {
2269 TestSetSendRtpHeaderExtensions(kRtpAudioLevelHeaderExtension); 2266 TestSetSendRtpHeaderExtensions(webrtc::RtpExtension::kAudioLevelUri);
2270 } 2267 }
2271 TEST_F(WebRtcVoiceEngineTestFake, RecvAudioLevelHeaderExtensions) { 2268 TEST_F(WebRtcVoiceEngineTestFake, RecvAudioLevelHeaderExtensions) {
2272 TestSetRecvRtpHeaderExtensions(kRtpAudioLevelHeaderExtension); 2269 TestSetRecvRtpHeaderExtensions(webrtc::RtpExtension::kAudioLevelUri);
2273 } 2270 }
2274 2271
2275 // Test support for absolute send time header extension. 2272 // Test support for absolute send time header extension.
2276 TEST_F(WebRtcVoiceEngineTestFake, SendAbsoluteSendTimeHeaderExtensions) { 2273 TEST_F(WebRtcVoiceEngineTestFake, SendAbsoluteSendTimeHeaderExtensions) {
2277 TestSetSendRtpHeaderExtensions(kRtpAbsoluteSenderTimeHeaderExtension); 2274 TestSetSendRtpHeaderExtensions(webrtc::RtpExtension::kAbsSendTimeUri);
2278 } 2275 }
2279 TEST_F(WebRtcVoiceEngineTestFake, RecvAbsoluteSendTimeHeaderExtensions) { 2276 TEST_F(WebRtcVoiceEngineTestFake, RecvAbsoluteSendTimeHeaderExtensions) {
2280 TestSetRecvRtpHeaderExtensions(kRtpAbsoluteSenderTimeHeaderExtension); 2277 TestSetRecvRtpHeaderExtensions(webrtc::RtpExtension::kAbsSendTimeUri);
2281 } 2278 }
2282 2279
2283 // Test that we can create a channel and start sending on it. 2280 // Test that we can create a channel and start sending on it.
2284 TEST_F(WebRtcVoiceEngineTestFake, Send) { 2281 TEST_F(WebRtcVoiceEngineTestFake, Send) {
2285 EXPECT_TRUE(SetupSendStream()); 2282 EXPECT_TRUE(SetupSendStream());
2286 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2283 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2287 SetSend(channel_, true); 2284 SetSend(channel_, true);
2288 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending()); 2285 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending());
2289 SetSend(channel_, false); 2286 SetSend(channel_, false);
2290 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); 2287 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
(...skipping 17 matching lines...) Expand all
2308 TEST_F(WebRtcVoiceEngineTestFake, SendStateWhenStreamsAreRecreated) { 2305 TEST_F(WebRtcVoiceEngineTestFake, SendStateWhenStreamsAreRecreated) {
2309 EXPECT_TRUE(SetupSendStream()); 2306 EXPECT_TRUE(SetupSendStream());
2310 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); 2307 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2311 2308
2312 // Turn on sending. 2309 // Turn on sending.
2313 SetSend(channel_, true); 2310 SetSend(channel_, true);
2314 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending()); 2311 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending());
2315 2312
2316 // Changing RTP header extensions will recreate the AudioSendStream. 2313 // Changing RTP header extensions will recreate the AudioSendStream.
2317 send_parameters_.extensions.push_back( 2314 send_parameters_.extensions.push_back(
2318 cricket::RtpHeaderExtension(kRtpAudioLevelHeaderExtension, 12)); 2315 webrtc::RtpExtension(webrtc::RtpExtension::kAudioLevelUri, 12));
2319 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2316 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2320 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending()); 2317 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending());
2321 2318
2322 // Turn off sending. 2319 // Turn off sending.
2323 SetSend(channel_, false); 2320 SetSend(channel_, false);
2324 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); 2321 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2325 2322
2326 // Changing RTP header extensions will recreate the AudioSendStream. 2323 // Changing RTP header extensions will recreate the AudioSendStream.
2327 send_parameters_.extensions.clear(); 2324 send_parameters_.extensions.clear();
2328 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2325 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
3376 channel_->SetRecvParameters(recv_parameters); 3373 channel_->SetRecvParameters(recv_parameters);
3377 EXPECT_EQ(2, call_.GetAudioReceiveStreams().size()); 3374 EXPECT_EQ(2, call_.GetAudioReceiveStreams().size());
3378 for (uint32_t ssrc : ssrcs) { 3375 for (uint32_t ssrc : ssrcs) {
3379 const auto* s = call_.GetAudioReceiveStream(ssrc); 3376 const auto* s = call_.GetAudioReceiveStream(ssrc);
3380 EXPECT_NE(nullptr, s); 3377 EXPECT_NE(nullptr, s);
3381 const auto& s_exts = s->GetConfig().rtp.extensions; 3378 const auto& s_exts = s->GetConfig().rtp.extensions;
3382 EXPECT_EQ(capabilities.header_extensions.size(), s_exts.size()); 3379 EXPECT_EQ(capabilities.header_extensions.size(), s_exts.size());
3383 for (const auto& e_ext : capabilities.header_extensions) { 3380 for (const auto& e_ext : capabilities.header_extensions) {
3384 for (const auto& s_ext : s_exts) { 3381 for (const auto& s_ext : s_exts) {
3385 if (e_ext.id == s_ext.id) { 3382 if (e_ext.id == s_ext.id) {
3386 EXPECT_EQ(e_ext.uri, s_ext.name); 3383 EXPECT_EQ(e_ext.uri, s_ext.uri);
3387 } 3384 }
3388 } 3385 }
3389 } 3386 }
3390 } 3387 }
3391 3388
3392 // Disable receive extensions. 3389 // Disable receive extensions.
3393 channel_->SetRecvParameters(cricket::AudioRecvParameters()); 3390 channel_->SetRecvParameters(cricket::AudioRecvParameters());
3394 for (uint32_t ssrc : ssrcs) { 3391 for (uint32_t ssrc : ssrcs) {
3395 const auto* s = call_.GetAudioReceiveStream(ssrc); 3392 const auto* s = call_.GetAudioReceiveStream(ssrc);
3396 EXPECT_NE(nullptr, s); 3393 EXPECT_NE(nullptr, s);
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
3673 TEST(WebRtcVoiceEngineTest, SetRecvCodecs) { 3670 TEST(WebRtcVoiceEngineTest, SetRecvCodecs) {
3674 cricket::WebRtcVoiceEngine engine(nullptr); 3671 cricket::WebRtcVoiceEngine engine(nullptr);
3675 std::unique_ptr<webrtc::Call> call( 3672 std::unique_ptr<webrtc::Call> call(
3676 webrtc::Call::Create(webrtc::Call::Config())); 3673 webrtc::Call::Create(webrtc::Call::Config()));
3677 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), 3674 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(),
3678 cricket::AudioOptions(), call.get()); 3675 cricket::AudioOptions(), call.get());
3679 cricket::AudioRecvParameters parameters; 3676 cricket::AudioRecvParameters parameters;
3680 parameters.codecs = engine.codecs(); 3677 parameters.codecs = engine.codecs();
3681 EXPECT_TRUE(channel.SetRecvParameters(parameters)); 3678 EXPECT_TRUE(channel.SetRecvParameters(parameters));
3682 } 3679 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698