Adding online bitrate change to voe_cmd_test

This is to verify a way of changing the bitrate on-the-fly under current WebRTC implementation.

TEST=changing bit rate for different codecs. sound quality changed when bit rate was set successful. catched error when bit rate is invalid for a running codec.

BUG=
R=andrew@webrtc.org, tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/17059004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6901 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
minyue@webrtc.org 2014-08-14 12:15:27 +00:00
parent 817a034cf2
commit 4521e2d0bd

View File

@ -446,6 +446,8 @@ void RunTest(std::string out_path) {
printf("%i. Toggle Opus stereo (Opus must be selected again to apply "
"the setting) \n", option_index++);
printf("%i. Set Opus maximum audio bandwidth \n", option_index++);
printf("%i. Set bit rate (only take effect on codecs that allow the "
"change) \n", option_index++);
printf("Select action or %i to stop the call: ", option_index);
int option_selection;
@ -764,6 +766,13 @@ void RunTest(std::string out_path) {
ASSERT_EQ(1, scanf("%i", &max_playback_rate));
res = codec->SetOpusMaxBandwidth(chan, max_playback_rate);
VALIDATE;
} else if (option_selection == option_index++) {
res = codec->GetSendCodec(chan, cinst);
VALIDATE;
printf("Current bit rate is %i bps, set to: ", cinst.rate);
ASSERT_EQ(1, scanf("%i", &cinst.rate));
res = codec->SetSendCodec(chan, cinst);
VALIDATE;
} else {
break;
}