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

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl.cc

Issue 2027993002: NetEq: Ask AudioDecoder for sample rate instead of passing it as an argument (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@samprate1
Patch Set: rebase Created 4 years, 6 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 error_code_ = kOtherError; 253 error_code_ = kOtherError;
254 } 254 }
255 return kFail; 255 return kFail;
256 } 256 }
257 return kOK; 257 return kOK;
258 } 258 }
259 259
260 int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder, 260 int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder,
261 NetEqDecoder codec, 261 NetEqDecoder codec,
262 const std::string& codec_name, 262 const std::string& codec_name,
263 uint8_t rtp_payload_type, 263 uint8_t rtp_payload_type) {
264 int sample_rate_hz) {
265 rtc::CritScope lock(&crit_sect_); 264 rtc::CritScope lock(&crit_sect_);
266 LOG(LS_VERBOSE) << "RegisterExternalDecoder " 265 LOG(LS_VERBOSE) << "RegisterExternalDecoder "
267 << static_cast<int>(rtp_payload_type) << " " 266 << static_cast<int>(rtp_payload_type) << " "
268 << static_cast<int>(codec); 267 << static_cast<int>(codec);
269 if (!decoder) { 268 if (!decoder) {
270 LOG(LS_ERROR) << "Cannot register external decoder with NULL pointer"; 269 LOG(LS_ERROR) << "Cannot register external decoder with NULL pointer";
271 assert(false); 270 assert(false);
272 return kFail; 271 return kFail;
273 } 272 }
274 int ret = decoder_database_->InsertExternal( 273 int ret = decoder_database_->InsertExternal(rtp_payload_type, codec,
275 rtp_payload_type, codec, codec_name, sample_rate_hz, decoder); 274 codec_name, decoder);
276 if (ret != DecoderDatabase::kOK) { 275 if (ret != DecoderDatabase::kOK) {
277 switch (ret) { 276 switch (ret) {
278 case DecoderDatabase::kInvalidRtpPayloadType: 277 case DecoderDatabase::kInvalidRtpPayloadType:
279 error_code_ = kInvalidRtpPayloadType; 278 error_code_ = kInvalidRtpPayloadType;
280 break; 279 break;
281 case DecoderDatabase::kCodecNotSupported: 280 case DecoderDatabase::kCodecNotSupported:
282 error_code_ = kCodecNotSupported; 281 error_code_ = kCodecNotSupported;
283 break; 282 break;
284 case DecoderDatabase::kDecoderExists: 283 case DecoderDatabase::kDecoderExists:
285 error_code_ = kDecoderExists; 284 error_code_ = kDecoderExists;
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after
2167 } 2166 }
2168 } 2167 }
2169 2168
2170 void NetEqImpl::CreateDecisionLogic() { 2169 void NetEqImpl::CreateDecisionLogic() {
2171 decision_logic_.reset(DecisionLogic::Create( 2170 decision_logic_.reset(DecisionLogic::Create(
2172 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), 2171 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(),
2173 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), 2172 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(),
2174 tick_timer_.get())); 2173 tick_timer_.get()));
2175 } 2174 }
2176 } // namespace webrtc 2175 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.h ('k') | webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698