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 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2859 EXPECT_TRUE(channel->SetSendParameters(parameters)); | 2859 EXPECT_TRUE(channel->SetSendParameters(parameters)); |
2860 EXPECT_EQ(rtc::DSCP_EF, network_interface->dscp()); | 2860 EXPECT_EQ(rtc::DSCP_EF, network_interface->dscp()); |
2861 // Verify previous value is not modified if dscp option is not set. | 2861 // Verify previous value is not modified if dscp option is not set. |
2862 EXPECT_TRUE(channel->SetSendParameters(send_parameters_)); | 2862 EXPECT_TRUE(channel->SetSendParameters(send_parameters_)); |
2863 EXPECT_EQ(rtc::DSCP_EF, network_interface->dscp()); | 2863 EXPECT_EQ(rtc::DSCP_EF, network_interface->dscp()); |
2864 parameters.options.dscp.Set(false); | 2864 parameters.options.dscp.Set(false); |
2865 EXPECT_TRUE(channel->SetSendParameters(parameters)); | 2865 EXPECT_TRUE(channel->SetSendParameters(parameters)); |
2866 EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp()); | 2866 EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp()); |
2867 } | 2867 } |
2868 | 2868 |
2869 // Test that GetReceiveChannelNum returns the default channel for the first | 2869 // Test that GetReceiveChannelId returns the default channel for the first |
2870 // recv stream in 1-1 calls. | 2870 // recv stream in 1-1 calls. |
2871 TEST_F(WebRtcVoiceEngineTestFake, TestGetReceiveChannelNumIn1To1Calls) { | 2871 TEST_F(WebRtcVoiceEngineTestFake, TestGetReceiveChannelIdIn1To1Calls) { |
2872 EXPECT_TRUE(SetupEngine()); | 2872 EXPECT_TRUE(SetupEngine()); |
2873 cricket::WebRtcVoiceMediaChannel* media_channel = | 2873 cricket::WebRtcVoiceMediaChannel* media_channel = |
2874 static_cast<cricket::WebRtcVoiceMediaChannel*>(channel_); | 2874 static_cast<cricket::WebRtcVoiceMediaChannel*>(channel_); |
2875 // Test that GetChannelNum returns the default channel if the SSRC is unknown. | 2875 // Test that GetChannelNum returns the default channel if the SSRC is unknown. |
2876 EXPECT_EQ(media_channel->voe_channel(), | 2876 EXPECT_EQ(media_channel->voe_channel(), |
2877 media_channel->GetReceiveChannelNum(0)); | 2877 media_channel->GetReceiveChannelId(0)); |
2878 cricket::StreamParams stream; | 2878 cricket::StreamParams stream; |
2879 stream.ssrcs.push_back(kSsrc2); | 2879 stream.ssrcs.push_back(kSsrc2); |
2880 EXPECT_TRUE(channel_->AddRecvStream(stream)); | 2880 EXPECT_TRUE(channel_->AddRecvStream(stream)); |
2881 EXPECT_EQ(media_channel->voe_channel(), | 2881 EXPECT_EQ(media_channel->voe_channel(), |
2882 media_channel->GetReceiveChannelNum(kSsrc2)); | 2882 media_channel->GetReceiveChannelId(kSsrc2)); |
2883 } | 2883 } |
2884 | 2884 |
2885 // Test that GetReceiveChannelNum doesn't return the default channel for the | 2885 // Test that GetReceiveChannelId doesn't return the default channel for the |
2886 // first recv stream in conference calls. | 2886 // first recv stream in conference calls. |
2887 TEST_F(WebRtcVoiceEngineTestFake, TestGetChannelNumInConferenceCalls) { | 2887 TEST_F(WebRtcVoiceEngineTestFake, TestGetChannelNumInConferenceCalls) { |
2888 EXPECT_TRUE(SetupEngine()); | 2888 EXPECT_TRUE(SetupEngine()); |
2889 send_parameters_.options = options_conference_; | 2889 send_parameters_.options = options_conference_; |
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->GetReceiveChannelNum(kSsrc2)); | 2897 media_channel->GetReceiveChannelId(kSsrc2)); |
2898 } | 2898 } |
2899 | 2899 |
2900 TEST_F(WebRtcVoiceEngineTestFake, SetOutputScaling) { | 2900 TEST_F(WebRtcVoiceEngineTestFake, SetOutputScaling) { |
2901 EXPECT_TRUE(SetupEngine()); | 2901 EXPECT_TRUE(SetupEngine()); |
2902 float scale, left, right; | 2902 float scale, left, right; |
2903 EXPECT_TRUE(channel_->SetOutputScaling(0, 1, 2)); | 2903 EXPECT_TRUE(channel_->SetOutputScaling(0, 1, 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_EQ(0, voe_.GetOutputVolumePan(channel_id, left, right)); |
2907 EXPECT_DOUBLE_EQ(1, left * scale); | 2907 EXPECT_DOUBLE_EQ(1, left * scale); |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3299 cricket::WebRtcVoiceEngine engine; | 3299 cricket::WebRtcVoiceEngine engine; |
3300 EXPECT_TRUE(engine.Init(rtc::Thread::Current())); | 3300 EXPECT_TRUE(engine.Init(rtc::Thread::Current())); |
3301 rtc::scoped_ptr<webrtc::Call> call( | 3301 rtc::scoped_ptr<webrtc::Call> call( |
3302 webrtc::Call::Create(webrtc::Call::Config())); | 3302 webrtc::Call::Create(webrtc::Call::Config())); |
3303 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(), | 3303 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(), |
3304 call.get()); | 3304 call.get()); |
3305 cricket::AudioRecvParameters parameters; | 3305 cricket::AudioRecvParameters parameters; |
3306 parameters.codecs = engine.codecs(); | 3306 parameters.codecs = engine.codecs(); |
3307 EXPECT_TRUE(channel.SetRecvParameters(parameters)); | 3307 EXPECT_TRUE(channel.SetRecvParameters(parameters)); |
3308 } | 3308 } |
OLD | NEW |