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 17 matching lines...) Expand all Loading... |
28 #include "webrtc/typedefs.h" | 28 #include "webrtc/typedefs.h" |
29 | 29 |
30 namespace webrtc { | 30 namespace webrtc { |
31 | 31 |
32 struct CodecInst; | 32 struct CodecInst; |
33 class CriticalSectionWrapper; | 33 class CriticalSectionWrapper; |
34 class NetEq; | 34 class NetEq; |
35 | 35 |
36 namespace acm2 { | 36 namespace acm2 { |
37 | 37 |
38 class Nack; | |
39 | |
40 class AcmReceiver { | 38 class AcmReceiver { |
41 public: | 39 public: |
42 struct Decoder { | 40 struct Decoder { |
43 int acm_codec_id; | 41 int acm_codec_id; |
44 uint8_t payload_type; | 42 uint8_t payload_type; |
45 // This field is meaningful for codecs where both mono and | 43 // This field is meaningful for codecs where both mono and |
46 // stereo versions are registered under the same ID. | 44 // stereo versions are registered under the same ID. |
47 int channels; | 45 int channels; |
48 int sample_rate_hz; | 46 int sample_rate_hz; |
49 }; | 47 }; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_; | 312 rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_; |
315 int id_; // TODO(henrik.lundin) Make const. | 313 int id_; // TODO(henrik.lundin) Make const. |
316 const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_); | 314 const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_); |
317 AudioFrame::VADActivity previous_audio_activity_ GUARDED_BY(crit_sect_); | 315 AudioFrame::VADActivity previous_audio_activity_ GUARDED_BY(crit_sect_); |
318 int current_sample_rate_hz_ GUARDED_BY(crit_sect_); | 316 int current_sample_rate_hz_ GUARDED_BY(crit_sect_); |
319 ACMResampler resampler_ GUARDED_BY(crit_sect_); | 317 ACMResampler resampler_ GUARDED_BY(crit_sect_); |
320 // Used in GetAudio, declared as member to avoid allocating every 10ms. | 318 // Used in GetAudio, declared as member to avoid allocating every 10ms. |
321 // TODO(henrik.lundin) Stack-allocate in GetAudio instead? | 319 // TODO(henrik.lundin) Stack-allocate in GetAudio instead? |
322 rtc::scoped_ptr<int16_t[]> audio_buffer_ GUARDED_BY(crit_sect_); | 320 rtc::scoped_ptr<int16_t[]> audio_buffer_ GUARDED_BY(crit_sect_); |
323 rtc::scoped_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_); | 321 rtc::scoped_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_); |
324 rtc::scoped_ptr<Nack> nack_ GUARDED_BY(crit_sect_); | |
325 bool nack_enabled_ GUARDED_BY(crit_sect_); | |
326 CallStatistics call_stats_ GUARDED_BY(crit_sect_); | 322 CallStatistics call_stats_ GUARDED_BY(crit_sect_); |
327 NetEq* neteq_; | 323 NetEq* neteq_; |
328 // Decoders map is keyed by payload type | 324 // Decoders map is keyed by payload type |
329 std::map<uint8_t, Decoder> decoders_ GUARDED_BY(crit_sect_); | 325 std::map<uint8_t, Decoder> decoders_ GUARDED_BY(crit_sect_); |
330 bool vad_enabled_; | 326 bool vad_enabled_; |
331 Clock* clock_; // TODO(henrik.lundin) Make const if possible. | 327 Clock* clock_; // TODO(henrik.lundin) Make const if possible. |
332 bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); | 328 bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); |
333 | 329 |
334 // Indicates if a non-zero initial delay is set, and the receiver is in | 330 // Indicates if a non-zero initial delay is set, and the receiver is in |
335 // AV-sync mode. | 331 // AV-sync mode. |
336 bool av_sync_; | 332 bool av_sync_; |
337 rtc::scoped_ptr<InitialDelayManager> initial_delay_manager_; | 333 rtc::scoped_ptr<InitialDelayManager> initial_delay_manager_; |
338 | 334 |
339 // The following are defined as members to avoid creating them in every | 335 // The following are defined as members to avoid creating them in every |
340 // iteration. |missing_packets_sync_stream_| is *ONLY* used in InsertPacket(). | 336 // iteration. |missing_packets_sync_stream_| is *ONLY* used in InsertPacket(). |
341 // |late_packets_sync_stream_| is only used in GetAudio(). Both of these | 337 // |late_packets_sync_stream_| is only used in GetAudio(). Both of these |
342 // member variables are allocated only when we AV-sync is enabled, i.e. | 338 // member variables are allocated only when we AV-sync is enabled, i.e. |
343 // initial delay is set. | 339 // initial delay is set. |
344 rtc::scoped_ptr<InitialDelayManager::SyncStream> missing_packets_sync_stream_; | 340 rtc::scoped_ptr<InitialDelayManager::SyncStream> missing_packets_sync_stream_; |
345 rtc::scoped_ptr<InitialDelayManager::SyncStream> late_packets_sync_stream_; | 341 rtc::scoped_ptr<InitialDelayManager::SyncStream> late_packets_sync_stream_; |
346 }; | 342 }; |
347 | 343 |
348 } // namespace acm2 | 344 } // namespace acm2 |
349 | 345 |
350 } // namespace webrtc | 346 } // namespace webrtc |
351 | 347 |
352 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_RECEIVER_H_ | 348 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_RECEIVER_H_ |
OLD | NEW |