Changing non-const reference arguments to pointers, ACM

Part of refactoring of ACM, and recent lint-warnings.
This CL changes non-const references in the ACM API to pointers.

BUG=issue1372

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3543 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tina.legrand@webrtc.org
2013-02-20 15:22:23 +00:00
parent 0b6293aaaa
commit 374aa49e1a
20 changed files with 214 additions and 207 deletions

View File

@ -73,14 +73,14 @@ void Sender::Setup(AudioCodingModule *acm, RTPStream *rtpStream) {
// Choose codec on command line.
printf("List of supported codec.\n");
for (int n = 0; n < noOfCodecs; n++) {
acm->Codec(n, sendCodec);
acm->Codec(n, &sendCodec);
printf("%d %s\n", n, sendCodec.plname);
}
printf("Choose your codec:");
ASSERT_GT(scanf("%d", &codecNo), 0);
}
acm->Codec(codecNo, sendCodec);
acm->Codec(codecNo, &sendCodec);
if (!strcmp(sendCodec.plname, "CELT")) {
sendCodec.channels = 1;
}
@ -144,7 +144,7 @@ void Receiver::Setup(AudioCodingModule *acm, RTPStream *rtpStream) {
noOfCodecs = acm->NumberOfCodecs();
for (int i = 0; i < noOfCodecs; i++) {
acm->Codec((WebRtc_UWord8) i, recvCodec);
acm->Codec((WebRtc_UWord8) i, &recvCodec);
if (acm->RegisterReceiveCodec(recvCodec) != 0) {
printf("Unable to register codec: for run: codecId: %d\n", codeId);
exit(1);
@ -224,7 +224,7 @@ bool Receiver::IncomingPacket() {
bool Receiver::PlayoutData() {
AudioFrame audioFrame;
if (_acm->PlayoutData10Ms(_frequency, audioFrame) != 0) {
if (_acm->PlayoutData10Ms(_frequency, &audioFrame) != 0) {
printf("Error when calling PlayoutData10Ms, for run: codecId: %d\n",
codeId);
exit(1);
@ -305,7 +305,7 @@ void EncodeDecodeTest::Perform() {
}
if (_testMode != 2) {
for (int n = 0; n < numCodecs; n++) {
acm->Codec(n, sendCodecTmp);
acm->Codec(n, &sendCodecTmp);
if (STR_CASE_CMP(sendCodecTmp.plname, "telephone-event") == 0) {
numPars[n] = 0;
} else if (STR_CASE_CMP(sendCodecTmp.plname, "cn") == 0) {
@ -381,7 +381,7 @@ void EncodeDecodeTest::EncodeToFile(int fileType, int codeId, int* codePars,
_sender.Setup(acm, &rtpFile);
struct CodecInst sendCodecInst;
if (acm->SendCodec(sendCodecInst) >= 0) {
if (acm->SendCodec(&sendCodecInst) >= 0) {
_sender.Run();
}
_sender.Teardown();