| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 assert(codec_registered_); | 64 assert(codec_registered_); |
| 65 if (filter_.test(static_cast<size_t>(payload_type_))) { | 65 if (filter_.test(static_cast<size_t>(payload_type_))) { |
| 66 // This payload type should be filtered out. Since the payload type is the | 66 // This payload type should be filtered out. Since the payload type is the |
| 67 // same throughout the whole test run, no packet at all will be delivered. | 67 // same throughout the whole test run, no packet at all will be delivered. |
| 68 // We can just as well signal that the test is over by returning NULL. | 68 // We can just as well signal that the test is over by returning NULL. |
| 69 return NULL; | 69 return NULL; |
| 70 } | 70 } |
| 71 // Insert audio and process until one packet is produced. | 71 // Insert audio and process until one packet is produced. |
| 72 while (clock_.TimeInMilliseconds() < test_duration_ms_) { | 72 while (clock_.TimeInMilliseconds() < test_duration_ms_) { |
| 73 clock_.AdvanceTimeMilliseconds(kBlockSizeMs); | 73 clock_.AdvanceTimeMilliseconds(kBlockSizeMs); |
| 74 CHECK(audio_source_->Read(input_block_size_samples_, input_frame_.data_)); | 74 RTC_CHECK( |
| 75 audio_source_->Read(input_block_size_samples_, input_frame_.data_)); |
| 75 if (input_frame_.num_channels_ > 1) { | 76 if (input_frame_.num_channels_ > 1) { |
| 76 InputAudioFile::DuplicateInterleaved(input_frame_.data_, | 77 InputAudioFile::DuplicateInterleaved(input_frame_.data_, |
| 77 input_block_size_samples_, | 78 input_block_size_samples_, |
| 78 input_frame_.num_channels_, | 79 input_frame_.num_channels_, |
| 79 input_frame_.data_); | 80 input_frame_.data_); |
| 80 } | 81 } |
| 81 int32_t encoded_bytes = acm_->Add10MsAudio(input_frame_); | 82 int32_t encoded_bytes = acm_->Add10MsAudio(input_frame_); |
| 82 EXPECT_GE(encoded_bytes, 0); | 83 EXPECT_GE(encoded_bytes, 0); |
| 83 input_frame_.timestamp_ += static_cast<uint32_t>(input_block_size_samples_); | 84 input_frame_.timestamp_ += static_cast<uint32_t>(input_block_size_samples_); |
| 84 if (encoded_bytes > 0) { | 85 if (encoded_bytes > 0) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 last_payload_vec_.size()); | 134 last_payload_vec_.size()); |
| 134 Packet* packet = | 135 Packet* packet = |
| 135 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); | 136 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); |
| 136 assert(packet); | 137 assert(packet); |
| 137 assert(packet->valid_header()); | 138 assert(packet->valid_header()); |
| 138 return packet; | 139 return packet; |
| 139 } | 140 } |
| 140 | 141 |
| 141 } // namespace test | 142 } // namespace test |
| 142 } // namespace webrtc | 143 } // namespace webrtc |
| OLD | NEW |