blob: fbfc4efcb14fd461b227bb2804afd06ef5b77191 [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_MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_
12#define WEBRTC_MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_
13
danilchap7c9426c2016-04-14 03:05:31 -070014#include "webrtc/base/criticalsection.h"
phoglund@webrtc.org315d3982013-05-08 10:04:06 +000015#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
phoglund@webrtc.org315d3982013-05-08 10:04:06 +000016#include "webrtc/typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000017
18namespace webrtc {
phoglund@webrtc.org315d3982013-05-08 10:04:06 +000019class DTMFqueue {
20 public:
21 DTMFqueue();
solenbergd3d230f2016-09-23 13:10:46 -070022 ~DTMFqueue();
niklase@google.com470e71d2011-07-07 08:21:25 +000023
phoglund@webrtc.org315d3982013-05-08 10:04:06 +000024 int32_t AddDTMF(uint8_t dtmf_key, uint16_t len, uint8_t level);
25 int8_t NextDTMF(uint8_t* dtmf_key, uint16_t* len, uint8_t* level);
26 bool PendingDTMF();
niklase@google.com470e71d2011-07-07 08:21:25 +000027
phoglund@webrtc.org315d3982013-05-08 10:04:06 +000028 private:
danilchap7c9426c2016-04-14 03:05:31 -070029 rtc::CriticalSection dtmf_critsect_;
phoglund@webrtc.org315d3982013-05-08 10:04:06 +000030 uint8_t next_empty_index_;
31 uint8_t dtmf_key_[DTMF_OUTBAND_MAX];
32 uint16_t dtmf_length[DTMF_OUTBAND_MAX];
33 uint8_t dtmf_level_[DTMF_OUTBAND_MAX];
niklase@google.com470e71d2011-07-07 08:21:25 +000034};
phoglund@webrtc.org315d3982013-05-08 10:04:06 +000035} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000036
phoglund@webrtc.org315d3982013-05-08 10:04:06 +000037#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_