2015-05-07 15:49:23 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2015 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_
|
|
|
|
|
#define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_
|
|
|
|
|
|
|
|
|
|
#include "webrtc/base/constructormagic.h"
|
|
|
|
|
#include "webrtc/base/scoped_ptr.h"
|
|
|
|
|
#include "webrtc/common_types.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
|
2015-09-30 21:54:21 -07:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/audio_decoder.h"
|
2015-10-29 11:31:02 +01:00
|
|
|
#include "webrtc/modules/audio_coding/main/include/audio_coding_module_typedefs.h"
|
2015-05-07 15:49:23 +02:00
|
|
|
|
2015-09-30 21:54:21 -07:00
|
|
|
namespace webrtc {
|
2015-05-07 15:49:23 +02:00
|
|
|
namespace acm2 {
|
|
|
|
|
|
|
|
|
|
class CodecOwner {
|
|
|
|
|
public:
|
|
|
|
|
CodecOwner();
|
|
|
|
|
~CodecOwner();
|
|
|
|
|
|
2015-09-08 05:57:53 -07:00
|
|
|
void SetEncoders(AudioEncoder* external_speech_encoder,
|
2015-05-18 14:52:29 +02:00
|
|
|
int cng_payload_type,
|
|
|
|
|
ACMVADMode vad_mode,
|
|
|
|
|
int red_payload_type);
|
|
|
|
|
|
|
|
|
|
void ChangeCngAndRed(int cng_payload_type,
|
|
|
|
|
ACMVADMode vad_mode,
|
|
|
|
|
int red_payload_type);
|
|
|
|
|
|
2015-05-07 15:49:23 +02:00
|
|
|
AudioEncoder* Encoder();
|
|
|
|
|
const AudioEncoder* Encoder() const;
|
|
|
|
|
|
|
|
|
|
private:
|
2015-11-10 04:05:16 -08:00
|
|
|
AudioEncoder* speech_encoder_;
|
2015-08-24 02:03:23 -07:00
|
|
|
|
2015-05-07 15:49:23 +02:00
|
|
|
// |cng_encoder_| and |red_encoder_| are valid iff CNG or RED, respectively,
|
|
|
|
|
// are active.
|
|
|
|
|
rtc::scoped_ptr<AudioEncoder> cng_encoder_;
|
|
|
|
|
rtc::scoped_ptr<AudioEncoder> red_encoder_;
|
|
|
|
|
|
2015-09-16 05:37:44 -07:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(CodecOwner);
|
2015-05-07 15:49:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acm2
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_
|