OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 // | 169 // |
170 // Get the current network statistics from NetEq. | 170 // Get the current network statistics from NetEq. |
171 // | 171 // |
172 // Output: | 172 // Output: |
173 // - statistics : The current network statistics. | 173 // - statistics : The current network statistics. |
174 // | 174 // |
175 void GetNetworkStatistics(NetworkStatistics* statistics); | 175 void GetNetworkStatistics(NetworkStatistics* statistics); |
176 | 176 |
177 // | 177 // |
178 // Enable post-decoding VAD. | |
179 // | |
180 void EnableVad(); | |
181 | |
182 // | |
183 // Disable post-decoding VAD. | |
184 // | |
185 void DisableVad(); | |
186 | |
187 // | |
188 // Returns whether post-decoding VAD is enabled (true) or disabled (false). | |
189 // | |
190 bool vad_enabled() const { return vad_enabled_; } | |
191 | |
192 // | |
193 // Flushes the NetEq packet and speech buffers. | 178 // Flushes the NetEq packet and speech buffers. |
194 // | 179 // |
195 void FlushBuffers(); | 180 void FlushBuffers(); |
196 | 181 |
197 // | 182 // |
198 // Removes a payload-type from the NetEq codec database. | 183 // Removes a payload-type from the NetEq codec database. |
199 // | 184 // |
200 // Input: | 185 // Input: |
201 // - payload_type : the payload-type to be removed. | 186 // - payload_type : the payload-type to be removed. |
202 // | 187 // |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 256 |
272 private: | 257 private: |
273 const Decoder* RtpHeaderToDecoder(const RTPHeader& rtp_header, | 258 const Decoder* RtpHeaderToDecoder(const RTPHeader& rtp_header, |
274 uint8_t payload_type) const | 259 uint8_t payload_type) const |
275 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 260 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
276 | 261 |
277 uint32_t NowInTimestamp(int decoder_sampling_rate) const; | 262 uint32_t NowInTimestamp(int decoder_sampling_rate) const; |
278 | 263 |
279 rtc::CriticalSection crit_sect_; | 264 rtc::CriticalSection crit_sect_; |
280 const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_); | 265 const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_); |
281 AudioFrame::VADActivity previous_audio_activity_ GUARDED_BY(crit_sect_); | |
282 ACMResampler resampler_ GUARDED_BY(crit_sect_); | 266 ACMResampler resampler_ GUARDED_BY(crit_sect_); |
283 std::unique_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_); | 267 std::unique_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_); |
284 CallStatistics call_stats_ GUARDED_BY(crit_sect_); | 268 CallStatistics call_stats_ GUARDED_BY(crit_sect_); |
285 NetEq* neteq_; | 269 NetEq* neteq_; |
286 // Decoders map is keyed by payload type | 270 // Decoders map is keyed by payload type |
287 std::map<uint8_t, Decoder> decoders_ GUARDED_BY(crit_sect_); | 271 std::map<uint8_t, Decoder> decoders_ GUARDED_BY(crit_sect_); |
288 bool vad_enabled_; | |
289 Clock* clock_; // TODO(henrik.lundin) Make const if possible. | 272 Clock* clock_; // TODO(henrik.lundin) Make const if possible. |
290 bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); | 273 bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); |
291 rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_); | 274 rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_); |
292 }; | 275 }; |
293 | 276 |
294 } // namespace acm2 | 277 } // namespace acm2 |
295 | 278 |
296 } // namespace webrtc | 279 } // namespace webrtc |
297 | 280 |
298 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVER_H_ | 281 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVER_H_ |
OLD | NEW |