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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 clock_.AdvanceTimeMilliseconds(kBlockSizeMs); | 72 clock_.AdvanceTimeMilliseconds(kBlockSizeMs); |
73 CHECK(audio_source_->Read(input_block_size_samples_, input_frame_.data_)); | 73 CHECK(audio_source_->Read(input_block_size_samples_, input_frame_.data_)); |
74 if (input_frame_.num_channels_ > 1) { | 74 if (input_frame_.num_channels_ > 1) { |
75 InputAudioFile::DuplicateInterleaved(input_frame_.data_, | 75 InputAudioFile::DuplicateInterleaved(input_frame_.data_, |
76 input_block_size_samples_, | 76 input_block_size_samples_, |
77 input_frame_.num_channels_, | 77 input_frame_.num_channels_, |
78 input_frame_.data_); | 78 input_frame_.data_); |
79 } | 79 } |
80 int32_t encoded_bytes = acm_->Add10MsAudio(input_frame_); | 80 int32_t encoded_bytes = acm_->Add10MsAudio(input_frame_); |
81 EXPECT_GE(encoded_bytes, 0); | 81 EXPECT_GE(encoded_bytes, 0); |
82 input_frame_.timestamp_ += input_block_size_samples_; | 82 input_frame_.timestamp_ += static_cast<uint32_t>(input_block_size_samples_); |
83 if (encoded_bytes > 0) { | 83 if (encoded_bytes > 0) { |
84 // Encoded packet received. | 84 // Encoded packet received. |
85 return CreatePacket(); | 85 return CreatePacket(); |
86 } | 86 } |
87 } | 87 } |
88 // Test ended. | 88 // Test ended. |
89 return NULL; | 89 return NULL; |
90 } | 90 } |
91 | 91 |
92 // This method receives the callback from ACM when a new packet is produced. | 92 // This method receives the callback from ACM when a new packet is produced. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 last_payload_vec_.size()); | 132 last_payload_vec_.size()); |
133 Packet* packet = | 133 Packet* packet = |
134 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); | 134 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); |
135 assert(packet); | 135 assert(packet); |
136 assert(packet->valid_header()); | 136 assert(packet->valid_header()); |
137 return packet; | 137 return packet; |
138 } | 138 } |
139 | 139 |
140 } // namespace test | 140 } // namespace test |
141 } // namespace webrtc | 141 } // namespace webrtc |
OLD | NEW |