OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 228 |
229 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) || defined(WEBRTC_ARCH_ARM) | 229 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) || defined(WEBRTC_ARCH_ARM) |
230 // If we are on Android, iOS and/or ARM, use a lower complexity setting as | 230 // If we are on Android, iOS and/or ARM, use a lower complexity setting as |
231 // default. | 231 // default. |
232 const int kOpusComplexity5 = 5; | 232 const int kOpusComplexity5 = 5; |
233 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_mono_encoder_, kOpusComplexity5)); | 233 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_mono_encoder_, kOpusComplexity5)); |
234 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_stereo_encoder_, | 234 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_stereo_encoder_, |
235 kOpusComplexity5)); | 235 kOpusComplexity5)); |
236 #endif | 236 #endif |
237 | 237 |
238 // Make sure the runtime is less than 60 seconds to pass Android test. | 238 // Fast-forward 1 second (100 blocks) since the files start with silence. |
239 for (size_t audio_length = 0; audio_length < 10000; audio_length += 10) { | 239 in_file_stereo_.FastForward(100); |
| 240 in_file_mono_.FastForward(100); |
| 241 |
| 242 // Limit the runtime to 1000 blocks of 10 ms each. |
| 243 for (size_t audio_length = 0; audio_length < 1000; audio_length += 10) { |
240 bool lost_packet = false; | 244 bool lost_packet = false; |
241 | 245 |
242 // Get 10 msec of audio. | 246 // Get 10 msec of audio. |
243 if (channels == 1) { | 247 if (channels == 1) { |
244 if (in_file_mono_.EndOfFile()) { | 248 if (in_file_mono_.EndOfFile()) { |
245 break; | 249 break; |
246 } | 250 } |
247 in_file_mono_.Read10MsData(audio_frame); | 251 in_file_mono_.Read10MsData(audio_frame); |
248 } else { | 252 } else { |
249 if (in_file_stereo_.EndOfFile()) { | 253 if (in_file_stereo_.EndOfFile()) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 out_file_.Open(file_name, 48000, "wb"); | 375 out_file_.Open(file_name, 48000, "wb"); |
372 file_stream.str(""); | 376 file_stream.str(""); |
373 file_name = file_stream.str(); | 377 file_name = file_stream.str(); |
374 file_stream << webrtc::test::OutputPath() << "opusstandalone_out_" | 378 file_stream << webrtc::test::OutputPath() << "opusstandalone_out_" |
375 << test_number << ".pcm"; | 379 << test_number << ".pcm"; |
376 file_name = file_stream.str(); | 380 file_name = file_stream.str(); |
377 out_file_standalone_.Open(file_name, 48000, "wb"); | 381 out_file_standalone_.Open(file_name, 48000, "wb"); |
378 } | 382 } |
379 | 383 |
380 } // namespace webrtc | 384 } // namespace webrtc |
OLD | NEW |