From f3a8e85cf12fe25ef4adb7ae186fa8384b9eb9b3 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Thu, 15 Mar 2012 21:36:42 +0400
Subject: [PATCH 1/1] No such macro GSMAMR - use AMR instead

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
 .../audio_coding/main/test/TestAllCodecs.cc        |  4 +--
 .../media_file/source/media_file_utility.cc        | 30 +++++++++++-----------
 .../test/auto_test/voe_extended_test.cc            |  8 +++---
 src/voice_engine/voe_codec_impl.cc                 |  8 +++---
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/modules/audio_coding/main/test/TestAllCodecs.cc b/src/modules/audio_coding/main/test/TestAllCodecs.cc
index b312390..56f23c6 100644
--- a/src/modules/audio_coding/main/test/TestAllCodecs.cc
+++ b/src/modules/audio_coding/main/test/TestAllCodecs.cc
@@ -620,10 +620,10 @@ void TestAllCodecs::Perform() {
     /* Print out all codecs that were not tested in the run */
     printf("The following codecs was not included in the test:\n");
 #ifndef WEBRTC_CODEC_AMR
-    printf("   GSMAMR\n");
+    printf("   AMR\n");
 #endif
 #ifndef WEBRTC_CODEC_AMRWB
-    printf("   GSMAMR-wb\n");
+    printf("   AMR-wb\n");
 #endif
 #ifndef WEBRTC_CODEC_G722
     printf("   G.722\n");
diff --git a/src/modules/media_file/source/media_file_utility.cc b/src/modules/media_file/source/media_file_utility.cc
index 8d06a88..5616e34 100644
--- a/src/modules/media_file/source/media_file_utility.cc
+++ b/src/modules/media_file/source/media_file_utility.cc
@@ -1407,7 +1407,7 @@ WebRtc_Word32 ModuleFileUtility::InitCompressedReading(
         start,
         stop);
 
-#if defined(WEBRTC_CODEC_GSMAMR) || defined(WEBRTC_CODEC_GSMAMRWB) || \
+#if defined(WEBRTC_CODEC_AMR) || defined(WEBRTC_CODEC_AMRWB) || \
     defined(WEBRTC_CODEC_ILBC)
     WebRtc_Word16 read_len = 0;
 #endif
@@ -1418,10 +1418,10 @@ WebRtc_Word32 ModuleFileUtility::InitCompressedReading(
     _startPointInMs = start;
     _stopPointInMs = stop;
 
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
     WebRtc_Word32 AMRmode2bytes[9]={12,13,15,17,19,20,26,31,5};
 #endif
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
     WebRtc_Word32 AMRWBmode2bytes[10]={17,23,32,36,40,46,50,58,60,6};
 #endif
 
@@ -1440,7 +1440,7 @@ WebRtc_Word32 ModuleFileUtility::InitCompressedReading(
         buf[cnt]=0;
     }
 
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
     if(!strcmp("#!AMR\n", buf))
     {
         strcpy(codec_info_.plname, "amr");
@@ -1484,7 +1484,7 @@ WebRtc_Word32 ModuleFileUtility::InitCompressedReading(
         }
     }
 #endif
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
     if(!strcmp("#!AMRWB\n", buf))
     {
         strcpy(codec_info_.plname, "amr-wb");
@@ -1605,10 +1605,10 @@ WebRtc_Word32 ModuleFileUtility::ReadCompressedData(InStream& in,
         outData,
         bufferSize);
 
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
     WebRtc_UWord32 AMRmode2bytes[9]={12,13,15,17,19,20,26,31,5};
 #endif
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
     WebRtc_UWord32 AMRWBmode2bytes[10]={17,23,32,36,40,46,50,58,60,6};
 #endif
     WebRtc_UWord32 bytesRead = 0;
@@ -1619,7 +1619,7 @@ WebRtc_Word32 ModuleFileUtility::ReadCompressedData(InStream& in,
         return -1;
     }
 
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
     if(_codecId == kCodecAmr)
     {
         WebRtc_Word32 res = in.Read(outData, 1);
@@ -1677,7 +1677,7 @@ WebRtc_Word32 ModuleFileUtility::ReadCompressedData(InStream& in,
         }
     }
 #endif
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
     if(_codecId == kCodecAmrWb)
     {
         WebRtc_Word32 res = in.Read(outData, 1);
@@ -1809,7 +1809,7 @@ WebRtc_Word32 ModuleFileUtility::InitCompressedWriting(
 
     _writing = false;
 
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
     if(STR_CASE_CMP(codecInst.plname, "amr") == 0)
     {
         if(codecInst.pacsize == 160)
@@ -1822,7 +1822,7 @@ WebRtc_Word32 ModuleFileUtility::InitCompressedWriting(
         }
     }
 #endif
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
     if(STR_CASE_CMP(codecInst.plname, "amr-wb") == 0)
     {
         if(codecInst.pacsize == 320)
@@ -2172,13 +2172,13 @@ WebRtc_Word32 ModuleFileUtility::set_codec_info(const CodecInst& codecInst)
             _codecId = kCodecL16_32Khz;
         }
     }
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
     else if(STR_CASE_CMP(codecInst.plname, "amr") == 0)
     {
         _codecId = kCodecAmr;
     }
 #endif
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
     else if(STR_CASE_CMP(codecInst.plname, "amr-wb") == 0)
     {
         _codecId = kCodecAmrWb;
@@ -2394,7 +2394,7 @@ WebRtc_Word32 ModuleFileUtility::FileDurationMs(const char* fileName,
             {
                 buf[cnt] = 0;
             }
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
             if(!strcmp("#!AMR\n", buf))
             {
                 WebRtc_UWord8 dummy;
@@ -2456,7 +2456,7 @@ WebRtc_Word32 ModuleFileUtility::FileDurationMs(const char* fileName,
                 }
             }
 #endif
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
             if(!strcmp("#!AMRWB\n", buf))
             {
                 WebRtc_UWord8 dummy;
diff --git a/src/voice_engine/test/auto_test/voe_extended_test.cc b/src/voice_engine/test/auto_test/voe_extended_test.cc
index 2fcd642..a9d1e29 100644
--- a/src/voice_engine/test/auto_test/voe_extended_test.cc
+++ b/src/voice_engine/test/auto_test/voe_extended_test.cc
@@ -2244,7 +2244,7 @@ int VoEExtendedTest::TestCodec() {
   ANL();
   ANL();
 
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
   //////////////////////////
   // SetAMREncFormat
 
@@ -2308,8 +2308,8 @@ int VoEExtendedTest::TestCodec() {
   ANL();
   AOK();
   ANL();
-#endif // #ifdef WEBRTC_CODEC_GSMAMR
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#endif // #ifdef WEBRTC_CODEC_AMR
+#ifdef WEBRTC_CODEC_AMRWB
   //////////////////////////
   // SetAMRWbEncFormat
 
@@ -2373,7 +2373,7 @@ int VoEExtendedTest::TestCodec() {
   ANL();
   AOK();
   ANL();
-#endif // #ifdef WEBRTC_CODEC_GSMAMRWB
+#endif // #ifdef WEBRTC_CODEC_AMRWB
   ///////////////////////////////
   // SetSendCNPayloadType
   TEST(SetSendCNPayloadType);
diff --git a/src/voice_engine/voe_codec_impl.cc b/src/voice_engine/voe_codec_impl.cc
index 588ffe6..6414efc 100644
--- a/src/voice_engine/voe_codec_impl.cc
+++ b/src/voice_engine/voe_codec_impl.cc
@@ -217,7 +217,7 @@ int VoECodecImpl::SetAMREncFormat(int channel, AmrMode mode)
 {
     WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                  "SetAMREncFormat(channel=%d, mode=%d)", channel, mode);
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
     if (!_shared->statistics().Initialized())
     {
         _shared->SetLastError(VE_NOT_INITED, kTraceError);
@@ -243,7 +243,7 @@ int VoECodecImpl::SetAMRDecFormat(int channel, AmrMode mode)
 {
     WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                  "SetAMRDecFormat(channel=%i, mode=%i)", channel, mode);
-#ifdef WEBRTC_CODEC_GSMAMR
+#ifdef WEBRTC_CODEC_AMR
     if (!_shared->statistics().Initialized())
     {
         _shared->SetLastError(VE_NOT_INITED, kTraceError);
@@ -271,7 +271,7 @@ int VoECodecImpl::SetAMRWbEncFormat(int channel, AmrMode mode)
                  "SetAMRWbEncFormat(channel=%d, mode=%d)", channel, mode);
     ANDROID_NOT_SUPPORTED(_shared->statistics());
     IPHONE_NOT_SUPPORTED(_shared->statistics());
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
     if (!_shared->statistics().Initialized())
     {
         _shared->SetLastError(VE_NOT_INITED, kTraceError);
@@ -299,7 +299,7 @@ int VoECodecImpl::SetAMRWbDecFormat(int channel, AmrMode mode)
                  "SetAMRWbDecFormat(channel=%i, mode=%i)", channel, mode);
     ANDROID_NOT_SUPPORTED(_shared->statistics());
     IPHONE_NOT_SUPPORTED(_shared->statistics());
-#ifdef WEBRTC_CODEC_GSMAMRWB
+#ifdef WEBRTC_CODEC_AMRWB
     if (!_shared->statistics().Initialized())
     {
         _shared->SetLastError(VE_NOT_INITED, kTraceError);
-- 
1.7.12.1

