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

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

Issue 2351183002: AcmReceiver: Eliminate AcmReceiver::decoders_ (Closed)
Patch Set: case-insensitive string comparison Created 4 years, 3 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 rtc::MsanMarkUninitialized(rtc::MakeArrayView(&ci, 1)); 450 rtc::MsanMarkUninitialized(rtc::MakeArrayView(&ci, 1));
451 ci.pltype = payload_type; 451 ci.pltype = payload_type;
452 std::strncpy(ci.plname, di->name.c_str(), sizeof(ci.plname)); 452 std::strncpy(ci.plname, di->name.c_str(), sizeof(ci.plname));
453 ci.plname[sizeof(ci.plname) - 1] = '\0'; 453 ci.plname[sizeof(ci.plname) - 1] = '\0';
454 ci.plfreq = di->IsRed() || di->IsDtmf() ? 8000 : di->SampleRateHz(); 454 ci.plfreq = di->IsRed() || di->IsDtmf() ? 8000 : di->SampleRateHz();
455 AudioDecoder* const decoder = di->GetDecoder(); 455 AudioDecoder* const decoder = di->GetDecoder();
456 ci.channels = decoder ? decoder->Channels() : 1; 456 ci.channels = decoder ? decoder->Channels() : 1;
457 return rtc::Optional<CodecInst>(ci); 457 return rtc::Optional<CodecInst>(ci);
458 } 458 }
459 459
460 const SdpAudioFormat* NetEqImpl::GetDecoderFormat(int payload_type) const {
461 rtc::CritScope lock(&crit_sect_);
462 const DecoderDatabase::DecoderInfo* const di =
463 decoder_database_->GetDecoderInfo(payload_type);
464 if (!di) {
465 return nullptr; // Payload type not registered.
466 }
467 // This will return null if the payload type was registered without an
468 // SdpAudioFormat.
469 return di->GetFormat();
470 }
471
460 int NetEqImpl::SetTargetNumberOfChannels() { 472 int NetEqImpl::SetTargetNumberOfChannels() {
461 return kNotImplemented; 473 return kNotImplemented;
462 } 474 }
463 475
464 int NetEqImpl::SetTargetSampleRate() { 476 int NetEqImpl::SetTargetSampleRate() {
465 return kNotImplemented; 477 return kNotImplemented;
466 } 478 }
467 479
468 int NetEqImpl::LastError() const { 480 int NetEqImpl::LastError() const {
469 rtc::CritScope lock(&crit_sect_); 481 rtc::CritScope lock(&crit_sect_);
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 } 2113 }
2102 } 2114 }
2103 2115
2104 void NetEqImpl::CreateDecisionLogic() { 2116 void NetEqImpl::CreateDecisionLogic() {
2105 decision_logic_.reset(DecisionLogic::Create( 2117 decision_logic_.reset(DecisionLogic::Create(
2106 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), 2118 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(),
2107 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), 2119 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(),
2108 tick_timer_.get())); 2120 tick_timer_.get()));
2109 } 2121 }
2110 } // namespace webrtc 2122 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.h ('k') | webrtc/modules/audio_coding/neteq/timestamp_scaler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698