| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void Receiver::Setup(AudioCodingModule *acm, RTPStream *rtpStream, | 125 void Receiver::Setup(AudioCodingModule *acm, RTPStream *rtpStream, |
| 126 std::string out_file_name, size_t channels) { | 126 std::string out_file_name, size_t channels) { |
| 127 struct CodecInst recvCodec = CodecInst(); | 127 struct CodecInst recvCodec = CodecInst(); |
| 128 int noOfCodecs; | 128 int noOfCodecs; |
| 129 EXPECT_EQ(0, acm->InitializeReceiver()); | 129 EXPECT_EQ(0, acm->InitializeReceiver()); |
| 130 | 130 |
| 131 noOfCodecs = acm->NumberOfCodecs(); | 131 noOfCodecs = acm->NumberOfCodecs(); |
| 132 for (int i = 0; i < noOfCodecs; i++) { | 132 for (int i = 0; i < noOfCodecs; i++) { |
| 133 EXPECT_EQ(0, acm->Codec(i, &recvCodec)); | 133 EXPECT_EQ(0, acm->Codec(i, &recvCodec)); |
| 134 if (recvCodec.channels == channels) | 134 if (recvCodec.channels == channels) |
| 135 EXPECT_EQ(0, acm->RegisterReceiveCodec(recvCodec)); | 135 EXPECT_EQ(true, acm->RegisterReceiveCodec(recvCodec.pltype, |
| 136 CodecInstToSdp(recvCodec))); |
| 136 // Forces mono/stereo for Opus. | 137 // Forces mono/stereo for Opus. |
| 137 if (!strcmp(recvCodec.plname, "opus")) { | 138 if (!strcmp(recvCodec.plname, "opus")) { |
| 138 recvCodec.channels = channels; | 139 recvCodec.channels = channels; |
| 139 EXPECT_EQ(0, acm->RegisterReceiveCodec(recvCodec)); | 140 EXPECT_EQ(true, acm->RegisterReceiveCodec(recvCodec.pltype, |
| 141 CodecInstToSdp(recvCodec))); |
| 140 } | 142 } |
| 141 } | 143 } |
| 142 | 144 |
| 143 int playSampFreq; | 145 int playSampFreq; |
| 144 std::string file_name; | 146 std::string file_name; |
| 145 std::stringstream file_stream; | 147 std::stringstream file_stream; |
| 146 file_stream << webrtc::test::OutputPath() << out_file_name | 148 file_stream << webrtc::test::OutputPath() << out_file_name |
| 147 << static_cast<int>(codeId) << ".pcm"; | 149 << static_cast<int>(codeId) << ".pcm"; |
| 148 file_name = file_stream.str(); | 150 file_name = file_stream.str(); |
| 149 _rtpStream = rtpStream; | 151 _rtpStream = rtpStream; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 if (acm->SendCodec()) { | 352 if (acm->SendCodec()) { |
| 351 _sender.Run(); | 353 _sender.Run(); |
| 352 } | 354 } |
| 353 _sender.Teardown(); | 355 _sender.Teardown(); |
| 354 rtpFile.Close(); | 356 rtpFile.Close(); |
| 355 | 357 |
| 356 return fileName; | 358 return fileName; |
| 357 } | 359 } |
| 358 | 360 |
| 359 } // namespace webrtc | 361 } // namespace webrtc |
| OLD | NEW |