Adding SetOpusMaxBandwidth in VoE and ACM
This is a step to solve
https://code.google.com/p/webrtc/issues/detail?id=1906
In particular, we add an API in VoE and ACM to call Opus's API of setting maximum bandwidth.
TEST = added a test in voe_cmd_test and listened to the result
BUG=
R=henrika@google.com, henrika@webrtc.org, turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/21129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6869 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/voice_engine/voe_codec_impl.cc b/webrtc/voice_engine/voe_codec_impl.cc
index 4aa0556..5099407 100644
--- a/webrtc/voice_engine/voe_codec_impl.cc
+++ b/webrtc/voice_engine/voe_codec_impl.cc
@@ -418,6 +418,24 @@
return 0;
}
+int VoECodecImpl::SetOpusMaxBandwidth(int channel, int bandwidth_hz) {
+ WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
+ "SetOpusMaxBandwidth(channel=%d, bandwidth_hz=%d)", channel,
+ bandwidth_hz);
+ if (!_shared->statistics().Initialized()) {
+ _shared->SetLastError(VE_NOT_INITED, kTraceError);
+ return -1;
+ }
+ voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
+ voe::Channel* channelPtr = ch.channel();
+ if (channelPtr == NULL) {
+ _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
+ "SetOpusMaxBandwidth failed to locate channel");
+ return -1;
+ }
+ return channelPtr->SetOpusMaxBandwidth(bandwidth_hz);
+}
+
void VoECodecImpl::ACMToExternalCodecRepresentation(CodecInst& toInst,
const CodecInst& fromInst)
{