Added SetBitRate function to VoE API to allow changing the audio bitrate.
If the requested bitrate is not valid for the codec, the codec will decide on an appropriate value. Updated VoE command line tool to use new SetBitRate function. Includes unittests for SetBitRate function. BUG= R=henrik.lundin@webrtc.org, henrika@webrtc.org, kwiberg@webrtc.org, pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/50789004 Cr-Commit-Position: refs/heads/master@{#9115}
This commit is contained in:
@ -365,11 +365,7 @@ int CodecManager::RegisterSendCodec(const CodecInst& send_codec) {
|
||||
|
||||
// Check if a change in Rate is required.
|
||||
if (send_codec.rate != send_codec_inst_.rate) {
|
||||
if (current_encoder_->SetBitRate(send_codec.rate) < 0) {
|
||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id,
|
||||
"Could not change the codec rate.");
|
||||
return -1;
|
||||
}
|
||||
current_encoder_->SetBitRate(send_codec.rate);
|
||||
send_codec_inst_.rate = send_codec.rate;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user