1 /*
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 MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_
12 #define MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_
13 
14 #include <stdint.h>
15 
16 #include <list>
17 
18 #include "rtc_base/synchronization/mutex.h"
19 
20 namespace webrtc {
21 class DtmfQueue {
22  public:
23   struct Event {
24     uint16_t duration_ms = 0;
25     uint8_t payload_type = 0;
26     uint8_t key = 0;
27     uint8_t level = 0;
28   };
29 
30   DtmfQueue();
31   ~DtmfQueue();
32 
33   bool AddDtmf(const Event& event);
34   bool NextDtmf(Event* event);
35   bool PendingDtmf() const;
36 
37  private:
38   mutable Mutex dtmf_mutex_;
39   std::list<Event> queue_;
40 };
41 }  // namespace webrtc
42 
43 #endif  // MODULES_RTP_RTCP_SOURCE_DTMF_QUEUE_H_
44