Switch to using new ACM methods for encoder management

BUG=webrtc:5028

Review URL: https://codereview.webrtc.org/1677013002

Cr-Commit-Position: refs/heads/master@{#12267}
This commit is contained in:
kwiberg
2016-04-06 12:22:38 -07:00
committed by Commit bot
parent dc2242d351
commit c8d071e4e0
8 changed files with 92 additions and 49 deletions

View File

@ -29,23 +29,19 @@ AudioCoder::~AudioCoder()
{
}
int32_t AudioCoder::SetEncodeCodec(const CodecInst& codecInst)
{
if(_acm->RegisterSendCodec((CodecInst&)codecInst) == -1)
{
return -1;
}
return 0;
int32_t AudioCoder::SetEncodeCodec(const CodecInst& codecInst) {
const bool success = codec_manager_.RegisterEncoder(codecInst) &&
codec_manager_.MakeEncoder(&rent_a_codec_, _acm.get());
return success ? 0 : -1;
}
int32_t AudioCoder::SetDecodeCodec(const CodecInst& codecInst)
{
if(_acm->RegisterReceiveCodec((CodecInst&)codecInst) == -1)
{
return -1;
}
memcpy(&_receiveCodec,&codecInst,sizeof(CodecInst));
return 0;
int32_t AudioCoder::SetDecodeCodec(const CodecInst& codecInst) {
if (_acm->RegisterReceiveCodec(
codecInst, [&] { return rent_a_codec_.RentIsacDecoder(); }) == -1) {
return -1;
}
memcpy(&_receiveCodec, &codecInst, sizeof(CodecInst));
return 0;
}
int32_t AudioCoder::Decode(AudioFrame& decodedAudio,