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

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

Issue 2326003002: Moved codec-specific audio packet splitting into decoders. (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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 if (ret != PayloadSplitter::kOK) { 623 if (ret != PayloadSplitter::kOK) {
624 PacketBuffer::DeleteAllPackets(&packet_list); 624 PacketBuffer::DeleteAllPackets(&packet_list);
625 switch (ret) { 625 switch (ret) {
626 case PayloadSplitter::kUnknownPayloadType: 626 case PayloadSplitter::kUnknownPayloadType:
627 return kUnknownRtpPayloadType; 627 return kUnknownRtpPayloadType;
628 default: 628 default:
629 return kOtherError; 629 return kOtherError;
630 } 630 }
631 } 631 }
632 632
633 // Split payloads into smaller chunks. This also verifies that all payloads
634 // are of a known payload type.
635 ret = payload_splitter_->SplitAudio(&packet_list, *decoder_database_);
636 if (ret != PayloadSplitter::kOK) {
637 PacketBuffer::DeleteAllPackets(&packet_list);
638 switch (ret) {
639 case PayloadSplitter::kUnknownPayloadType:
640 return kUnknownRtpPayloadType;
641 case PayloadSplitter::kFrameSplitError:
642 return kFrameSplitError;
643 default:
644 return kOtherError;
645 }
646 }
647
648 // Update bandwidth estimate, if the packet is not comfort noise. 633 // Update bandwidth estimate, if the packet is not comfort noise.
649 if (!packet_list.empty() && 634 if (!packet_list.empty() &&
650 !decoder_database_->IsComfortNoise(main_header.payloadType)) { 635 !decoder_database_->IsComfortNoise(main_header.payloadType)) {
651 // The list can be empty here if we got nothing but DTMF payloads. 636 // The list can be empty here if we got nothing but DTMF payloads.
652 AudioDecoder* decoder = 637 AudioDecoder* decoder =
653 decoder_database_->GetDecoder(main_header.payloadType); 638 decoder_database_->GetDecoder(main_header.payloadType);
654 assert(decoder); // Should always get a valid object, since we have 639 assert(decoder); // Should always get a valid object, since we have
655 // already checked that the payload types are known. 640 // already checked that the payload types are known.
656 decoder->IncomingPacket(packet_list.front()->payload.data(), 641 decoder->IncomingPacket(packet_list.front()->payload.data(),
657 packet_list.front()->payload.size(), 642 packet_list.front()->payload.size(),
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 } 2093 }
2109 } 2094 }
2110 2095
2111 void NetEqImpl::CreateDecisionLogic() { 2096 void NetEqImpl::CreateDecisionLogic() {
2112 decision_logic_.reset(DecisionLogic::Create( 2097 decision_logic_.reset(DecisionLogic::Create(
2113 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), 2098 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(),
2114 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), 2099 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(),
2115 tick_timer_.get())); 2100 tick_timer_.get()));
2116 } 2101 }
2117 } // namespace webrtc 2102 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698