Don't select audio codecs depending on GN vars `build_with_{chromium|mozilla}`

BUG=webrtc:8343

Change-Id: I5943006a4da17f72eb88eae9d7ea57574d54f680
Reviewed-on: https://webrtc-review.googlesource.com/9401
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20540}
diff --git a/api/audio_codecs/BUILD.gn b/api/audio_codecs/BUILD.gn
index fbb2fc5..8ea533b 100644
--- a/api/audio_codecs/BUILD.gn
+++ b/api/audio_codecs/BUILD.gn
@@ -43,6 +43,8 @@
     "../../rtc_base:rtc_base_approved",
     "L16:audio_decoder_L16",
     "g711:audio_decoder_g711",
+    "g722:audio_decoder_g722",
+    "isac:audio_decoder_isac",
   ]
   defines = []
   if (rtc_include_ilbc) {
@@ -57,21 +59,6 @@
   } else {
     defines += [ "WEBRTC_USE_BUILTIN_OPUS=0" ]
   }
-  if (build_with_mozilla) {
-    defines += [
-      "WEBRTC_USE_BUILTIN_G722=0",
-      "WEBRTC_USE_BUILTIN_ISAC=0",
-    ]
-  } else {
-    deps += [
-      "g722:audio_decoder_g722",
-      "isac:audio_decoder_isac",
-    ]
-    defines += [
-      "WEBRTC_USE_BUILTIN_G722=1",
-      "WEBRTC_USE_BUILTIN_ISAC=1",
-    ]
-  }
 }
 
 rtc_static_library("builtin_audio_encoder_factory") {
@@ -84,6 +71,8 @@
     "../../rtc_base:rtc_base_approved",
     "L16:audio_encoder_L16",
     "g711:audio_encoder_g711",
+    "g722:audio_encoder_g722",
+    "isac:audio_encoder_isac",
   ]
   defines = []
   if (rtc_include_ilbc) {
@@ -98,19 +87,4 @@
   } else {
     defines += [ "WEBRTC_USE_BUILTIN_OPUS=0" ]
   }
-  if (build_with_mozilla) {
-    defines += [
-      "WEBRTC_USE_BUILTIN_G722=0",
-      "WEBRTC_USE_BUILTIN_ISAC=0",
-    ]
-  } else {
-    deps += [
-      "g722:audio_encoder_g722",
-      "isac:audio_encoder_isac",
-    ]
-    defines += [
-      "WEBRTC_USE_BUILTIN_G722=1",
-      "WEBRTC_USE_BUILTIN_ISAC=1",
-    ]
-  }
 }
diff --git a/api/audio_codecs/builtin_audio_decoder_factory.cc b/api/audio_codecs/builtin_audio_decoder_factory.cc
index a6eac72..9520d2a 100644
--- a/api/audio_codecs/builtin_audio_decoder_factory.cc
+++ b/api/audio_codecs/builtin_audio_decoder_factory.cc
@@ -16,15 +16,11 @@
 #include "api/audio_codecs/L16/audio_decoder_L16.h"
 #include "api/audio_codecs/audio_decoder_factory_template.h"
 #include "api/audio_codecs/g711/audio_decoder_g711.h"
-#if WEBRTC_USE_BUILTIN_G722
-#include "api/audio_codecs/g722/audio_decoder_g722.h"  // nogncheck
-#endif
+#include "api/audio_codecs/g722/audio_decoder_g722.h"
 #if WEBRTC_USE_BUILTIN_ILBC
 #include "api/audio_codecs/ilbc/audio_decoder_ilbc.h"  // nogncheck
 #endif
-#if WEBRTC_USE_BUILTIN_ISAC
-#include "api/audio_codecs/isac/audio_decoder_isac.h"  // nogncheck
-#endif
+#include "api/audio_codecs/isac/audio_decoder_isac.h"
 #if WEBRTC_USE_BUILTIN_OPUS
 #include "api/audio_codecs/opus/audio_decoder_opus.h"  // nogncheck
 #endif
@@ -57,13 +53,7 @@
       AudioDecoderOpus,
 #endif
 
-#if WEBRTC_USE_BUILTIN_ISAC
-      AudioDecoderIsac,
-#endif
-
-#if WEBRTC_USE_BUILTIN_G722
-      AudioDecoderG722,
-#endif
+      AudioDecoderIsac, AudioDecoderG722,
 
 #if WEBRTC_USE_BUILTIN_ILBC
       AudioDecoderIlbc,
diff --git a/api/audio_codecs/builtin_audio_encoder_factory.cc b/api/audio_codecs/builtin_audio_encoder_factory.cc
index 8654d0d..877f850 100644
--- a/api/audio_codecs/builtin_audio_encoder_factory.cc
+++ b/api/audio_codecs/builtin_audio_encoder_factory.cc
@@ -16,15 +16,11 @@
 #include "api/audio_codecs/L16/audio_encoder_L16.h"
 #include "api/audio_codecs/audio_encoder_factory_template.h"
 #include "api/audio_codecs/g711/audio_encoder_g711.h"
-#if WEBRTC_USE_BUILTIN_G722
-#include "api/audio_codecs/g722/audio_encoder_g722.h"  // nogncheck
-#endif
+#include "api/audio_codecs/g722/audio_encoder_g722.h"
 #if WEBRTC_USE_BUILTIN_ILBC
 #include "api/audio_codecs/ilbc/audio_encoder_ilbc.h"  // nogncheck
 #endif
-#if WEBRTC_USE_BUILTIN_ISAC
-#include "api/audio_codecs/isac/audio_encoder_isac.h"  // nogncheck
-#endif
+#include "api/audio_codecs/isac/audio_encoder_isac.h"
 #if WEBRTC_USE_BUILTIN_OPUS
 #include "api/audio_codecs/opus/audio_encoder_opus.h"  // nogncheck
 #endif
@@ -61,13 +57,7 @@
       AudioEncoderOpus,
 #endif
 
-#if WEBRTC_USE_BUILTIN_ISAC
-      AudioEncoderIsac,
-#endif
-
-#if WEBRTC_USE_BUILTIN_G722
-      AudioEncoderG722,
-#endif
+      AudioEncoderIsac, AudioEncoderG722,
 
 #if WEBRTC_USE_BUILTIN_ILBC
       AudioEncoderIlbc,
diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn
index 941f13c..e5854ef 100644
--- a/modules/audio_coding/BUILD.gn
+++ b/modules/audio_coding/BUILD.gn
@@ -22,14 +22,12 @@
 if (rtc_include_opus) {
   audio_codec_deps += [ ":webrtc_opus" ]
 }
-if (!build_with_mozilla) {
-  if (current_cpu == "arm") {
-    audio_codec_deps += [ ":isac_fix" ]
-  } else {
-    audio_codec_deps += [ ":isac" ]
-  }
-  audio_codec_deps += [ ":g722" ]
+if (current_cpu == "arm") {
+  audio_codec_deps += [ ":isac_fix" ]
+} else {
+  audio_codec_deps += [ ":isac" ]
 }
+audio_codec_deps += [ ":g722" ]
 if (!build_with_mozilla && !build_with_chromium) {
   audio_codec_deps += [ ":red" ]
 }
diff --git a/modules/audio_coding/acm2/acm_codec_database.cc b/modules/audio_coding/acm2/acm_codec_database.cc
index 7b3b1d2..4553b52 100644
--- a/modules/audio_coding/acm2/acm_codec_database.cc
+++ b/modules/audio_coding/acm2/acm_codec_database.cc
@@ -85,12 +85,10 @@
 #ifdef WEBRTC_CODEC_ILBC
   {102, "ILBC", 8000, 240, 1, 13300},
 #endif
-#ifdef WEBRTC_CODEC_G722
   // Mono
   {9, "G722", 16000, 320, 1, 64000},
   // Stereo
   {119, "G722", 16000, 320, 2, 64000},
-#endif
 #ifdef WEBRTC_CODEC_OPUS
   // Opus internally supports 48, 24, 16, 12, 8 kHz.
   // Mono and stereo.
@@ -143,12 +141,10 @@
 #ifdef WEBRTC_CODEC_ILBC
     {4, {160, 240, 320, 480}, 0, 1},
 #endif
-#ifdef WEBRTC_CODEC_G722
     // Mono
     {6, {160, 320, 480, 640, 800, 960}, 0, 2},
     // Stereo
     {6, {160, 320, 480, 640, 800, 960}, 0, 2},
-#endif
 #ifdef WEBRTC_CODEC_OPUS
     // Opus supports frames shorter than 10ms,
     // but it doesn't help us to use them.
@@ -200,12 +196,10 @@
 #ifdef WEBRTC_CODEC_ILBC
     NetEqDecoder::kDecoderILBC,
 #endif
-#ifdef WEBRTC_CODEC_G722
     // Mono
     NetEqDecoder::kDecoderG722,
     // Stereo
     NetEqDecoder::kDecoderG722_2ch,
-#endif
 #ifdef WEBRTC_CODEC_OPUS
     // Mono and stereo.
     NetEqDecoder::kDecoderOpus,
diff --git a/modules/audio_coding/acm2/audio_coding_module_unittest.cc b/modules/audio_coding/acm2/audio_coding_module_unittest.cc
index 1d5b954..ca59b31 100644
--- a/modules/audio_coding/acm2/audio_coding_module_unittest.cc
+++ b/modules/audio_coding/acm2/audio_coding_module_unittest.cc
@@ -980,7 +980,7 @@
 };
 
 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \
-    defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722)
+    defined(WEBRTC_CODEC_ILBC)
 TEST_F(AcmReceiverBitExactnessOldApi, 8kHzOutput) {
   Run(8000, PlatformChecksum("2adede965c6f87de7142c51552111d08",
                              "028c0fc414b1c9ab7e582dccdf381e98",
@@ -1438,7 +1438,6 @@
 #else
 #define MAYBE_G722_20ms G722_20ms
 #endif
-#if defined(WEBRTC_CODEC_G722)
 TEST_F(AcmSenderBitExactnessOldApi, MAYBE_G722_20ms) {
   ASSERT_NO_FATAL_FAILURE(SetUpTest("G722", 16000, 1, 9, 320, 160));
   Run(AcmReceiverBitExactnessOldApi::PlatformChecksum(
@@ -1451,14 +1450,12 @@
           "android_arm64_payload", "android_arm64_clang_payload"),
       50, test::AcmReceiveTestOldApi::kMonoOutput);
 }
-#endif
 
 #if defined(WEBRTC_ANDROID)
 #define MAYBE_G722_stereo_20ms DISABLED_G722_stereo_20ms
 #else
 #define MAYBE_G722_stereo_20ms G722_stereo_20ms
 #endif
-#if defined(WEBRTC_CODEC_G722)
 TEST_F(AcmSenderBitExactnessOldApi, MAYBE_G722_stereo_20ms) {
   ASSERT_NO_FATAL_FAILURE(SetUpTest("G722", 16000, 2, 119, 320, 160));
   Run(AcmReceiverBitExactnessOldApi::PlatformChecksum(
@@ -1471,7 +1468,6 @@
           "android_arm64_payload", "android_arm64_clang_payload"),
       50, test::AcmReceiveTestOldApi::kStereoOutput);
 }
-#endif
 
 TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms) {
   ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960));
diff --git a/modules/audio_coding/acm2/rent_a_codec.cc b/modules/audio_coding/acm2/rent_a_codec.cc
index ff66890..120d54c 100644
--- a/modules/audio_coding/acm2/rent_a_codec.cc
+++ b/modules/audio_coding/acm2/rent_a_codec.cc
@@ -16,9 +16,7 @@
 #include "modules/audio_coding/codecs/cng/audio_encoder_cng.h"
 #include "modules/audio_coding/codecs/g711/audio_encoder_pcm.h"
 #include "rtc_base/logging.h"
-#ifdef WEBRTC_CODEC_G722
 #include "modules/audio_coding/codecs/g722/audio_encoder_g722.h"
-#endif
 #ifdef WEBRTC_CODEC_ILBC
 #include "modules/audio_coding/codecs/ilbc/audio_encoder_ilbc.h"
 #endif
@@ -175,10 +173,8 @@
   if (STR_CASE_CMP(speech_inst.plname, "ilbc") == 0)
     return std::unique_ptr<AudioEncoder>(new AudioEncoderIlbcImpl(speech_inst));
 #endif
-#ifdef WEBRTC_CODEC_G722
   if (STR_CASE_CMP(speech_inst.plname, "g722") == 0)
     return std::unique_ptr<AudioEncoder>(new AudioEncoderG722Impl(speech_inst));
-#endif
   LOG_F(LS_ERROR) << "Could not create encoder of type " << speech_inst.plname;
   return std::unique_ptr<AudioEncoder>();
 }
diff --git a/modules/audio_coding/acm2/rent_a_codec.h b/modules/audio_coding/acm2/rent_a_codec.h
index f1de72d..cecb914 100644
--- a/modules/audio_coding/acm2/rent_a_codec.h
+++ b/modules/audio_coding/acm2/rent_a_codec.h
@@ -58,10 +58,8 @@
 #ifdef WEBRTC_CODEC_ILBC
     kILBC,
 #endif
-#ifdef WEBRTC_CODEC_G722
     kG722,      // Mono
     kG722_2ch,  // Stereo
-#endif
 #ifdef WEBRTC_CODEC_OPUS
     kOpus,  // Mono and stereo
 #endif
@@ -92,10 +90,6 @@
 #ifndef WEBRTC_CODEC_ILBC
     kILBC = -1,
 #endif
-#ifndef WEBRTC_CODEC_G722
-    kG722 = -1,      // Mono
-    kG722_2ch = -1,  // Stereo
-#endif
 #ifndef WEBRTC_CODEC_OPUS
     kOpus = -1,  // Mono and stereo
 #endif
diff --git a/modules/audio_coding/audio_coding.gni b/modules/audio_coding/audio_coding.gni
index 41dcf00..9b0aba8 100644
--- a/modules/audio_coding/audio_coding.gni
+++ b/modules/audio_coding/audio_coding.gni
@@ -20,13 +20,10 @@
 } else {
   audio_codec_defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=0" ]
 }
-if (!build_with_mozilla) {
-  if (current_cpu == "arm") {
-    audio_codec_defines += [ "WEBRTC_CODEC_ISACFX" ]
-  } else {
-    audio_codec_defines += [ "WEBRTC_CODEC_ISAC" ]
-  }
-  audio_codec_defines += [ "WEBRTC_CODEC_G722" ]
+if (current_cpu == "arm") {
+  audio_codec_defines += [ "WEBRTC_CODEC_ISACFX" ]
+} else {
+  audio_codec_defines += [ "WEBRTC_CODEC_ISAC" ]
 }
 if (!build_with_mozilla && !build_with_chromium) {
   audio_codec_defines += [ "WEBRTC_CODEC_RED" ]
diff --git a/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc b/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc
index ec79c28..58bfaed 100644
--- a/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc
+++ b/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc
@@ -131,9 +131,7 @@
 #ifdef WEBRTC_CODEC_ISAC
     {"isac", 32000, 1},
 #endif
-#ifdef WEBRTC_CODEC_G722
     {"G722", 8000, 1},
-#endif
 #ifdef WEBRTC_CODEC_ILBC
     {"ilbc", 8000, 1},
 #endif
diff --git a/modules/audio_coding/neteq/neteq_unittest.cc b/modules/audio_coding/neteq/neteq_unittest.cc
index bb8c4e9..b0f3a39 100644
--- a/modules/audio_coding/neteq/neteq_unittest.cc
+++ b/modules/audio_coding/neteq/neteq_unittest.cc
@@ -450,8 +450,7 @@
 
 #if !defined(WEBRTC_IOS) && defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \
     (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) &&    \
-    defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722) &&        \
-    !defined(WEBRTC_ARCH_ARM64)
+    defined(WEBRTC_CODEC_ILBC) && !defined(WEBRTC_ARCH_ARM64)
 #define MAYBE_TestBitExactness TestBitExactness
 #else
 #define MAYBE_TestBitExactness DISABLED_TestBitExactness
diff --git a/modules/audio_coding/test/TestAllCodecs.cc b/modules/audio_coding/test/TestAllCodecs.cc
index ff28a28..f7f220f 100644
--- a/modules/audio_coding/test/TestAllCodecs.cc
+++ b/modules/audio_coding/test/TestAllCodecs.cc
@@ -151,7 +151,6 @@
 
   // All codecs are tested for all allowed sampling frequencies, rates and
   // packet sizes.
-#ifdef WEBRTC_CODEC_G722
   if (test_mode_ != 0) {
     printf("===============================================================\n");
   }
@@ -171,7 +170,6 @@
   RegisterSendCodec('A', codec_g722, 16000, 64000, 960, 0);
   Run(channel_a_to_b_);
   outfile_b_.Close();
-#endif
 #ifdef WEBRTC_CODEC_ILBC
   if (test_mode_ != 0) {
     printf("===============================================================\n");
@@ -324,9 +322,6 @@
 
     /* 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_G722
-    printf("   G.722\n");
-#endif
 #ifndef WEBRTC_CODEC_ILBC
     printf("   iLBC\n");
 #endif
diff --git a/modules/audio_coding/test/TestRedFec.cc b/modules/audio_coding/test/TestRedFec.cc
index 58561c6..034c595 100644
--- a/modules/audio_coding/test/TestRedFec.cc
+++ b/modules/audio_coding/test/TestRedFec.cc
@@ -38,13 +38,9 @@
   const char kNamePCMU[] = "PCMU";
   const char kNameCN[] = "CN";
   const char kNameRED[] = "RED";
-
-  // These three are only used by code #ifdeffed on WEBRTC_CODEC_G722.
-#ifdef WEBRTC_CODEC_G722
   const char kNameISAC[] = "ISAC";
   const char kNameG722[] = "G722";
   const char kNameOPUS[] = "opus";
-#endif
 }
 
 TestRedFec::TestRedFec()
@@ -104,11 +100,6 @@
   Run();
   _outFileB.Close();
 
-#ifndef WEBRTC_CODEC_G722
-  EXPECT_TRUE(false);
-  printf("G722 needs to be activated to run this test\n");
-  return;
-#else
   EXPECT_EQ(0, RegisterSendCodec('A', kNameG722, 16000));
   EXPECT_EQ(0, RegisterSendCodec('A', kNameCN, 16000));
 
@@ -412,8 +403,6 @@
   EXPECT_FALSE(_acmA->REDStatus());
   EXPECT_EQ(0, _acmA->SetCodecFEC(false));
   EXPECT_FALSE(_acmA->CodecFEC());
-
-#endif  // defined(WEBRTC_CODEC_G722)
 }
 
 int32_t TestRedFec::SetVAD(bool enableDTX, bool enableVAD, ACMVADMode vadMode) {
diff --git a/modules/audio_coding/test/TestStereo.cc b/modules/audio_coding/test/TestStereo.cc
index eca81f8..ba86719 100644
--- a/modules/audio_coding/test/TestStereo.cc
+++ b/modules/audio_coding/test/TestStereo.cc
@@ -114,13 +114,11 @@
       test_cntr_(0),
       pack_size_samp_(0),
       pack_size_bytes_(0),
-      counter_(0)
-#ifdef WEBRTC_CODEC_G722
-      , g722_pltype_(0)
-#endif
-      , l16_8khz_pltype_(-1)
-      , l16_16khz_pltype_(-1)
-      , l16_32khz_pltype_(-1)
+      counter_(0),
+      g722_pltype_(0),
+      l16_8khz_pltype_(-1),
+      l16_16khz_pltype_(-1),
+      l16_32khz_pltype_(-1)
 #ifdef PCMA_AND_PCMU
       , pcma_pltype_(-1)
       , pcmu_pltype_(-1)
@@ -128,7 +126,7 @@
 #ifdef WEBRTC_CODEC_OPUS
       , opus_pltype_(-1)
 #endif
-      {
+{
   // test_mode = 0 for silent test (auto test)
   test_mode_ = test_mode;
 }
@@ -217,7 +215,6 @@
 
   // All codecs are tested for all allowed sampling frequencies, rates and
   // packet sizes.
-#ifdef WEBRTC_CODEC_G722
   if (test_mode_ != 0) {
     printf("===========================================================\n");
     printf("Test number: %d\n", test_cntr_ + 1);
@@ -246,7 +243,7 @@
       g722_pltype_);
   Run(channel_a2b_, audio_channels, codec_channels);
   out_file_.Close();
-#endif
+
   if (test_mode_ != 0) {
     printf("===========================================================\n");
     printf("Test number: %d\n", test_cntr_ + 1);
@@ -419,7 +416,6 @@
   audio_channels = 1;
   codec_channels = 2;
 
-#ifdef WEBRTC_CODEC_G722
   if (test_mode_ != 0) {
     printf("===============================================================\n");
     printf("Test number: %d\n", test_cntr_ + 1);
@@ -432,7 +428,7 @@
       g722_pltype_);
   Run(channel_a2b_, audio_channels, codec_channels);
   out_file_.Close();
-#endif
+
   if (test_mode_ != 0) {
     printf("===============================================================\n");
     printf("Test number: %d\n", test_cntr_ + 1);
@@ -512,7 +508,6 @@
   codec_channels = 1;
   channel_a2b_->set_codec_mode(kMono);
 
-#ifdef WEBRTC_CODEC_G722
   // Run stereo audio and mono codec.
   if (test_mode_ != 0) {
     printf("===============================================================\n");
@@ -533,7 +528,7 @@
   EXPECT_EQ(0, acm_a_->SetVAD(false, false, VADNormal));
   Run(channel_a2b_, audio_channels, codec_channels);
   out_file_.Close();
-#endif
+
   if (test_mode_ != 0) {
     printf("===============================================================\n");
     printf("Test number: %d\n", test_cntr_ + 1);
@@ -659,9 +654,7 @@
   // Print out which codecs were tested, and which were not, in the run.
   if (test_mode_ != 0) {
     printf("\nThe following codecs was INCLUDED in the test:\n");
-#ifdef WEBRTC_CODEC_G722
     printf("   G.722\n");
-#endif
     printf("   PCM16\n");
     printf("   G.711\n");
 #ifdef WEBRTC_CODEC_OPUS
diff --git a/modules/audio_coding/test/TestStereo.h b/modules/audio_coding/test/TestStereo.h
index a27d8d7..a454f25 100644
--- a/modules/audio_coding/test/TestStereo.h
+++ b/modules/audio_coding/test/TestStereo.h
@@ -98,9 +98,7 @@
   char* send_codec_name_;
 
   // Payload types for stereo codecs and CNG
-#ifdef WEBRTC_CODEC_G722
   int g722_pltype_;
-#endif
   int l16_8khz_pltype_;
   int l16_16khz_pltype_;
   int l16_32khz_pltype_;
diff --git a/modules/audio_coding/test/Tester.cc b/modules/audio_coding/test/Tester.cc
index 73625f1..9cd774d 100644
--- a/modules/audio_coding/test/Tester.cc
+++ b/modules/audio_coding/test/Tester.cc
@@ -63,7 +63,7 @@
 #endif
 
 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \
-    defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722)
+    defined(WEBRTC_CODEC_ILBC)
 #if defined(WEBRTC_ANDROID)
 TEST(AudioCodingModuleTest, DISABLED_TwoWayCommunication) {
 #else
diff --git a/modules/media_file/media_file_utility.cc b/modules/media_file/media_file_utility.cc
index a80d4de..b21509f 100644
--- a/modules/media_file/media_file_utility.cc
+++ b/modules/media_file/media_file_utility.cc
@@ -1388,12 +1388,10 @@
         }
     }
 #endif
-#ifdef WEBRTC_CODEC_G722
     else if(STR_CASE_CMP(codecInst.plname, "G722") == 0)
     {
         _codecId = kCodecG722;
     }
-#endif
     if(_codecId == kCodecNoCodec)
     {
         return -1;
diff --git a/webrtc.gni b/webrtc.gni
index 7154b87..a4b7c18 100644
--- a/webrtc.gni
+++ b/webrtc.gni
@@ -33,6 +33,9 @@
 }
 
 declare_args() {
+  # Include the iLBC audio codec?
+  rtc_include_ilbc = true
+
   # Disable this to avoid building the Opus audio codec.
   rtc_include_opus = true
 
@@ -173,9 +176,6 @@
 # depend on the possibly overridden variables in the first
 # declare_args block.
 declare_args() {
-  # Include the iLBC audio codec?
-  rtc_include_ilbc = !(build_with_chromium || build_with_mozilla)
-
   rtc_restrict_logging = build_with_chromium
 
   # Excluded in Chromium since its prerequisites don't require Pulse Audio.