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

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

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 assert(input_block_size_samples_ * input_frame_.num_channels_ <= 73 assert(input_block_size_samples_ * input_frame_.num_channels_ <=
74 AudioFrame::kMaxDataSizeSamples); 74 AudioFrame::kMaxDataSizeSamples);
75 return codec_registered_ = true; 75 return codec_registered_ = true;
76 } 76 }
77 77
78 std::unique_ptr<Packet> AcmSendTestOldApi::NextPacket() { 78 std::unique_ptr<Packet> AcmSendTestOldApi::NextPacket() {
79 assert(codec_registered_); 79 assert(codec_registered_);
80 if (filter_.test(static_cast<size_t>(payload_type_))) { 80 if (filter_.test(static_cast<size_t>(payload_type_))) {
81 // This payload type should be filtered out. Since the payload type is the 81 // This payload type should be filtered out. Since the payload type is the
82 // same throughout the whole test run, no packet at all will be delivered. 82 // same throughout the whole test run, no packet at all will be delivered.
83 // We can just as well signal that the test is over by returning NULL. 83 // We can just as well signal that the test is over by returning null.
84 return nullptr; 84 return nullptr;
85 } 85 }
86 // Insert audio and process until one packet is produced. 86 // Insert audio and process until one packet is produced.
87 while (clock_.TimeInMilliseconds() < test_duration_ms_) { 87 while (clock_.TimeInMilliseconds() < test_duration_ms_) {
88 clock_.AdvanceTimeMilliseconds(kBlockSizeMs); 88 clock_.AdvanceTimeMilliseconds(kBlockSizeMs);
89 RTC_CHECK( 89 RTC_CHECK(
90 audio_source_->Read(input_block_size_samples_, input_frame_.data_)); 90 audio_source_->Read(input_block_size_samples_, input_frame_.data_));
91 if (input_frame_.num_channels_ > 1) { 91 if (input_frame_.num_channels_ > 1) {
92 InputAudioFile::DuplicateInterleaved(input_frame_.data_, 92 InputAudioFile::DuplicateInterleaved(input_frame_.data_,
93 input_block_size_samples_, 93 input_block_size_samples_,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 last_payload_vec_.size()); 151 last_payload_vec_.size());
152 std::unique_ptr<Packet> packet( 152 std::unique_ptr<Packet> packet(
153 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds())); 153 new Packet(packet_memory, allocated_bytes, clock_.TimeInMilliseconds()));
154 RTC_DCHECK(packet); 154 RTC_DCHECK(packet);
155 RTC_DCHECK(packet->valid_header()); 155 RTC_DCHECK(packet->valid_header());
156 return packet; 156 return packet;
157 } 157 }
158 158
159 } // namespace test 159 } // namespace test
160 } // namespace webrtc 160 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698