blob: 6a65c9e0a15d8e874abd9ca6a64c66620dece6cf [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
14#include "critical_section_wrapper.h"
15#include "typedefs.h"
16#include "voice_engine_defines.h"
17
18
19namespace webrtc {
20
21class DtmfInbandQueue
22{
23public:
24
pbos@webrtc.org6141e132013-04-09 10:09:10 +000025 DtmfInbandQueue(const 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
48} // namespace webrtc
49
50#endif // WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H