Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/acm_send_test.cc

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11 matching lines...) Expand all
22 22
23 namespace webrtc { 23 namespace webrtc {
24 namespace test { 24 namespace test {
25 25
26 AcmSendTest::AcmSendTest(InputAudioFile* audio_source, 26 AcmSendTest::AcmSendTest(InputAudioFile* audio_source,
27 int source_rate_hz, 27 int source_rate_hz,
28 int test_duration_ms) 28 int test_duration_ms)
29 : clock_(0), 29 : clock_(0),
30 audio_source_(audio_source), 30 audio_source_(audio_source),
31 source_rate_hz_(source_rate_hz), 31 source_rate_hz_(source_rate_hz),
32 input_block_size_samples_(source_rate_hz_ * kBlockSizeMs / 1000), 32 input_block_size_samples_(
33 static_cast<size_t>(source_rate_hz_ * kBlockSizeMs / 1000)),
33 codec_registered_(false), 34 codec_registered_(false),
34 test_duration_ms_(test_duration_ms), 35 test_duration_ms_(test_duration_ms),
35 frame_type_(kAudioFrameSpeech), 36 frame_type_(kAudioFrameSpeech),
36 payload_type_(0), 37 payload_type_(0),
37 timestamp_(0), 38 timestamp_(0),
38 sequence_number_(0) { 39 sequence_number_(0) {
39 webrtc::AudioCoding::Config config; 40 webrtc::AudioCoding::Config config;
40 config.clock = &clock_; 41 config.clock = &clock_;
41 config.transport = this; 42 config.transport = this;
42 acm_.reset(webrtc::AudioCoding::Create(config)); 43 acm_.reset(webrtc::AudioCoding::Create(config));
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 last_payload_vec_.size()); 133 last_payload_vec_.size());
133 Packet* packet = 134 Packet* packet =
134 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()); 135 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds());
135 assert(packet); 136 assert(packet);
136 assert(packet->valid_header()); 137 assert(packet->valid_header());
137 return packet; 138 return packet;
138 } 139 }
139 140
140 } // namespace test 141 } // namespace test
141 } // namespace webrtc 142 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_send_test.h ('k') | webrtc/modules/audio_coding/main/acm2/acm_send_test_oldapi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698