Revert r8210 "Add a new parameter to ACMGenericCodec constructor"
The change failed to compile on some bots. TBR=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/34949004 Cr-Commit-Position: refs/heads/master@{#8211} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8211 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -46,9 +46,8 @@ namespace webrtc {
|
|||||||
namespace acm2 {
|
namespace acm2 {
|
||||||
|
|
||||||
#ifndef WEBRTC_CODEC_AMR
|
#ifndef WEBRTC_CODEC_AMR
|
||||||
ACMAMR::ACMAMR(int16_t /* codec_id */, bool enable_red)
|
ACMAMR::ACMAMR(int16_t /* codec_id */)
|
||||||
: ACMGenericCodec(enable_red),
|
: encoder_inst_ptr_(NULL),
|
||||||
encoder_inst_ptr_(NULL),
|
|
||||||
encoding_mode_(-1), // Invalid value.
|
encoding_mode_(-1), // Invalid value.
|
||||||
encoding_rate_(0), // Invalid value.
|
encoding_rate_(0), // Invalid value.
|
||||||
encoder_packing_format_(AMRBandwidthEfficient) {
|
encoder_packing_format_(AMRBandwidthEfficient) {
|
||||||
|
@ -25,7 +25,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMAMR : public ACMGenericCodec {
|
class ACMAMR : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMAMR(int16_t codec_id, bool enable_red);
|
explicit ACMAMR(int16_t codec_id);
|
||||||
~ACMAMR();
|
~ACMAMR();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -43,9 +43,8 @@ namespace webrtc {
|
|||||||
namespace acm2 {
|
namespace acm2 {
|
||||||
|
|
||||||
#ifndef WEBRTC_CODEC_AMRWB
|
#ifndef WEBRTC_CODEC_AMRWB
|
||||||
ACMAMRwb::ACMAMRwb(int16_t /* codec_id */, bool enable_red)
|
ACMAMRwb::ACMAMRwb(int16_t /* codec_id */)
|
||||||
: ACMGenericCodec(enable_red),
|
: encoder_inst_ptr_(NULL),
|
||||||
encoder_inst_ptr_(NULL),
|
|
||||||
encoding_mode_(-1), // invalid value
|
encoding_mode_(-1), // invalid value
|
||||||
encoding_rate_(0), // invalid value
|
encoding_rate_(0), // invalid value
|
||||||
encoder_packing_format_(AMRBandwidthEfficient) {}
|
encoder_packing_format_(AMRBandwidthEfficient) {}
|
||||||
|
@ -23,7 +23,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMAMRwb : public ACMGenericCodec {
|
class ACMAMRwb : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMAMRwb(int16_t codec_id, bool enable_red);
|
explicit ACMAMRwb(int16_t codec_id);
|
||||||
~ACMAMRwb();
|
~ACMAMRwb();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -19,8 +19,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
namespace acm2 {
|
namespace acm2 {
|
||||||
|
|
||||||
ACMCNG::ACMCNG(int16_t codec_id, bool enable_red)
|
ACMCNG::ACMCNG(int16_t codec_id) {
|
||||||
: ACMGenericCodec(enable_red) {
|
|
||||||
encoder_inst_ptr_ = NULL;
|
encoder_inst_ptr_ = NULL;
|
||||||
codec_id_ = codec_id;
|
codec_id_ = codec_id;
|
||||||
samp_freq_hz_ = ACMCodecDB::CodecFreq(codec_id_);
|
samp_freq_hz_ = ACMCodecDB::CodecFreq(codec_id_);
|
||||||
|
@ -23,7 +23,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMCNG: public ACMGenericCodec {
|
class ACMCNG: public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMCNG(int16_t codec_id, bool enable_red);
|
explicit ACMCNG(int16_t codec_id);
|
||||||
~ACMCNG();
|
~ACMCNG();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -572,38 +572,38 @@ ACMGenericCodec* ACMCodecDB::CreateCodecInstance(const CodecInst& codec_inst) {
|
|||||||
// All we have support for right now.
|
// All we have support for right now.
|
||||||
if (!STR_CASE_CMP(codec_inst.plname, "ISAC")) {
|
if (!STR_CASE_CMP(codec_inst.plname, "ISAC")) {
|
||||||
#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
|
#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
|
||||||
return new ACMISAC(kISAC, false);
|
return new ACMISAC(kISAC);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "PCMU")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "PCMU")) {
|
||||||
if (codec_inst.channels == 1) {
|
if (codec_inst.channels == 1) {
|
||||||
return new ACMPCMU(kPCMU, false);
|
return new ACMPCMU(kPCMU);
|
||||||
} else {
|
} else {
|
||||||
return new ACMPCMU(kPCMU_2ch, false);
|
return new ACMPCMU(kPCMU_2ch);
|
||||||
}
|
}
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "PCMA")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "PCMA")) {
|
||||||
if (codec_inst.channels == 1) {
|
if (codec_inst.channels == 1) {
|
||||||
return new ACMPCMA(kPCMA, false);
|
return new ACMPCMA(kPCMA);
|
||||||
} else {
|
} else {
|
||||||
return new ACMPCMA(kPCMA_2ch, false);
|
return new ACMPCMA(kPCMA_2ch);
|
||||||
}
|
}
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "ILBC")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "ILBC")) {
|
||||||
#ifdef WEBRTC_CODEC_ILBC
|
#ifdef WEBRTC_CODEC_ILBC
|
||||||
return new ACMILBC(kILBC, false);
|
return new ACMILBC(kILBC);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "AMR")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "AMR")) {
|
||||||
#ifdef WEBRTC_CODEC_AMR
|
#ifdef WEBRTC_CODEC_AMR
|
||||||
return new ACMAMR(kGSMAMR, false);
|
return new ACMAMR(kGSMAMR);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "AMR-WB")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "AMR-WB")) {
|
||||||
#ifdef WEBRTC_CODEC_AMRWB
|
#ifdef WEBRTC_CODEC_AMRWB
|
||||||
return new ACMAMRwb(kGSMAMRWB, false);
|
return new ACMAMRwb(kGSMAMRWB);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "G722")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "G722")) {
|
||||||
#ifdef WEBRTC_CODEC_G722
|
#ifdef WEBRTC_CODEC_G722
|
||||||
if (codec_inst.channels == 1) {
|
if (codec_inst.channels == 1) {
|
||||||
return new ACMG722(kG722, false);
|
return new ACMG722(kG722);
|
||||||
} else {
|
} else {
|
||||||
return new ACMG722(kG722_2ch, false);
|
return new ACMG722(kG722_2ch);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "G7221")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "G7221")) {
|
||||||
@ -628,7 +628,7 @@ ACMGenericCodec* ACMCodecDB::CreateCodecInstance(const CodecInst& codec_inst) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ACMG722_1(codec_id, false);
|
return new ACMG722_1(codec_id);
|
||||||
#endif
|
#endif
|
||||||
FALLTHROUGH();
|
FALLTHROUGH();
|
||||||
}
|
}
|
||||||
@ -652,7 +652,7 @@ ACMGenericCodec* ACMCodecDB::CreateCodecInstance(const CodecInst& codec_inst) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ACMG722_1C(codec_id, false);
|
return new ACMG722_1C(codec_id);
|
||||||
#endif
|
#endif
|
||||||
FALLTHROUGH();
|
FALLTHROUGH();
|
||||||
}
|
}
|
||||||
@ -685,18 +685,18 @@ ACMGenericCodec* ACMCodecDB::CreateCodecInstance(const CodecInst& codec_inst) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ACMCNG(codec_id, false);
|
return new ACMCNG(codec_id);
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "G729")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "G729")) {
|
||||||
#ifdef WEBRTC_CODEC_G729
|
#ifdef WEBRTC_CODEC_G729
|
||||||
return new ACMG729(kG729, false);
|
return new ACMG729(kG729);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "G7291")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "G7291")) {
|
||||||
#ifdef WEBRTC_CODEC_G729_1
|
#ifdef WEBRTC_CODEC_G729_1
|
||||||
return new ACMG729_1(kG729_1, false);
|
return new ACMG729_1(kG729_1);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "opus")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "opus")) {
|
||||||
#ifdef WEBRTC_CODEC_OPUS
|
#ifdef WEBRTC_CODEC_OPUS
|
||||||
return new ACMOpus(kOpus, false);
|
return new ACMOpus(kOpus);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "speex")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "speex")) {
|
||||||
#ifdef WEBRTC_CODEC_SPEEX
|
#ifdef WEBRTC_CODEC_SPEEX
|
||||||
@ -714,7 +714,7 @@ ACMGenericCodec* ACMCodecDB::CreateCodecInstance(const CodecInst& codec_inst) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ACMSPEEX(codec_id, false);
|
return new ACMSPEEX(codec_id);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "CN")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "CN")) {
|
||||||
// For CN we need to check sampling frequency to know what codec to create.
|
// For CN we need to check sampling frequency to know what codec to create.
|
||||||
@ -742,7 +742,7 @@ ACMGenericCodec* ACMCodecDB::CreateCodecInstance(const CodecInst& codec_inst) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ACMCNG(codec_id, false);
|
return new ACMCNG(codec_id);
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "L16")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "L16")) {
|
||||||
#ifdef WEBRTC_CODEC_PCM16
|
#ifdef WEBRTC_CODEC_PCM16
|
||||||
// For L16 we need to check sampling frequency to know what codec to create.
|
// For L16 we need to check sampling frequency to know what codec to create.
|
||||||
@ -784,15 +784,15 @@ ACMGenericCodec* ACMCodecDB::CreateCodecInstance(const CodecInst& codec_inst) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ACMPCM16B(codec_id, false);
|
return new ACMPCM16B(codec_id);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "telephone-event")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "telephone-event")) {
|
||||||
#ifdef WEBRTC_CODEC_AVT
|
#ifdef WEBRTC_CODEC_AVT
|
||||||
return new ACMDTMFPlayout(kAVT, false);
|
return new ACMDTMFPlayout(kAVT);
|
||||||
#endif
|
#endif
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "red")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "red")) {
|
||||||
#ifdef WEBRTC_CODEC_RED
|
#ifdef WEBRTC_CODEC_RED
|
||||||
return new ACMRED(kRED, false);
|
return new ACMRED(kRED);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -46,10 +46,7 @@ void ACMDTMFPlayout::DestructEncoderSafe() {
|
|||||||
|
|
||||||
#else //===================== Actual Implementation =======================
|
#else //===================== Actual Implementation =======================
|
||||||
|
|
||||||
ACMDTMFPlayout::ACMDTMFPlayout(int16_t codec_id, bool enable_red)
|
ACMDTMFPlayout::ACMDTMFPlayout(int16_t codec_id) { codec_id_ = codec_id; }
|
||||||
: ACMGenericCodec(enable_red) {
|
|
||||||
codec_id_ = codec_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACMDTMFPlayout::~ACMDTMFPlayout() { return; }
|
ACMDTMFPlayout::~ACMDTMFPlayout() { return; }
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMDTMFPlayout : public ACMGenericCodec {
|
class ACMDTMFPlayout : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMDTMFPlayout(int16_t codec_id, bool enable_red);
|
explicit ACMDTMFPlayout(int16_t codec_id);
|
||||||
~ACMDTMFPlayout();
|
~ACMDTMFPlayout();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -64,10 +64,8 @@ struct ACMG722DecStr {
|
|||||||
G722DecInst* inst_right; // instance for right channel in case of stereo
|
G722DecInst* inst_right; // instance for right channel in case of stereo
|
||||||
};
|
};
|
||||||
|
|
||||||
ACMG722::ACMG722(int16_t codec_id, bool enable_red)
|
ACMG722::ACMG722(int16_t codec_id)
|
||||||
: ACMGenericCodec(enable_red),
|
: encoder_inst_ptr_(NULL), encoder_inst_ptr_right_(NULL) {
|
||||||
encoder_inst_ptr_(NULL),
|
|
||||||
encoder_inst_ptr_right_(NULL) {
|
|
||||||
ptr_enc_str_ = new ACMG722EncStr;
|
ptr_enc_str_ = new ACMG722EncStr;
|
||||||
if (ptr_enc_str_ != NULL) {
|
if (ptr_enc_str_ != NULL) {
|
||||||
ptr_enc_str_->inst = NULL;
|
ptr_enc_str_->inst = NULL;
|
||||||
|
@ -27,7 +27,7 @@ struct ACMG722DecStr;
|
|||||||
|
|
||||||
class ACMG722 : public ACMGenericCodec {
|
class ACMG722 : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMG722(int16_t codec_id, bool enable_red);
|
explicit ACMG722(int16_t codec_id);
|
||||||
~ACMG722();
|
~ACMG722();
|
||||||
|
|
||||||
// For FEC.
|
// For FEC.
|
||||||
|
@ -84,9 +84,8 @@ namespace acm2 {
|
|||||||
|
|
||||||
#ifndef WEBRTC_CODEC_G722_1
|
#ifndef WEBRTC_CODEC_G722_1
|
||||||
|
|
||||||
ACMG722_1::ACMG722_1(int16_t /* codec_id */, bool enable_red)
|
ACMG722_1::ACMG722_1(int16_t /* codec_id */)
|
||||||
: ACMGenericCodec(enable_red),
|
: operational_rate_(-1),
|
||||||
operational_rate_(-1),
|
|
||||||
encoder_inst_ptr_(NULL),
|
encoder_inst_ptr_(NULL),
|
||||||
encoder_inst_ptr_right_(NULL),
|
encoder_inst_ptr_right_(NULL),
|
||||||
encoder_inst16_ptr_(NULL),
|
encoder_inst16_ptr_(NULL),
|
||||||
|
@ -28,7 +28,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMG722_1 : public ACMGenericCodec {
|
class ACMG722_1 : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMG722_1(int16_t codec_id, bool enable_red);
|
explicit ACMG722_1(int16_t codec_id);
|
||||||
~ACMG722_1();
|
~ACMG722_1();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -84,9 +84,8 @@ namespace acm2 {
|
|||||||
|
|
||||||
#ifndef WEBRTC_CODEC_G722_1C
|
#ifndef WEBRTC_CODEC_G722_1C
|
||||||
|
|
||||||
ACMG722_1C::ACMG722_1C(int16_t /* codec_id */, bool enable_red)
|
ACMG722_1C::ACMG722_1C(int16_t /* codec_id */)
|
||||||
: ACMGenericCodec(enable_red),
|
: operational_rate_(-1),
|
||||||
operational_rate_(-1),
|
|
||||||
encoder_inst_ptr_(NULL),
|
encoder_inst_ptr_(NULL),
|
||||||
encoder_inst_ptr_right_(NULL),
|
encoder_inst_ptr_right_(NULL),
|
||||||
encoder_inst24_ptr_(NULL),
|
encoder_inst24_ptr_(NULL),
|
||||||
|
@ -28,7 +28,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMG722_1C : public ACMGenericCodec {
|
class ACMG722_1C : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMG722_1C(int16_t codec_id, bool enable_red);
|
explicit ACMG722_1C(int16_t codec_id);
|
||||||
~ACMG722_1C();
|
~ACMG722_1C();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -26,9 +26,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
#ifndef WEBRTC_CODEC_G729
|
#ifndef WEBRTC_CODEC_G729
|
||||||
|
|
||||||
ACMG729::ACMG729(int16_t /* codec_id */, bool enable_red)
|
ACMG729::ACMG729(int16_t /* codec_id */) : encoder_inst_ptr_(NULL) {}
|
||||||
: ACMGenericCodec(enable_red), encoder_inst_ptr_(NULL) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ACMG729::~ACMG729() { return; }
|
ACMG729::~ACMG729() { return; }
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMG729 : public ACMGenericCodec {
|
class ACMG729 : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMG729(int16_t codec_id, bool enable_red);
|
explicit ACMG729(int16_t codec_id);
|
||||||
~ACMG729();
|
~ACMG729();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -25,9 +25,8 @@ namespace acm2 {
|
|||||||
|
|
||||||
#ifndef WEBRTC_CODEC_G729_1
|
#ifndef WEBRTC_CODEC_G729_1
|
||||||
|
|
||||||
ACMG729_1::ACMG729_1(int16_t /* codec_id */, bool enable_red)
|
ACMG729_1::ACMG729_1(int16_t /* codec_id */)
|
||||||
: ACMGenericCodec(enable_red),
|
: encoder_inst_ptr_(NULL),
|
||||||
encoder_inst_ptr_(NULL),
|
|
||||||
my_rate_(32000),
|
my_rate_(32000),
|
||||||
flag_8khz_(0),
|
flag_8khz_(0),
|
||||||
flag_g729_mode_(0) {
|
flag_g729_mode_(0) {
|
||||||
|
@ -23,7 +23,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMG729_1 : public ACMGenericCodec {
|
class ACMG729_1 : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMG729_1(int16_t codec_id, bool enable_red);
|
explicit ACMG729_1(int16_t codec_id);
|
||||||
~ACMG729_1();
|
~ACMG729_1();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -37,7 +37,7 @@ enum {
|
|||||||
// We set some of the variables to invalid values as a check point
|
// We set some of the variables to invalid values as a check point
|
||||||
// if a proper initialization has happened. Another approach is
|
// if a proper initialization has happened. Another approach is
|
||||||
// to initialize to a default codec that we are sure is always included.
|
// to initialize to a default codec that we are sure is always included.
|
||||||
ACMGenericCodec::ACMGenericCodec(bool enable_red)
|
ACMGenericCodec::ACMGenericCodec()
|
||||||
: in_audio_ix_write_(0),
|
: in_audio_ix_write_(0),
|
||||||
in_audio_ix_read_(0),
|
in_audio_ix_read_(0),
|
||||||
in_timestamp_ix_write_(0),
|
in_timestamp_ix_write_(0),
|
||||||
@ -60,7 +60,6 @@ ACMGenericCodec::ACMGenericCodec(bool enable_red)
|
|||||||
sent_cn_previous_(false),
|
sent_cn_previous_(false),
|
||||||
prev_frame_cng_(0),
|
prev_frame_cng_(0),
|
||||||
has_internal_fec_(false),
|
has_internal_fec_(false),
|
||||||
copy_red_enabled_(enable_red),
|
|
||||||
codec_wrapper_lock_(*RWLockWrapper::CreateRWLock()),
|
codec_wrapper_lock_(*RWLockWrapper::CreateRWLock()),
|
||||||
last_timestamp_(0xD87F3F9F),
|
last_timestamp_(0xD87F3F9F),
|
||||||
unique_id_(0) {
|
unique_id_(0) {
|
||||||
@ -203,16 +202,6 @@ int ACMGenericCodec::SetFEC(bool enable_fec) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ACMGenericCodec::EnableCopyRed(bool enable, int /*red_payload_type*/) {
|
|
||||||
WriteLockScoped lockCodec(codec_wrapper_lock_);
|
|
||||||
copy_red_enabled_ = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ACMGenericCodec::ExternalRedNeeded() {
|
|
||||||
ReadLockScoped lockCodec(codec_wrapper_lock_);
|
|
||||||
return copy_red_enabled_;
|
|
||||||
}
|
|
||||||
|
|
||||||
int16_t ACMGenericCodec::Encode(uint8_t* bitstream,
|
int16_t ACMGenericCodec::Encode(uint8_t* bitstream,
|
||||||
int16_t* bitstream_len_byte,
|
int16_t* bitstream_len_byte,
|
||||||
uint32_t* timestamp,
|
uint32_t* timestamp,
|
||||||
|
@ -40,7 +40,7 @@ class ACMGenericCodec {
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// Constructor of the class
|
// Constructor of the class
|
||||||
//
|
//
|
||||||
explicit ACMGenericCodec(bool enable_red);
|
ACMGenericCodec();
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// Destructor of the class.
|
// Destructor of the class.
|
||||||
@ -614,13 +614,6 @@ class ACMGenericCodec {
|
|||||||
//
|
//
|
||||||
virtual int SetPacketLossRate(int /* loss_rate */) { return 0; }
|
virtual int SetPacketLossRate(int /* loss_rate */) { return 0; }
|
||||||
|
|
||||||
// Sets if CopyRed should be enabled.
|
|
||||||
virtual void EnableCopyRed(bool enable, int red_payload_type);
|
|
||||||
|
|
||||||
// Returns true if the caller needs to produce RED data manually (that is, if
|
|
||||||
// RED has been enabled but the codec isn't able to produce the data itself).
|
|
||||||
virtual bool ExternalRedNeeded();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// All the functions with FunctionNameSafe(...) contain the actual
|
// All the functions with FunctionNameSafe(...) contain the actual
|
||||||
@ -960,8 +953,6 @@ class ACMGenericCodec {
|
|||||||
// FEC.
|
// FEC.
|
||||||
bool has_internal_fec_ GUARDED_BY(codec_wrapper_lock_);
|
bool has_internal_fec_ GUARDED_BY(codec_wrapper_lock_);
|
||||||
|
|
||||||
bool copy_red_enabled_ GUARDED_BY(codec_wrapper_lock_);
|
|
||||||
|
|
||||||
WebRtcACMCodecParams encoder_params_ GUARDED_BY(codec_wrapper_lock_);
|
WebRtcACMCodecParams encoder_params_ GUARDED_BY(codec_wrapper_lock_);
|
||||||
|
|
||||||
// Used to lock wrapper internal data
|
// Used to lock wrapper internal data
|
||||||
|
@ -25,9 +25,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
#ifndef WEBRTC_CODEC_GSMFR
|
#ifndef WEBRTC_CODEC_GSMFR
|
||||||
|
|
||||||
ACMGSMFR::ACMGSMFR(int16_t /* codec_id */, bool enable_red)
|
ACMGSMFR::ACMGSMFR(int16_t /* codec_id */) : encoder_inst_ptr_(NULL) {}
|
||||||
: ACMGenericCodec(enable_red), encoder_inst_ptr_(NULL) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ACMGSMFR::~ACMGSMFR() { return; }
|
ACMGSMFR::~ACMGSMFR() { return; }
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMGSMFR : public ACMGenericCodec {
|
class ACMGSMFR : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMGSMFR(int16_t codec_id, bool enable_red);
|
explicit ACMGSMFR(int16_t codec_id);
|
||||||
~ACMGSMFR();
|
~ACMGSMFR();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -44,8 +44,7 @@ int16_t ACMILBC::SetBitRateSafe(const int32_t /* rate */) { return -1; }
|
|||||||
|
|
||||||
#else //===================== Actual Implementation =======================
|
#else //===================== Actual Implementation =======================
|
||||||
|
|
||||||
ACMILBC::ACMILBC(int16_t codec_id, bool enable_red)
|
ACMILBC::ACMILBC(int16_t codec_id) : encoder_inst_ptr_(NULL) {
|
||||||
: ACMGenericCodec(enable_red), encoder_inst_ptr_(NULL) {
|
|
||||||
codec_id_ = codec_id;
|
codec_id_ = codec_id;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMILBC : public ACMGenericCodec {
|
class ACMILBC : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMILBC(int16_t codec_id, bool enable_red);
|
explicit ACMILBC(int16_t codec_id);
|
||||||
~ACMILBC();
|
~ACMILBC();
|
||||||
|
|
||||||
// for FEC
|
// for FEC
|
||||||
|
@ -261,9 +261,8 @@ static uint16_t ACMISACFixGetDecSampRate(ACM_ISAC_STRUCT* /* inst */) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ACMISAC::ACMISAC(int16_t codec_id, bool enable_red)
|
ACMISAC::ACMISAC(int16_t codec_id)
|
||||||
: ACMGenericCodec(enable_red),
|
: codec_inst_crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
codec_inst_crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
|
|
||||||
is_enc_initialized_(false),
|
is_enc_initialized_(false),
|
||||||
isac_coding_mode_(CHANNEL_INDEPENDENT),
|
isac_coding_mode_(CHANNEL_INDEPENDENT),
|
||||||
enforce_frame_size_(false),
|
enforce_frame_size_(false),
|
||||||
|
@ -31,7 +31,7 @@ enum IsacCodingMode {
|
|||||||
|
|
||||||
class ACMISAC : public ACMGenericCodec, AudioDecoder {
|
class ACMISAC : public ACMGenericCodec, AudioDecoder {
|
||||||
public:
|
public:
|
||||||
ACMISAC(int16_t codec_id, bool enable_red);
|
explicit ACMISAC(int16_t codec_id);
|
||||||
~ACMISAC();
|
~ACMISAC();
|
||||||
|
|
||||||
int16_t InternalInitDecoder(WebRtcACMCodecParams* codec_params)
|
int16_t InternalInitDecoder(WebRtcACMCodecParams* codec_params)
|
||||||
|
@ -63,12 +63,11 @@ int16_t ACMOpus::SetBitRateSafe(const int32_t /*rate*/) {
|
|||||||
|
|
||||||
#else //===================== Actual Implementation =======================
|
#else //===================== Actual Implementation =======================
|
||||||
|
|
||||||
ACMOpus::ACMOpus(int16_t codec_id, bool enable_red)
|
ACMOpus::ACMOpus(int16_t codec_id)
|
||||||
: ACMGenericCodec(enable_red),
|
: encoder_inst_ptr_(NULL),
|
||||||
encoder_inst_ptr_(NULL),
|
sample_freq_(32000), // Default sampling frequency.
|
||||||
sample_freq_(32000), // Default sampling frequency.
|
bitrate_(20000), // Default bit-rate.
|
||||||
bitrate_(20000), // Default bit-rate.
|
channels_(1), // Default mono.
|
||||||
channels_(1), // Default mono.
|
|
||||||
packet_loss_rate_(0), // Initial packet loss rate.
|
packet_loss_rate_(0), // Initial packet loss rate.
|
||||||
application_(kVoip) { // Initial application mode.
|
application_(kVoip) { // Initial application mode.
|
||||||
codec_id_ = codec_id;
|
codec_id_ = codec_id;
|
||||||
|
@ -23,7 +23,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMOpus : public ACMGenericCodec {
|
class ACMOpus : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMOpus(int16_t codec_id, bool enable_red);
|
explicit ACMOpus(int16_t codec_id);
|
||||||
~ACMOpus();
|
~ACMOpus();
|
||||||
|
|
||||||
ACMGenericCodec* CreateInstance(void);
|
ACMGenericCodec* CreateInstance(void);
|
||||||
|
@ -31,7 +31,8 @@ namespace {
|
|||||||
|
|
||||||
class AcmOpusTest : public ACMOpus {
|
class AcmOpusTest : public ACMOpus {
|
||||||
public:
|
public:
|
||||||
explicit AcmOpusTest(int16_t codec_id) : ACMOpus(codec_id, false) {}
|
explicit AcmOpusTest(int16_t codec_id)
|
||||||
|
: ACMOpus(codec_id) {}
|
||||||
~AcmOpusTest() {}
|
~AcmOpusTest() {}
|
||||||
int packet_loss_rate() { return packet_loss_rate_; }
|
int packet_loss_rate() { return packet_loss_rate_; }
|
||||||
OpusApplicationMode application() { return application_; }
|
OpusApplicationMode application() { return application_; }
|
||||||
|
@ -44,8 +44,7 @@ int16_t ACMPCM16B::InternalCreateEncoder() { return -1; }
|
|||||||
void ACMPCM16B::DestructEncoderSafe() { return; }
|
void ACMPCM16B::DestructEncoderSafe() { return; }
|
||||||
|
|
||||||
#else //===================== Actual Implementation =======================
|
#else //===================== Actual Implementation =======================
|
||||||
ACMPCM16B::ACMPCM16B(int16_t codec_id, bool enable_red)
|
ACMPCM16B::ACMPCM16B(int16_t codec_id) {
|
||||||
: ACMGenericCodec(enable_red) {
|
|
||||||
codec_id_ = codec_id;
|
codec_id_ = codec_id;
|
||||||
sampling_freq_hz_ = ACMCodecDB::CodecFreq(codec_id_);
|
sampling_freq_hz_ = ACMCodecDB::CodecFreq(codec_id_);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMPCM16B : public ACMGenericCodec {
|
class ACMPCM16B : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMPCM16B(int16_t codec_id, bool enable_red);
|
explicit ACMPCM16B(int16_t codec_id);
|
||||||
~ACMPCM16B();
|
~ACMPCM16B();
|
||||||
|
|
||||||
// For FEC.
|
// For FEC.
|
||||||
|
@ -20,10 +20,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
namespace acm2 {
|
namespace acm2 {
|
||||||
|
|
||||||
ACMPCMA::ACMPCMA(int16_t codec_id, bool enable_red)
|
ACMPCMA::ACMPCMA(int16_t codec_id) { codec_id_ = codec_id; }
|
||||||
: ACMGenericCodec(enable_red) {
|
|
||||||
codec_id_ = codec_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACMPCMA::~ACMPCMA() { return; }
|
ACMPCMA::~ACMPCMA() { return; }
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMPCMA : public ACMGenericCodec {
|
class ACMPCMA : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMPCMA(int16_t codec_id, bool enable_red);
|
explicit ACMPCMA(int16_t codec_id);
|
||||||
~ACMPCMA();
|
~ACMPCMA();
|
||||||
|
|
||||||
// For FEC.
|
// For FEC.
|
||||||
|
@ -20,10 +20,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
namespace acm2 {
|
namespace acm2 {
|
||||||
|
|
||||||
ACMPCMU::ACMPCMU(int16_t codec_id, bool enable_red)
|
ACMPCMU::ACMPCMU(int16_t codec_id) { codec_id_ = codec_id; }
|
||||||
: ACMGenericCodec(enable_red) {
|
|
||||||
codec_id_ = codec_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACMPCMU::~ACMPCMU() {}
|
ACMPCMU::~ACMPCMU() {}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMPCMU : public ACMGenericCodec {
|
class ACMPCMU : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMPCMU(int16_t codec_id, bool enable_red);
|
explicit ACMPCMU(int16_t codec_id);
|
||||||
~ACMPCMU();
|
~ACMPCMU();
|
||||||
|
|
||||||
// For FEC.
|
// For FEC.
|
||||||
|
@ -17,10 +17,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
namespace acm2 {
|
namespace acm2 {
|
||||||
|
|
||||||
ACMRED::ACMRED(int16_t codec_id, bool enable_red)
|
ACMRED::ACMRED(int16_t codec_id) { codec_id_ = codec_id; }
|
||||||
: ACMGenericCodec(enable_red) {
|
|
||||||
codec_id_ = codec_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
ACMRED::~ACMRED() {}
|
ACMRED::~ACMRED() {}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMRED : public ACMGenericCodec {
|
class ACMRED : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMRED(int16_t codec_id, bool enable_red);
|
explicit ACMRED(int16_t codec_id);
|
||||||
~ACMRED();
|
~ACMRED();
|
||||||
|
|
||||||
// For FEC.
|
// For FEC.
|
||||||
|
@ -24,9 +24,8 @@ namespace webrtc {
|
|||||||
namespace acm2 {
|
namespace acm2 {
|
||||||
|
|
||||||
#ifndef WEBRTC_CODEC_SPEEX
|
#ifndef WEBRTC_CODEC_SPEEX
|
||||||
ACMSPEEX::ACMSPEEX(int16_t /* codec_id */, bool enable_red)
|
ACMSPEEX::ACMSPEEX(int16_t /* codec_id */)
|
||||||
: ACMGenericCodec(enable_red),
|
: encoder_inst_ptr_(NULL),
|
||||||
encoder_inst_ptr_(NULL),
|
|
||||||
compl_mode_(0),
|
compl_mode_(0),
|
||||||
vbr_enabled_(false),
|
vbr_enabled_(false),
|
||||||
encoding_rate_(-1),
|
encoding_rate_(-1),
|
||||||
|
@ -23,7 +23,7 @@ namespace acm2 {
|
|||||||
|
|
||||||
class ACMSPEEX : public ACMGenericCodec {
|
class ACMSPEEX : public ACMGenericCodec {
|
||||||
public:
|
public:
|
||||||
ACMSPEEX(int16_t codec_id, bool enable_red);
|
explicit ACMSPEEX(int16_t codec_id);
|
||||||
~ACMSPEEX();
|
~ACMSPEEX();
|
||||||
|
|
||||||
// For FEC.
|
// For FEC.
|
||||||
|
Reference in New Issue
Block a user