From 0dffc6449aedb053cbc4aaca5976f9c890e047ea Mon Sep 17 00:00:00 2001 From: "xians@webrtc.org" Date: Wed, 30 Nov 2011 15:35:44 +0000 Subject: [PATCH] To be able to get webrtc into chrome, we need to reduce the size of the binary and the usage of memory. This patch disbale some codecs which are not considered necessary. Review URL: http://webrtc-codereview.appspot.com/299001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1062 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/engine_configurations.h | 7 +++++-- src/modules/audio_coding/main/source/acm_codec_database.cc | 6 ++++++ webrtc.gyp | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/engine_configurations.h b/src/engine_configurations.h index c24e3d2ced..1c9076cacb 100644 --- a/src/engine_configurations.h +++ b/src/engine_configurations.h @@ -21,13 +21,16 @@ // [Voice] Codec settings // ---------------------------------------------------------------------------- -#define WEBRTC_CODEC_ILBC #define WEBRTC_CODEC_ISAC // floating-point iSAC implementation (default) // #define WEBRTC_CODEC_ISACFX // fix-point iSAC implementation +#define WEBRTC_CODEC_AVT + +#ifndef WEBRTC_CHROMIUM_BUILD +#define WEBRTC_CODEC_ILBC #define WEBRTC_CODEC_G722 #define WEBRTC_CODEC_PCM16 #define WEBRTC_CODEC_RED -#define WEBRTC_CODEC_AVT +#endif // ---------------------------------------------------------------------------- // [Video] Codec settings diff --git a/src/modules/audio_coding/main/source/acm_codec_database.cc b/src/modules/audio_coding/main/source/acm_codec_database.cc index f29274ce5f..d3ab622e61 100644 --- a/src/modules/audio_coding/main/source/acm_codec_database.cc +++ b/src/modules/audio_coding/main/source/acm_codec_database.cc @@ -109,7 +109,13 @@ const int kDynamicPayloadtypes[ACMCodecDB::kMaxNumCodecs] = { // Each entry needs the following parameters in the given order: // payload type, name, sampling frequency, packet size in samples, // default channel support, and default rate. +#if (defined(WEBRTC_CODEC_PCM16) || \ + defined(WEBRTC_CODEC_AMR) || defined(WEBRTC_CODEC_AMRWB) || \ + defined(WEBRTC_CODEC_G729_1) || defined(WEBRTC_CODEC_SPEEX) || \ + defined(WEBRTC_CODEC_G722_1) || defined(WEBRTC_CODEC_G722_1C)) static int count_database = 0; +#endif + const CodecInst ACMCodecDB::database_[] = { #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) {103, "ISAC", 16000, kIsacPacSize480, 1, kIsacWbDefaultRate}, diff --git a/webrtc.gyp b/webrtc.gyp index d7c307ca94..04833e73d0 100644 --- a/webrtc.gyp +++ b/webrtc.gyp @@ -39,6 +39,12 @@ }, ], 'conditions': [ + ['build_with_chromium==1', { + # Exclude components in engine_configuration.h. + 'defines': [ + 'WEBRTC_CHROMIUM_BUILD', + ], + }, ], # build_with_chromium=1 ['OS=="win"', { 'targets': [ {