aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
diff options
context:
space:
mode:
authorkwiberg <kwiberg@webrtc.org>2015-09-30 21:54:21 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-01 04:54:29 +0000
commit98ab3a46d6b98bd6626ab741092f7cbf104d127b (patch)
treeaeb35ee96119d07d88d32cf67eec873174fa60df /webrtc/modules/audio_coding/neteq/neteq_unittest.cc
parent456696a9c1bbd586701dcca3e4b2695e419a10ba (diff)
downloadwebrtc-98ab3a46d6b98bd6626ab741092f7cbf104d127b.tar.gz
Don't link with audio codecs that we don't use
We used to link with all audio codecs unconditionally (except Opus); this patch makes gyp and gn only link to the ones that are used. This unfortunately fails to have a measurable impact on Chromium binary size, at least on x86_64 Linux; it turns out that iLBC and iSAC fix were already being excluded from Chromium by some other means, likely just the linker omitting compilation units with no incoming references. (This was previously landed as revisions 10046 and 10060, and got reverted because it broke several of the Chromium FYI bots.) BUG=webrtc:4557 Review URL: https://codereview.webrtc.org/1368843003 Cr-Commit-Position: refs/heads/master@{#10127}
Diffstat (limited to 'webrtc/modules/audio_coding/neteq/neteq_unittest.cc')
-rw-r--r--webrtc/modules/audio_coding/neteq/neteq_unittest.cc29
1 files changed, 22 insertions, 7 deletions
diff --git a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
index 8a560dc200..6dfcac0d3a 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
@@ -307,18 +307,20 @@ void NetEqDecodingTest::LoadDecoders() {
ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCMu, 0));
// Load PCMa.
ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCMa, 8));
-#ifndef WEBRTC_ANDROID
+#ifdef WEBRTC_CODEC_ILBC
// Load iLBC.
ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderILBC, 102));
-#endif // WEBRTC_ANDROID
+#endif
+#if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
// Load iSAC.
ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderISAC, 103));
-#ifndef WEBRTC_ANDROID
+#endif
+#ifdef WEBRTC_CODEC_ISAC
// Load iSAC SWB.
ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderISACswb, 104));
// Load iSAC FB.
ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderISACfb, 105));
-#endif // WEBRTC_ANDROID
+#endif
// Load PCM16B nb.
ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCM16B, 93));
// Load PCM16B wb.
@@ -441,8 +443,15 @@ void NetEqDecodingTest::PopulateCng(int frame_index,
*payload_len = 1; // Only noise level, no spectral parameters.
}
+#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISAC)) && \
+ defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722)
+#define IF_ALL_CODECS(x) x
+#else
+#define IF_ALL_CODECS(x) DISABLED_##x
+#endif
+
TEST_F(NetEqDecodingTest,
- DISABLED_ON_IOS(DISABLED_ON_ANDROID(TestBitExactness))) {
+ DISABLED_ON_IOS(DISABLED_ON_ANDROID(IF_ALL_CODECS(TestBitExactness)))) {
const std::string input_rtp_file = webrtc::test::ProjectRootPath() +
"resources/audio_coding/neteq_universal_new.rtp";
// Note that neteq4_universal_ref.pcm and neteq4_universal_ref_win_32.pcm
@@ -820,7 +829,13 @@ TEST_F(NetEqDecodingTest, UnknownPayloadType) {
EXPECT_EQ(NetEq::kUnknownRtpPayloadType, neteq_->LastError());
}
-TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(DecoderError)) {
+#if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
+#define IF_ISAC(x) x
+#else
+#define IF_ISAC(x) DISABLED_##x
+#endif
+
+TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(IF_ISAC(DecoderError))) {
const size_t kPayloadBytes = 100;
uint8_t payload[kPayloadBytes] = {0};
WebRtcRTPHeader rtp_info;
@@ -1051,7 +1066,7 @@ TEST_F(NetEqBgnTestFade, RunTest) {
CheckBgn(32000);
}
-TEST_F(NetEqDecodingTest, SyncPacketInsert) {
+TEST_F(NetEqDecodingTest, IF_ISAC(SyncPacketInsert)) {
WebRtcRTPHeader rtp_info;
uint32_t receive_timestamp = 0;
// For the readability use the following payloads instead of the defaults of