Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / audio_coding / main / acm2 / acm_cng.h
1 /*
2  *  Copyright (c) 2012 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_AUDIO_CODING_MAIN_ACM2_ACM_CNG_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CNG_H_
13
14 #include "webrtc/modules/audio_coding/main/acm2/acm_generic_codec.h"
15
16 // forward declaration
17 struct WebRtcCngEncInst;
18 struct WebRtcCngDecInst;
19
20 namespace webrtc {
21
22 namespace acm2 {
23
24 class ACMCNG: public ACMGenericCodec {
25  public:
26   explicit ACMCNG(int16_t codec_id);
27   ~ACMCNG();
28
29   // for FEC
30   ACMGenericCodec* CreateInstance(void);
31
32   int16_t InternalEncode(uint8_t* bitstream,
33                          int16_t* bitstream_len_byte);
34
35   int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
36
37  protected:
38   void DestructEncoderSafe() OVERRIDE
39       EXCLUSIVE_LOCKS_REQUIRED(codec_wrapper_lock_);
40
41   int16_t InternalCreateEncoder();
42
43   int16_t EnableDTX() {
44     return -1;
45   }
46
47   int16_t DisableDTX() {
48     return -1;
49   }
50
51   WebRtcCngEncInst* encoder_inst_ptr_;
52   uint16_t samp_freq_hz_;
53 };
54
55 }  // namespace acm2
56
57 }  // namespace webrtc
58
59 #endif  // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CNG_H_