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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 clock_.AdvanceTimeMilliseconds(kBlockSizeMs); | 85 clock_.AdvanceTimeMilliseconds(kBlockSizeMs); |
86 CHECK(audio_source_->Read(input_block_size_samples_, input_frame_.data_)); | 86 CHECK(audio_source_->Read(input_block_size_samples_, input_frame_.data_)); |
87 if (input_frame_.num_channels_ > 1) { | 87 if (input_frame_.num_channels_ > 1) { |
88 InputAudioFile::DuplicateInterleaved(input_frame_.data_, | 88 InputAudioFile::DuplicateInterleaved(input_frame_.data_, |
89 input_block_size_samples_, | 89 input_block_size_samples_, |
90 input_frame_.num_channels_, | 90 input_frame_.num_channels_, |
91 input_frame_.data_); | 91 input_frame_.data_); |
92 } | 92 } |
93 data_to_send_ = false; | 93 data_to_send_ = false; |
94 CHECK_GE(acm_->Add10MsData(input_frame_), 0); | 94 CHECK_GE(acm_->Add10MsData(input_frame_), 0); |
95 input_frame_.timestamp_ += input_block_size_samples_; | 95 input_frame_.timestamp_ += static_cast<uint32_t>(input_block_size_samples_); |
96 if (data_to_send_) { | 96 if (data_to_send_) { |
97 // Encoded packet received. | 97 // Encoded packet received. |
98 return CreatePacket(); | 98 return CreatePacket(); |
99 } | 99 } |
100 } | 100 } |
101 // Test ended. | 101 // Test ended. |
102 return NULL; | 102 return NULL; |
103 } | 103 } |
104 | 104 |
105 // This method receives the callback from ACM when a new packet is produced. | 105 // This method receives the callback from ACM when a new packet is produced. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 last_payload_vec_.size()); | 147 last_payload_vec_.size()); |
148 Packet* packet = | 148 Packet* packet = |
149 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); | 149 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); |
150 assert(packet); | 150 assert(packet); |
151 assert(packet->valid_header()); | 151 assert(packet->valid_header()); |
152 return packet; | 152 return packet; |
153 } | 153 } |
154 | 154 |
155 } // namespace test | 155 } // namespace test |
156 } // namespace webrtc | 156 } // namespace webrtc |
OLD | NEW |