1 /* 2 * Copyright (c) 2015 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_CODEC_OWNER_H_ 12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_ 13 14 #include "webrtc/base/constructormagic.h" 15 #include "webrtc/base/scoped_ptr.h" 16 #include "webrtc/common_types.h" 17 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" 18 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" 19 #include "webrtc/modules/audio_coding/main/include/audio_coding_module_typedefs.h" 20 21 namespace webrtc { 22 namespace acm2 { 23 24 class CodecOwner { 25 public: 26 CodecOwner(); 27 ~CodecOwner(); 28 29 void SetEncoders(AudioEncoder* external_speech_encoder, 30 int cng_payload_type, 31 ACMVADMode vad_mode, 32 int red_payload_type); 33 34 void ChangeCngAndRed(int cng_payload_type, 35 ACMVADMode vad_mode, 36 int red_payload_type); 37 38 AudioEncoder* Encoder(); 39 const AudioEncoder* Encoder() const; 40 41 private: 42 AudioEncoder* speech_encoder_; 43 44 // |cng_encoder_| and |red_encoder_| are valid iff CNG or RED, respectively, 45 // are active. 46 rtc::scoped_ptr<AudioEncoder> cng_encoder_; 47 rtc::scoped_ptr<AudioEncoder> red_encoder_; 48 49 RTC_DISALLOW_COPY_AND_ASSIGN(CodecOwner); 50 }; 51 52 } // namespace acm2 53 } // namespace webrtc 54 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_ 55