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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 struct CodecInst sendCodec; | 56 struct CodecInst sendCodec; |
57 int noOfCodecs = acm->NumberOfCodecs(); | 57 int noOfCodecs = acm->NumberOfCodecs(); |
58 int codecNo; | 58 int codecNo; |
59 | 59 |
60 // Open input file | 60 // Open input file |
61 const std::string file_name = webrtc::test::ResourcePath(in_file_name, "pcm"); | 61 const std::string file_name = webrtc::test::ResourcePath(in_file_name, "pcm"); |
62 _pcmFile.Open(file_name, sample_rate, "rb"); | 62 _pcmFile.Open(file_name, sample_rate, "rb"); |
63 if (channels == 2) { | 63 if (channels == 2) { |
64 _pcmFile.ReadStereo(true); | 64 _pcmFile.ReadStereo(true); |
65 } | 65 } |
| 66 // Set test length to 500 ms (50 blocks of 10 ms each). |
| 67 _pcmFile.SetNum10MsBlocksToRead(50); |
| 68 // Fast-forward 1 second (100 blocks) since the file starts with silence. |
| 69 _pcmFile.FastForward(100); |
66 | 70 |
67 // Set the codec for the current test. | 71 // Set the codec for the current test. |
68 if ((testMode == 0) || (testMode == 1)) { | 72 if ((testMode == 0) || (testMode == 1)) { |
69 // Set the codec id. | 73 // Set the codec id. |
70 codecNo = codeId; | 74 codecNo = codeId; |
71 } else { | 75 } else { |
72 // Choose codec on command line. | 76 // Choose codec on command line. |
73 printf("List of supported codec.\n"); | 77 printf("List of supported codec.\n"); |
74 for (int n = 0; n < noOfCodecs; n++) { | 78 for (int n = 0; n < noOfCodecs; n++) { |
75 EXPECT_EQ(0, acm->Codec(n, &sendCodec)); | 79 EXPECT_EQ(0, acm->Codec(n, &sendCodec)); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 if (acm->SendCodec()) { | 346 if (acm->SendCodec()) { |
343 _sender.Run(); | 347 _sender.Run(); |
344 } | 348 } |
345 _sender.Teardown(); | 349 _sender.Teardown(); |
346 rtpFile.Close(); | 350 rtpFile.Close(); |
347 | 351 |
348 return fileName; | 352 return fileName; |
349 } | 353 } |
350 | 354 |
351 } // namespace webrtc | 355 } // namespace webrtc |
OLD | NEW |