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 13 matching lines...) Expand all Loading... |
24 namespace webrtc { | 24 namespace webrtc { |
25 namespace test { | 25 namespace test { |
26 | 26 |
27 AcmSendTestOldApi::AcmSendTestOldApi(InputAudioFile* audio_source, | 27 AcmSendTestOldApi::AcmSendTestOldApi(InputAudioFile* audio_source, |
28 int source_rate_hz, | 28 int source_rate_hz, |
29 int test_duration_ms) | 29 int test_duration_ms) |
30 : clock_(0), | 30 : clock_(0), |
31 acm_(webrtc::AudioCodingModule::Create(0, &clock_)), | 31 acm_(webrtc::AudioCodingModule::Create(0, &clock_)), |
32 audio_source_(audio_source), | 32 audio_source_(audio_source), |
33 source_rate_hz_(source_rate_hz), | 33 source_rate_hz_(source_rate_hz), |
34 input_block_size_samples_(source_rate_hz_ * kBlockSizeMs / 1000), | 34 input_block_size_samples_( |
| 35 static_cast<size_t>(source_rate_hz_ * kBlockSizeMs / 1000)), |
35 codec_registered_(false), | 36 codec_registered_(false), |
36 test_duration_ms_(test_duration_ms), | 37 test_duration_ms_(test_duration_ms), |
37 frame_type_(kAudioFrameSpeech), | 38 frame_type_(kAudioFrameSpeech), |
38 payload_type_(0), | 39 payload_type_(0), |
39 timestamp_(0), | 40 timestamp_(0), |
40 sequence_number_(0) { | 41 sequence_number_(0) { |
41 input_frame_.sample_rate_hz_ = source_rate_hz_; | 42 input_frame_.sample_rate_hz_ = source_rate_hz_; |
42 input_frame_.num_channels_ = 1; | 43 input_frame_.num_channels_ = 1; |
43 input_frame_.samples_per_channel_ = input_block_size_samples_; | 44 input_frame_.samples_per_channel_ = input_block_size_samples_; |
44 assert(input_block_size_samples_ * input_frame_.num_channels_ <= | 45 assert(input_block_size_samples_ * input_frame_.num_channels_ <= |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 last_payload_vec_.size()); | 148 last_payload_vec_.size()); |
148 Packet* packet = | 149 Packet* packet = |
149 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); | 150 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); |
150 assert(packet); | 151 assert(packet); |
151 assert(packet->valid_header()); | 152 assert(packet->valid_header()); |
152 return packet; | 153 return packet; |
153 } | 154 } |
154 | 155 |
155 } // namespace test | 156 } // namespace test |
156 } // namespace webrtc | 157 } // namespace webrtc |
OLD | NEW |