blob: b3bd39e87fbbb44c59445ee8e6ea9f3abfb7d3f3 [file] [log] [blame]
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +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
25 DtmfInbandQueue(const WebRtc_Word32 id);
26
27 virtual ~DtmfInbandQueue();
28
29 int AddDtmf(WebRtc_UWord8 DtmfKey,
30 WebRtc_UWord16 len,
31 WebRtc_UWord8 level);
32
33 WebRtc_Word8 NextDtmf(WebRtc_UWord16* len, WebRtc_UWord8* level);
34
35 bool PendingDtmf();
36
37 void ResetDtmf();
38
39private:
40 enum {kDtmfInbandMax = 20};
41
42 WebRtc_Word32 _id;
43 CriticalSectionWrapper& _DtmfCritsect;
44 WebRtc_UWord8 _nextEmptyIndex;
45 WebRtc_UWord8 _DtmfKey[kDtmfInbandMax];
46 WebRtc_UWord16 _DtmfLen[kDtmfInbandMax];
47 WebRtc_UWord8 _DtmfLevel[kDtmfInbandMax];
48};
49
50} // namespace webrtc
51
52#endif // WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H