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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 EXPECT_EQ(0, _acmB->RegisterTransportCallback(_channel_B2A.get())); | 110 EXPECT_EQ(0, _acmB->RegisterTransportCallback(_channel_B2A.get())); |
111 _channel_B2A->RegisterReceiverACM(_acmA.get()); | 111 _channel_B2A->RegisterReceiverACM(_acmA.get()); |
112 | 112 |
113 file_name_swb_ = webrtc::test::ResourcePath("audio_coding/testfile32kHz", | 113 file_name_swb_ = webrtc::test::ResourcePath("audio_coding/testfile32kHz", |
114 "pcm"); | 114 "pcm"); |
115 | 115 |
116 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz)); | 116 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz)); |
117 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz)); | 117 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz)); |
118 | 118 |
119 _inFileA.Open(file_name_swb_, 32000, "rb"); | 119 _inFileA.Open(file_name_swb_, 32000, "rb"); |
| 120 // Set test length to 500 ms (50 blocks of 10 ms each). |
| 121 _inFileA.SetNum10MsBlocksToRead(50); |
| 122 // Fast-forward 1 second (100 blocks) since the files start with silence. |
| 123 _inFileA.FastForward(100); |
120 std::string fileNameA = webrtc::test::OutputPath() + "testisac_a.pcm"; | 124 std::string fileNameA = webrtc::test::OutputPath() + "testisac_a.pcm"; |
121 std::string fileNameB = webrtc::test::OutputPath() + "testisac_b.pcm"; | 125 std::string fileNameB = webrtc::test::OutputPath() + "testisac_b.pcm"; |
122 _outFileA.Open(fileNameA, 32000, "wb"); | 126 _outFileA.Open(fileNameA, 32000, "wb"); |
123 _outFileB.Open(fileNameB, 32000, "wb"); | 127 _outFileB.Open(fileNameB, 32000, "wb"); |
124 | 128 |
125 while (!_inFileA.EndOfFile()) { | 129 while (!_inFileA.EndOfFile()) { |
126 Run10ms(); | 130 Run10ms(); |
127 } | 131 } |
128 CodecInst receiveCodec; | 132 CodecInst receiveCodec; |
129 EXPECT_EQ(0, _acmA->ReceiveCodec(&receiveCodec)); | 133 EXPECT_EQ(0, _acmA->ReceiveCodec(&receiveCodec)); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 numSendCodecChanged++; | 334 numSendCodecChanged++; |
331 } | 335 } |
332 } | 336 } |
333 _outFileA.Close(); | 337 _outFileA.Close(); |
334 _outFileB.Close(); | 338 _outFileB.Close(); |
335 _inFileA.Close(); | 339 _inFileA.Close(); |
336 _inFileB.Close(); | 340 _inFileB.Close(); |
337 } | 341 } |
338 | 342 |
339 } // namespace webrtc | 343 } // namespace webrtc |
OLD | NEW |