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

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

Issue 2355503002: Stopped using the NetEqDecoder enum internally in NetEq. (Closed)
Patch Set: 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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 RTC_DCHECK(nack_); 735 RTC_DCHECK(nack_);
736 // Update the sample rate even if the rate is not new, because of Reset(). 736 // Update the sample rate even if the rate is not new, because of Reset().
737 nack_->UpdateSampleRate(fs_hz_); 737 nack_->UpdateSampleRate(fs_hz_);
738 } 738 }
739 } 739 }
740 740
741 // TODO(hlundin): Move this code to DelayManager class. 741 // TODO(hlundin): Move this code to DelayManager class.
742 const DecoderDatabase::DecoderInfo* dec_info = 742 const DecoderDatabase::DecoderInfo* dec_info =
743 decoder_database_->GetDecoderInfo(main_header.payloadType); 743 decoder_database_->GetDecoderInfo(main_header.payloadType);
744 assert(dec_info); // Already checked that the payload type is known. 744 assert(dec_info); // Already checked that the payload type is known.
745 delay_manager_->LastDecoderType(dec_info->codec_type); 745 delay_manager_->LastDecodedWasCngOrDtmf(dec_info->IsComfortNoise() ||
746 dec_info->IsDtmf());
746 if (delay_manager_->last_pack_cng_or_dtmf() == 0) { 747 if (delay_manager_->last_pack_cng_or_dtmf() == 0) {
747 // Calculate the total speech length carried in each packet. 748 // Calculate the total speech length carried in each packet.
748 const size_t buffer_length_after_insert = 749 const size_t buffer_length_after_insert =
749 packet_buffer_->NumPacketsInBuffer(); 750 packet_buffer_->NumPacketsInBuffer();
750 751
751 if (buffer_length_after_insert > buffer_length_before_insert) { 752 if (buffer_length_after_insert > buffer_length_before_insert) {
752 const size_t packet_length_samples = 753 const size_t packet_length_samples =
753 (buffer_length_after_insert - buffer_length_before_insert) * 754 (buffer_length_after_insert - buffer_length_before_insert) *
754 decoder_frame_length_; 755 decoder_frame_length_;
755 if (packet_length_samples != decision_logic_->packet_length_samples()) { 756 if (packet_length_samples != decision_logic_->packet_length_samples()) {
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 } 2071 }
2071 } 2072 }
2072 2073
2073 void NetEqImpl::CreateDecisionLogic() { 2074 void NetEqImpl::CreateDecisionLogic() {
2074 decision_logic_.reset(DecisionLogic::Create( 2075 decision_logic_.reset(DecisionLogic::Create(
2075 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), 2076 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(),
2076 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), 2077 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(),
2077 tick_timer_.get())); 2078 tick_timer_.get()));
2078 } 2079 }
2079 } // namespace webrtc 2080 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698