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

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl.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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder, 242 int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder,
243 NetEqDecoder codec, 243 NetEqDecoder codec,
244 const std::string& codec_name, 244 const std::string& codec_name,
245 uint8_t rtp_payload_type) { 245 uint8_t rtp_payload_type) {
246 rtc::CritScope lock(&crit_sect_); 246 rtc::CritScope lock(&crit_sect_);
247 LOG(LS_VERBOSE) << "RegisterExternalDecoder " 247 LOG(LS_VERBOSE) << "RegisterExternalDecoder "
248 << static_cast<int>(rtp_payload_type) << " " 248 << static_cast<int>(rtp_payload_type) << " "
249 << static_cast<int>(codec); 249 << static_cast<int>(codec);
250 if (!decoder) { 250 if (!decoder) {
251 LOG(LS_ERROR) << "Cannot register external decoder with NULL pointer"; 251 LOG(LS_ERROR) << "Cannot register external decoder with null pointer";
252 assert(false); 252 assert(false);
253 return kFail; 253 return kFail;
254 } 254 }
255 int ret = decoder_database_->InsertExternal(rtp_payload_type, codec, 255 int ret = decoder_database_->InsertExternal(rtp_payload_type, codec,
256 codec_name, decoder); 256 codec_name, decoder);
257 if (ret != DecoderDatabase::kOK) { 257 if (ret != DecoderDatabase::kOK) {
258 switch (ret) { 258 switch (ret) {
259 case DecoderDatabase::kInvalidRtpPayloadType: 259 case DecoderDatabase::kInvalidRtpPayloadType:
260 error_code_ = kInvalidRtpPayloadType; 260 error_code_ = kInvalidRtpPayloadType;
261 break; 261 break;
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 mute_factor_array_.reset(new int16_t[channels]); 2057 mute_factor_array_.reset(new int16_t[channels]);
2058 for (size_t i = 0; i < channels; ++i) { 2058 for (size_t i = 0; i < channels; ++i) {
2059 mute_factor_array_[i] = 16384; // 1.0 in Q14. 2059 mute_factor_array_[i] = 16384; // 1.0 in Q14.
2060 } 2060 }
2061 2061
2062 ComfortNoiseDecoder* cng_decoder = decoder_database_->GetActiveCngDecoder(); 2062 ComfortNoiseDecoder* cng_decoder = decoder_database_->GetActiveCngDecoder();
2063 if (cng_decoder) 2063 if (cng_decoder)
2064 cng_decoder->Reset(); 2064 cng_decoder->Reset();
2065 2065
2066 // Reinit post-decode VAD with new sample rate. 2066 // Reinit post-decode VAD with new sample rate.
2067 assert(vad_.get()); // Cannot be NULL here. 2067 assert(vad_.get()); // Cannot be nullptr here.
2068 vad_->Init(); 2068 vad_->Init();
2069 2069
2070 // Delete algorithm buffer and create a new one. 2070 // Delete algorithm buffer and create a new one.
2071 algorithm_buffer_.reset(new AudioMultiVector(channels)); 2071 algorithm_buffer_.reset(new AudioMultiVector(channels));
2072 2072
2073 // Delete sync buffer and create a new one. 2073 // Delete sync buffer and create a new one.
2074 sync_buffer_.reset(new SyncBuffer(channels, kSyncBufferSize * fs_mult_)); 2074 sync_buffer_.reset(new SyncBuffer(channels, kSyncBufferSize * fs_mult_));
2075 2075
2076 // Delete BackgroundNoise object and create a new one. 2076 // Delete BackgroundNoise object and create a new one.
2077 background_noise_.reset(new BackgroundNoise(channels)); 2077 background_noise_.reset(new BackgroundNoise(channels));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 } 2129 }
2130 } 2130 }
2131 2131
2132 void NetEqImpl::CreateDecisionLogic() { 2132 void NetEqImpl::CreateDecisionLogic() {
2133 decision_logic_.reset(DecisionLogic::Create( 2133 decision_logic_.reset(DecisionLogic::Create(
2134 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), 2134 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(),
2135 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), 2135 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(),
2136 tick_timer_.get())); 2136 tick_timer_.get()));
2137 } 2137 }
2138 } // namespace webrtc 2138 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698