2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_
|
|
|
|
|
#define MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-11-17 05:25:37 -08:00
|
|
|
#include <list>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/criticalsection.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2016-11-17 05:25:37 -08:00
|
|
|
class DtmfQueue {
|
2013-05-08 10:04:06 +00:00
|
|
|
public:
|
2016-11-17 05:25:37 -08:00
|
|
|
struct Event {
|
|
|
|
|
uint16_t duration_ms = 0;
|
|
|
|
|
uint8_t payload_type = 0;
|
|
|
|
|
uint8_t key = 0;
|
|
|
|
|
uint8_t level = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
DtmfQueue();
|
|
|
|
|
~DtmfQueue();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-11-17 05:25:37 -08:00
|
|
|
bool AddDtmf(const Event& event);
|
|
|
|
|
bool NextDtmf(Event* event);
|
|
|
|
|
bool PendingDtmf() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-05-08 10:04:06 +00:00
|
|
|
private:
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CriticalSection dtmf_critsect_;
|
2016-11-17 05:25:37 -08:00
|
|
|
std::list<Event> queue_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2013-05-08 10:04:06 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_
|