niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H |
| 12 | #define WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H |
| 13 | |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 14 | #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
| 15 | #include "webrtc/typedefs.h" |
| 16 | #include "webrtc/voice_engine/voice_engine_defines.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 17 | |
| 18 | |
| 19 | namespace webrtc { |
| 20 | |
| 21 | class DtmfInbandQueue |
| 22 | { |
| 23 | public: |
| 24 | |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 25 | DtmfInbandQueue(int32_t id); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 26 | |
| 27 | virtual ~DtmfInbandQueue(); |
| 28 | |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 29 | int AddDtmf(uint8_t DtmfKey, uint16_t len, uint8_t level); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 30 | |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 31 | int8_t NextDtmf(uint16_t* len, uint8_t* level); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 32 | |
| 33 | bool PendingDtmf(); |
| 34 | |
| 35 | void ResetDtmf(); |
| 36 | |
| 37 | private: |
| 38 | enum {kDtmfInbandMax = 20}; |
| 39 | |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 40 | int32_t _id; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 41 | CriticalSectionWrapper& _DtmfCritsect; |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 42 | uint8_t _nextEmptyIndex; |
| 43 | uint8_t _DtmfKey[kDtmfInbandMax]; |
| 44 | uint16_t _DtmfLen[kDtmfInbandMax]; |
| 45 | uint8_t _DtmfLevel[kDtmfInbandMax]; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 48 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 49 | |
| 50 | #endif // WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H |