Home | History | Annotate | Download | only in voice_engine
      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 WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H
     12 #define WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H
     13 
     14 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
     15 #include "webrtc/typedefs.h"
     16 #include "webrtc/voice_engine/voice_engine_defines.h"
     17 
     18 
     19 namespace webrtc {
     20 
     21 class DtmfInbandQueue
     22 {
     23 public:
     24 
     25     DtmfInbandQueue(int32_t id);
     26 
     27     virtual ~DtmfInbandQueue();
     28 
     29     int AddDtmf(uint8_t DtmfKey, uint16_t len, uint8_t level);
     30 
     31     int8_t NextDtmf(uint16_t* len, uint8_t* level);
     32 
     33     bool PendingDtmf();
     34 
     35     void ResetDtmf();
     36 
     37 private:
     38     enum {kDtmfInbandMax = 20};
     39 
     40     int32_t _id;
     41     CriticalSectionWrapper& _DtmfCritsect;
     42     uint8_t _nextEmptyIndex;
     43     uint8_t _DtmfKey[kDtmfInbandMax];
     44     uint16_t _DtmfLen[kDtmfInbandMax];
     45     uint8_t _DtmfLevel[kDtmfInbandMax];
     46 };
     47 
     48 }  // namespace webrtc
     49 
     50 #endif  // WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H
     51