OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 #ifndef WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H | 11 #ifndef WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H |
12 #define WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H | 12 #define WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H |
13 | 13 |
14 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 14 #include "webrtc/base/criticalsection.h" |
15 #include "webrtc/typedefs.h" | 15 #include "webrtc/typedefs.h" |
16 #include "webrtc/voice_engine/voice_engine_defines.h" | 16 #include "webrtc/voice_engine/voice_engine_defines.h" |
17 | 17 |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 class DtmfInbandQueue | 21 class DtmfInbandQueue |
22 { | 22 { |
23 public: | 23 public: |
24 | 24 |
25 DtmfInbandQueue(int32_t id); | 25 DtmfInbandQueue(int32_t id); |
26 | 26 |
27 virtual ~DtmfInbandQueue(); | 27 virtual ~DtmfInbandQueue(); |
28 | 28 |
29 int AddDtmf(uint8_t DtmfKey, uint16_t len, uint8_t level); | 29 int AddDtmf(uint8_t DtmfKey, uint16_t len, uint8_t level); |
30 | 30 |
31 int8_t NextDtmf(uint16_t* len, uint8_t* level); | 31 int8_t NextDtmf(uint16_t* len, uint8_t* level); |
32 | 32 |
33 bool PendingDtmf(); | 33 bool PendingDtmf(); |
34 | 34 |
35 void ResetDtmf(); | 35 void ResetDtmf(); |
36 | 36 |
37 private: | 37 private: |
38 enum {kDtmfInbandMax = 20}; | 38 enum {kDtmfInbandMax = 20}; |
39 | 39 |
40 int32_t _id; | 40 int32_t _id; |
41 CriticalSectionWrapper& _DtmfCritsect; | 41 rtc::CriticalSection _DtmfCritsect; |
42 uint8_t _nextEmptyIndex; | 42 uint8_t _nextEmptyIndex; |
43 uint8_t _DtmfKey[kDtmfInbandMax]; | 43 uint8_t _DtmfKey[kDtmfInbandMax]; |
44 uint16_t _DtmfLen[kDtmfInbandMax]; | 44 uint16_t _DtmfLen[kDtmfInbandMax]; |
45 uint8_t _DtmfLevel[kDtmfInbandMax]; | 45 uint8_t _DtmfLevel[kDtmfInbandMax]; |
46 }; | 46 }; |
47 | 47 |
48 } // namespace webrtc | 48 } // namespace webrtc |
49 | 49 |
50 #endif // WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H | 50 #endif // WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H |
OLD | NEW |