blob: 5ca3f9c5f466a8794d81ff50839e8cea06482292 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
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.org956aa7e2013-05-21 13:52:32 +000014#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.com470e71d2011-07-07 08:21:25 +000017
18
19namespace webrtc {
20
21class DtmfInbandQueue
22{
23public:
24
pbos@webrtc.org92135212013-05-14 08:31:39 +000025 DtmfInbandQueue(int32_t id);
niklase@google.com470e71d2011-07-07 08:21:25 +000026
27 virtual ~DtmfInbandQueue();
28
pbos@webrtc.org6141e132013-04-09 10:09:10 +000029 int AddDtmf(uint8_t DtmfKey, uint16_t len, uint8_t level);
niklase@google.com470e71d2011-07-07 08:21:25 +000030
pbos@webrtc.org6141e132013-04-09 10:09:10 +000031 int8_t NextDtmf(uint16_t* len, uint8_t* level);
niklase@google.com470e71d2011-07-07 08:21:25 +000032
33 bool PendingDtmf();
34
35 void ResetDtmf();
36
37private:
38 enum {kDtmfInbandMax = 20};
39
pbos@webrtc.org6141e132013-04-09 10:09:10 +000040 int32_t _id;
niklase@google.com470e71d2011-07-07 08:21:25 +000041 CriticalSectionWrapper& _DtmfCritsect;
pbos@webrtc.org6141e132013-04-09 10:09:10 +000042 uint8_t _nextEmptyIndex;
43 uint8_t _DtmfKey[kDtmfInbandMax];
44 uint16_t _DtmfLen[kDtmfInbandMax];
45 uint8_t _DtmfLevel[kDtmfInbandMax];
niklase@google.com470e71d2011-07-07 08:21:25 +000046};
47
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000048} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000049
50#endif // WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H