| Index: webrtc/voice_engine/voe_codec_impl.cc
|
| diff --git a/webrtc/voice_engine/voe_codec_impl.cc b/webrtc/voice_engine/voe_codec_impl.cc
|
| index 2022024536c164b13b9d77825940a7e579b279d1..a329463d7dcd1745c3254dcafdab7d0c8c1a1c87 100644
|
| --- a/webrtc/voice_engine/voe_codec_impl.cc
|
| +++ b/webrtc/voice_engine/voe_codec_impl.cc
|
| @@ -388,4 +388,36 @@ int VoECodecImpl::GetOpusDtxStatus(int channel, bool* enabled) {
|
| return channelPtr->GetOpusDtx(enabled);
|
| }
|
|
|
| +int VoECodecImpl::SetOpusCbr(int channel, bool enable_cbr) {
|
| + WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
| + "SetOpusCbr(channel=%d, enable=%d)", channel, enable_cbr);
|
| + 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,
|
| + "SetOpusCbr() failed to locate channel");
|
| + return -1;
|
| + }
|
| + return channelPtr->SetOpusCbr(enable_cbr);
|
| +}
|
| +
|
| +int VoECodecImpl::GetOpusCbrStatus(int channel, bool* enabled) {
|
| + 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,
|
| + "GetOpusCbrStatus() failed to locate channel");
|
| + return -1;
|
| + }
|
| + return channelPtr->GetOpusCbr(enabled);
|
| +}
|
| +
|
| } // namespace webrtc
|
|
|