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

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

Issue 1901633002: Adding 120 ms frame length support in NetEq. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fixing two errors Created 4 years, 7 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // longer required, this #define should be removed (and the code that it 51 // longer required, this #define should be removed (and the code that it
52 // enables). 52 // enables).
53 #define LEGACY_BITEXACT 53 #define LEGACY_BITEXACT
54 54
55 namespace webrtc { 55 namespace webrtc {
56 56
57 NetEqImpl::Dependencies::Dependencies(const NetEq::Config& config) 57 NetEqImpl::Dependencies::Dependencies(const NetEq::Config& config)
58 : tick_timer(new TickTimer), 58 : tick_timer(new TickTimer),
59 buffer_level_filter(new BufferLevelFilter), 59 buffer_level_filter(new BufferLevelFilter),
60 decoder_database(new DecoderDatabase), 60 decoder_database(new DecoderDatabase),
61 delay_peak_detector(new DelayPeakDetector(tick_timer.get())), 61 delay_peak_detector(new DelayPeakDetector(tick_timer.get())),
minyue-webrtc 2016/05/02 10:44:52 this is due to rebase
hlundin-webrtc 2016/05/02 11:28:15 Acknowledged.
62 delay_manager(new DelayManager(config.max_packets_in_buffer, 62 delay_manager(new DelayManager(config.max_packets_in_buffer,
63 delay_peak_detector.get(), 63 delay_peak_detector.get(),
64 tick_timer.get())), 64 tick_timer.get())),
65 dtmf_buffer(new DtmfBuffer(config.sample_rate_hz)), 65 dtmf_buffer(new DtmfBuffer(config.sample_rate_hz)),
66 dtmf_tone_generator(new DtmfToneGenerator), 66 dtmf_tone_generator(new DtmfToneGenerator),
67 packet_buffer( 67 packet_buffer(
68 new PacketBuffer(config.max_packets_in_buffer, tick_timer.get())), 68 new PacketBuffer(config.max_packets_in_buffer, tick_timer.get())),
69 payload_splitter(new PayloadSplitter), 69 payload_splitter(new PayloadSplitter),
70 timestamp_scaler(new TimestampScaler(*decoder_database)), 70 timestamp_scaler(new TimestampScaler(*decoder_database)),
71 accelerate_factory(new AccelerateFactory), 71 accelerate_factory(new AccelerateFactory),
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 } 493 }
494 RTC_DCHECK(nack_.get()); 494 RTC_DCHECK(nack_.get());
495 return nack_->GetNackList(round_trip_time_ms); 495 return nack_->GetNackList(round_trip_time_ms);
496 } 496 }
497 497
498 const SyncBuffer* NetEqImpl::sync_buffer_for_test() const { 498 const SyncBuffer* NetEqImpl::sync_buffer_for_test() const {
499 rtc::CritScope lock(&crit_sect_); 499 rtc::CritScope lock(&crit_sect_);
500 return sync_buffer_.get(); 500 return sync_buffer_.get();
501 } 501 }
502 502
503 Operations NetEqImpl::last_operation_for_test() const {
504 rtc::CritScope lock(&crit_sect_);
505 return last_operation_;
506 }
507
503 // Methods below this line are private. 508 // Methods below this line are private.
504 509
505 int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header, 510 int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
506 rtc::ArrayView<const uint8_t> payload, 511 rtc::ArrayView<const uint8_t> payload,
507 uint32_t receive_timestamp, 512 uint32_t receive_timestamp,
508 bool is_sync_packet) { 513 bool is_sync_packet) {
509 if (payload.empty()) { 514 if (payload.empty()) {
510 LOG_F(LS_ERROR) << "payload is empty"; 515 LOG_F(LS_ERROR) << "payload is empty";
511 return kInvalidPointer; 516 return kInvalidPointer;
512 } 517 }
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 expand_->Reset(); 903 expand_->Reset();
899 break; 904 break;
900 } 905 }
901 case kUndefined: { 906 case kUndefined: {
902 LOG(LS_ERROR) << "Invalid operation kUndefined."; 907 LOG(LS_ERROR) << "Invalid operation kUndefined.";
903 assert(false); // This should not happen. 908 assert(false); // This should not happen.
904 last_mode_ = kModeError; 909 last_mode_ = kModeError;
905 return kInvalidOperation; 910 return kInvalidOperation;
906 } 911 }
907 } // End of switch. 912 } // End of switch.
913 last_operation_ = operation;
908 if (return_value < 0) { 914 if (return_value < 0) {
909 return return_value; 915 return return_value;
910 } 916 }
911 917
912 if (last_mode_ != kModeRfc3389Cng) { 918 if (last_mode_ != kModeRfc3389Cng) {
913 comfort_noise_->Reset(); 919 comfort_noise_->Reset();
914 } 920 }
915 921
916 // Copy from |algorithm_buffer| to |sync_buffer_|. 922 // Copy from |algorithm_buffer| to |sync_buffer_|.
917 sync_buffer_->PushBack(*algorithm_buffer_); 923 sync_buffer_->PushBack(*algorithm_buffer_);
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 2120
2115 void NetEqImpl::CreateDecisionLogic() { 2121 void NetEqImpl::CreateDecisionLogic() {
2116 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, 2122 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_,
2117 playout_mode_, 2123 playout_mode_,
2118 decoder_database_.get(), 2124 decoder_database_.get(),
2119 *packet_buffer_.get(), 2125 *packet_buffer_.get(),
2120 delay_manager_.get(), 2126 delay_manager_.get(),
2121 buffer_level_filter_.get())); 2127 buffer_level_filter_.get()));
2122 } 2128 }
2123 } // namespace webrtc 2129 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698