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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 int16_t* output, | 705 int16_t* output, |
706 size_t* samples_per_channel, | 706 size_t* samples_per_channel, |
707 int* num_channels) { | 707 int* num_channels) { |
708 PacketList packet_list; | 708 PacketList packet_list; |
709 DtmfEvent dtmf_event; | 709 DtmfEvent dtmf_event; |
710 Operations operation; | 710 Operations operation; |
711 bool play_dtmf; | 711 bool play_dtmf; |
712 int return_value = GetDecision(&operation, &packet_list, &dtmf_event, | 712 int return_value = GetDecision(&operation, &packet_list, &dtmf_event, |
713 &play_dtmf); | 713 &play_dtmf); |
714 if (return_value != 0) { | 714 if (return_value != 0) { |
715 assert(false); | |
716 last_mode_ = kModeError; | 715 last_mode_ = kModeError; |
717 return return_value; | 716 return return_value; |
718 } | 717 } |
719 LOG(LS_VERBOSE) << "GetDecision returned operation=" << operation << | 718 LOG(LS_VERBOSE) << "GetDecision returned operation=" << operation << |
720 " and " << packet_list.size() << " packet(s)"; | 719 " and " << packet_list.size() << " packet(s)"; |
721 | 720 |
722 AudioDecoder::SpeechType speech_type; | 721 AudioDecoder::SpeechType speech_type; |
723 int length = 0; | 722 int length = 0; |
724 int decode_return_value = Decode(&packet_list, &operation, | 723 int decode_return_value = Decode(&packet_list, &operation, |
725 &length, &speech_type); | 724 &length, &speech_type); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 | 972 |
974 decision_logic_->ExpandDecision(*operation); | 973 decision_logic_->ExpandDecision(*operation); |
975 | 974 |
976 // Check conditions for reset. | 975 // Check conditions for reset. |
977 if (new_codec_ || *operation == kUndefined) { | 976 if (new_codec_ || *operation == kUndefined) { |
978 // The only valid reason to get kUndefined is that new_codec_ is set. | 977 // The only valid reason to get kUndefined is that new_codec_ is set. |
979 assert(new_codec_); | 978 assert(new_codec_); |
980 if (*play_dtmf && !header) { | 979 if (*play_dtmf && !header) { |
981 timestamp_ = dtmf_event->timestamp; | 980 timestamp_ = dtmf_event->timestamp; |
982 } else { | 981 } else { |
983 assert(header); | |
984 if (!header) { | 982 if (!header) { |
985 LOG(LS_ERROR) << "Packet missing where it shouldn't."; | 983 LOG(LS_ERROR) << "Packet missing where it shouldn't."; |
986 return -1; | 984 return -1; |
987 } | 985 } |
988 timestamp_ = header->timestamp; | 986 timestamp_ = header->timestamp; |
989 if (*operation == kRfc3389CngNoPacket | 987 if (*operation == kRfc3389CngNoPacket |
990 #ifndef LEGACY_BITEXACT | 988 #ifndef LEGACY_BITEXACT |
991 // Without this check, it can happen that a non-CNG packet is sent to | 989 // Without this check, it can happen that a non-CNG packet is sent to |
992 // the CNG decoder as if it was a SID frame. This is clearly a bug, | 990 // the CNG decoder as if it was a SID frame. This is clearly a bug, |
993 // but is kept for now to maintain bit-exactness with the test | 991 // but is kept for now to maintain bit-exactness with the test |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 | 1983 |
1986 void NetEqImpl::CreateDecisionLogic() { | 1984 void NetEqImpl::CreateDecisionLogic() { |
1987 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, | 1985 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, |
1988 playout_mode_, | 1986 playout_mode_, |
1989 decoder_database_.get(), | 1987 decoder_database_.get(), |
1990 *packet_buffer_.get(), | 1988 *packet_buffer_.get(), |
1991 delay_manager_.get(), | 1989 delay_manager_.get(), |
1992 buffer_level_filter_.get())); | 1990 buffer_level_filter_.get())); |
1993 } | 1991 } |
1994 } // namespace webrtc | 1992 } // namespace webrtc |
OLD | NEW |