OLD | NEW |
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 |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 EXPECT_EQ(64000, GetCodecBitrate(kSsrcs4[2])); | 903 EXPECT_EQ(64000, GetCodecBitrate(kSsrcs4[2])); |
904 | 904 |
905 // Remove the global cap; the streams should switch to their respective | 905 // Remove the global cap; the streams should switch to their respective |
906 // maximums (or remain unchanged if there was no other limit on them.) | 906 // maximums (or remain unchanged if there was no other limit on them.) |
907 EXPECT_TRUE(SetGlobalMaxBitrate(kOpusCodec, -1)); | 907 EXPECT_TRUE(SetGlobalMaxBitrate(kOpusCodec, -1)); |
908 EXPECT_EQ(48000, GetCodecBitrate(kSsrcs4[0])); | 908 EXPECT_EQ(48000, GetCodecBitrate(kSsrcs4[0])); |
909 EXPECT_EQ(96000, GetCodecBitrate(kSsrcs4[1])); | 909 EXPECT_EQ(96000, GetCodecBitrate(kSsrcs4[1])); |
910 EXPECT_EQ(64000, GetCodecBitrate(kSsrcs4[2])); | 910 EXPECT_EQ(64000, GetCodecBitrate(kSsrcs4[2])); |
911 } | 911 } |
912 | 912 |
| 913 // Test that GetRtpParameters returns the currently configured codecs. |
| 914 TEST_F(WebRtcVoiceEngineTestFake, GetRtpParametersCodecs) { |
| 915 EXPECT_TRUE(SetupSendStream()); |
| 916 cricket::AudioSendParameters parameters; |
| 917 parameters.codecs.push_back(kIsacCodec); |
| 918 parameters.codecs.push_back(kPcmuCodec); |
| 919 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 920 |
| 921 webrtc::RtpParameters rtp_parameters = channel_->GetRtpParameters(kSsrc1); |
| 922 ASSERT_EQ(2u, rtp_parameters.codecs.size()); |
| 923 EXPECT_EQ(kIsacCodec.id, rtp_parameters.codecs[0].payload_type); |
| 924 EXPECT_EQ(kIsacCodec.name, rtp_parameters.codecs[0].mime_type); |
| 925 EXPECT_EQ(kIsacCodec.clockrate, rtp_parameters.codecs[0].clock_rate); |
| 926 EXPECT_EQ(kIsacCodec.channels, rtp_parameters.codecs[0].channels); |
| 927 EXPECT_EQ(kPcmuCodec.id, rtp_parameters.codecs[1].payload_type); |
| 928 EXPECT_EQ(kPcmuCodec.name, rtp_parameters.codecs[1].mime_type); |
| 929 EXPECT_EQ(kPcmuCodec.clockrate, rtp_parameters.codecs[1].clock_rate); |
| 930 EXPECT_EQ(kPcmuCodec.channels, rtp_parameters.codecs[1].channels); |
| 931 } |
| 932 |
913 // Test that we apply codecs properly. | 933 // Test that we apply codecs properly. |
914 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecs) { | 934 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecs) { |
915 EXPECT_TRUE(SetupSendStream()); | 935 EXPECT_TRUE(SetupSendStream()); |
916 cricket::AudioSendParameters parameters; | 936 cricket::AudioSendParameters parameters; |
917 parameters.codecs.push_back(kIsacCodec); | 937 parameters.codecs.push_back(kIsacCodec); |
918 parameters.codecs.push_back(kPcmuCodec); | 938 parameters.codecs.push_back(kPcmuCodec); |
919 parameters.codecs.push_back(kRedCodec); | 939 parameters.codecs.push_back(kRedCodec); |
920 parameters.codecs[0].id = 96; | 940 parameters.codecs[0].id = 96; |
921 parameters.codecs[0].bitrate = 48000; | 941 parameters.codecs[0].bitrate = 48000; |
922 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 942 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
(...skipping 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3493 TEST(WebRtcVoiceEngineTest, SetRecvCodecs) { | 3513 TEST(WebRtcVoiceEngineTest, SetRecvCodecs) { |
3494 cricket::WebRtcVoiceEngine engine(nullptr); | 3514 cricket::WebRtcVoiceEngine engine(nullptr); |
3495 std::unique_ptr<webrtc::Call> call( | 3515 std::unique_ptr<webrtc::Call> call( |
3496 webrtc::Call::Create(webrtc::Call::Config())); | 3516 webrtc::Call::Create(webrtc::Call::Config())); |
3497 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), | 3517 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), |
3498 cricket::AudioOptions(), call.get()); | 3518 cricket::AudioOptions(), call.get()); |
3499 cricket::AudioRecvParameters parameters; | 3519 cricket::AudioRecvParameters parameters; |
3500 parameters.codecs = engine.codecs(); | 3520 parameters.codecs = engine.codecs(); |
3501 EXPECT_TRUE(channel.SetRecvParameters(parameters)); | 3521 EXPECT_TRUE(channel.SetRecvParameters(parameters)); |
3502 } | 3522 } |
OLD | NEW |