| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 // Start up a single remote stream. | 181 // Start up a single remote stream. |
| 182 void StartRemoteStream(int stream, const CodecInst& codec_inst, int port) { | 182 void StartRemoteStream(int stream, const CodecInst& codec_inst, int port) { |
| 183 EXPECT_EQ(0, voe_codec_->SetRecPayloadType(stream, codec_inst)); | 183 EXPECT_EQ(0, voe_codec_->SetRecPayloadType(stream, codec_inst)); |
| 184 EXPECT_EQ(0, voe_network_->RegisterExternalTransport(stream, *transport_)); | 184 EXPECT_EQ(0, voe_network_->RegisterExternalTransport(stream, *transport_)); |
| 185 EXPECT_EQ(0, voe_rtp_rtcp_->SetLocalSSRC( | 185 EXPECT_EQ(0, voe_rtp_rtcp_->SetLocalSSRC( |
| 186 stream, static_cast<unsigned int>(stream))); | 186 stream, static_cast<unsigned int>(stream))); |
| 187 transport_->AddChannel(stream, stream); | 187 transport_->AddChannel(stream, stream); |
| 188 EXPECT_EQ(0, voe_base_->StartReceive(stream)); | |
| 189 EXPECT_EQ(0, voe_base_->StartPlayout(stream)); | 188 EXPECT_EQ(0, voe_base_->StartPlayout(stream)); |
| 190 EXPECT_EQ(0, voe_codec_->SetSendCodec(stream, codec_inst)); | 189 EXPECT_EQ(0, voe_codec_->SetSendCodec(stream, codec_inst)); |
| 191 EXPECT_EQ(0, voe_base_->StartSend(stream)); | 190 EXPECT_EQ(0, voe_base_->StartSend(stream)); |
| 192 EXPECT_EQ(0, voe_file_->StartPlayingFileAsMicrophone(stream, | 191 EXPECT_EQ(0, voe_file_->StartPlayingFileAsMicrophone(stream, |
| 193 input_filename_.c_str(), true)); | 192 input_filename_.c_str(), true)); |
| 194 } | 193 } |
| 195 | 194 |
| 196 void StopRemoteStreams(const std::vector<int>& streams) { | 195 void StopRemoteStreams(const std::vector<int>& streams) { |
| 197 for (size_t i = 0; i < streams.size(); ++i) { | 196 for (size_t i = 0; i < streams.size(); ++i) { |
| 198 EXPECT_EQ(0, voe_base_->StopSend(streams[i])); | 197 EXPECT_EQ(0, voe_base_->StopSend(streams[i])); |
| 199 EXPECT_EQ(0, voe_base_->StopPlayout(streams[i])); | 198 EXPECT_EQ(0, voe_base_->StopPlayout(streams[i])); |
| 200 EXPECT_EQ(0, voe_base_->StopReceive(streams[i])); | |
| 201 EXPECT_EQ(0, voe_network_->DeRegisterExternalTransport(streams[i])); | 199 EXPECT_EQ(0, voe_network_->DeRegisterExternalTransport(streams[i])); |
| 202 EXPECT_EQ(0, voe_base_->DeleteChannel(streams[i])); | 200 EXPECT_EQ(0, voe_base_->DeleteChannel(streams[i])); |
| 203 } | 201 } |
| 204 } | 202 } |
| 205 | 203 |
| 206 int GetFileDurationMs(const char* file_name) { | 204 int GetFileDurationMs(const char* file_name) { |
| 207 FILE* fid = fopen(file_name, "rb"); | 205 FILE* fid = fopen(file_name, "rb"); |
| 208 EXPECT_FALSE(fid == NULL); | 206 EXPECT_FALSE(fid == NULL); |
| 209 fseek(fid, 0, SEEK_END); | 207 fseek(fid, 0, SEEK_END); |
| 210 int size = ftell(fid); | 208 int size = ftell(fid); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 277 |
| 280 TEST_F(MixingTest, VerifyStereoAndMonoMixing) { | 278 TEST_F(MixingTest, VerifyStereoAndMonoMixing) { |
| 281 const int16_t kInputValue = 1000; | 279 const int16_t kInputValue = 1000; |
| 282 const int16_t kExpectedOutput = kInputValue * 2; | 280 const int16_t kExpectedOutput = kInputValue * 2; |
| 283 RunMixingTest(2, 0, 1, false, kInputValue, 1.1 * kExpectedOutput, | 281 RunMixingTest(2, 0, 1, false, kInputValue, 1.1 * kExpectedOutput, |
| 284 // Lower than 0.9 due to observed flakiness on bots. | 282 // Lower than 0.9 due to observed flakiness on bots. |
| 285 0.8 * kExpectedOutput, kCodecL16); | 283 0.8 * kExpectedOutput, kCodecL16); |
| 286 } | 284 } |
| 287 | 285 |
| 288 } // namespace webrtc | 286 } // namespace webrtc |
| OLD | NEW |