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 |
11 #include "webrtc/modules/audio_coding/neteq/neteq_impl.h" | 11 #include "webrtc/modules/audio_coding/neteq/neteq_impl.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 #include <memory.h> // memset | 14 #include <memory.h> // memset |
15 | 15 |
16 #include <algorithm> | 16 #include <algorithm> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/checks.h" | 19 #include "webrtc/base/checks.h" |
20 #include "webrtc/base/logging.h" | 20 #include "webrtc/base/logging.h" |
21 #include "webrtc/base/safe_conversions.h" | 21 #include "webrtc/base/safe_conversions.h" |
22 #include "webrtc/base/sanitizer.h" | |
22 #include "webrtc/base/trace_event.h" | 23 #include "webrtc/base/trace_event.h" |
23 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" | 24 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" |
24 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" | 25 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" |
25 #include "webrtc/modules/audio_coding/neteq/accelerate.h" | 26 #include "webrtc/modules/audio_coding/neteq/accelerate.h" |
26 #include "webrtc/modules/audio_coding/neteq/background_noise.h" | 27 #include "webrtc/modules/audio_coding/neteq/background_noise.h" |
27 #include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h" | 28 #include "webrtc/modules/audio_coding/neteq/buffer_level_filter.h" |
28 #include "webrtc/modules/audio_coding/neteq/comfort_noise.h" | 29 #include "webrtc/modules/audio_coding/neteq/comfort_noise.h" |
29 #include "webrtc/modules/audio_coding/neteq/decision_logic.h" | 30 #include "webrtc/modules/audio_coding/neteq/decision_logic.h" |
30 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" | 31 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" |
31 #include "webrtc/modules/audio_coding/neteq/defines.h" | 32 #include "webrtc/modules/audio_coding/neteq/defines.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 if (config.enable_post_decode_vad) { | 128 if (config.enable_post_decode_vad) { |
128 vad_->Enable(); | 129 vad_->Enable(); |
129 } | 130 } |
130 } | 131 } |
131 | 132 |
132 NetEqImpl::~NetEqImpl() = default; | 133 NetEqImpl::~NetEqImpl() = default; |
133 | 134 |
134 int NetEqImpl::InsertPacket(const WebRtcRTPHeader& rtp_header, | 135 int NetEqImpl::InsertPacket(const WebRtcRTPHeader& rtp_header, |
135 rtc::ArrayView<const uint8_t> payload, | 136 rtc::ArrayView<const uint8_t> payload, |
136 uint32_t receive_timestamp) { | 137 uint32_t receive_timestamp) { |
138 rtc::MsanCheckInitialized(payload); | |
kwiberg-webrtc
2016/08/30 19:55:28
This is the sort of rtc::MsanCheckInitialized() ca
| |
137 TRACE_EVENT0("webrtc", "NetEqImpl::InsertPacket"); | 139 TRACE_EVENT0("webrtc", "NetEqImpl::InsertPacket"); |
138 rtc::CritScope lock(&crit_sect_); | 140 rtc::CritScope lock(&crit_sect_); |
139 int error = | 141 int error = |
140 InsertPacketInternal(rtp_header, payload, receive_timestamp, false); | 142 InsertPacketInternal(rtp_header, payload, receive_timestamp, false); |
141 if (error != 0) { | 143 if (error != 0) { |
142 error_code_ = error; | 144 error_code_ = error; |
143 return kFail; | 145 return kFail; |
144 } | 146 } |
145 return kOK; | 147 return kOK; |
146 } | 148 } |
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2135 } | 2137 } |
2136 } | 2138 } |
2137 | 2139 |
2138 void NetEqImpl::CreateDecisionLogic() { | 2140 void NetEqImpl::CreateDecisionLogic() { |
2139 decision_logic_.reset(DecisionLogic::Create( | 2141 decision_logic_.reset(DecisionLogic::Create( |
2140 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), | 2142 fs_hz_, output_size_samples_, playout_mode_, decoder_database_.get(), |
2141 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), | 2143 *packet_buffer_.get(), delay_manager_.get(), buffer_level_filter_.get(), |
2142 tick_timer_.get())); | 2144 tick_timer_.get())); |
2143 } | 2145 } |
2144 } // namespace webrtc | 2146 } // namespace webrtc |
OLD | NEW |