| OLD | NEW |
| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 return rtc::Optional<CodecInst>(); | 473 return rtc::Optional<CodecInst>(); |
| 474 } | 474 } |
| 475 | 475 |
| 476 // Create a CodecInst with some fields set. The remaining fields are zeroed, | 476 // Create a CodecInst with some fields set. The remaining fields are zeroed, |
| 477 // but we tell MSan to consider them uninitialized. | 477 // but we tell MSan to consider them uninitialized. |
| 478 CodecInst ci = {0}; | 478 CodecInst ci = {0}; |
| 479 rtc::MsanMarkUninitialized(rtc::MakeArrayView(&ci, 1)); | 479 rtc::MsanMarkUninitialized(rtc::MakeArrayView(&ci, 1)); |
| 480 ci.pltype = payload_type; | 480 ci.pltype = payload_type; |
| 481 std::strncpy(ci.plname, di->name.c_str(), sizeof(ci.plname)); | 481 std::strncpy(ci.plname, di->name.c_str(), sizeof(ci.plname)); |
| 482 ci.plname[sizeof(ci.plname) - 1] = '\0'; | 482 ci.plname[sizeof(ci.plname) - 1] = '\0'; |
| 483 ci.plfreq = di->IsRed() || di->IsDtmf() ? 8000 : di->SampleRateHz(); | 483 ci.plfreq = di->IsRed() ? 8000 : di->SampleRateHz(); |
| 484 AudioDecoder* const decoder = di->GetDecoder(); | 484 AudioDecoder* const decoder = di->GetDecoder(); |
| 485 ci.channels = decoder ? decoder->Channels() : 1; | 485 ci.channels = decoder ? decoder->Channels() : 1; |
| 486 return rtc::Optional<CodecInst>(ci); | 486 return rtc::Optional<CodecInst>(ci); |
| 487 } | 487 } |
| 488 | 488 |
| 489 rtc::Optional<SdpAudioFormat> NetEqImpl::GetDecoderFormat( | 489 rtc::Optional<SdpAudioFormat> NetEqImpl::GetDecoderFormat( |
| 490 int payload_type) const { | 490 int payload_type) const { |
| 491 rtc::CritScope lock(&crit_sect_); | 491 rtc::CritScope lock(&crit_sect_); |
| 492 const DecoderDatabase::DecoderInfo* const di = | 492 const DecoderDatabase::DecoderInfo* const di = |
| 493 decoder_database_->GetDecoderInfo(payload_type); | 493 decoder_database_->GetDecoderInfo(payload_type); |
| (...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2138 } | 2138 } |
| 2139 } | 2139 } |
| 2140 | 2140 |
| 2141 void NetEqImpl::CreateDecisionLogic() { | 2141 void NetEqImpl::CreateDecisionLogic() { |
| 2142 decision_logic_.reset(DecisionLogic::Create( | 2142 decision_logic_.reset(DecisionLogic::Create( |
| 2143 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), | 2143 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), |
| 2144 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), | 2144 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), |
| 2145 tick_timer_.get())); | 2145 tick_timer_.get())); |
| 2146 } | 2146 } |
| 2147 } // namespace webrtc | 2147 } // namespace webrtc |
| OLD | NEW |