Add a gyp variable to fully disable Opus.

Without this, the Chromium gyp run will fail until Opus is added.

This builds and runs Opus on Linux with include_opus=1, and builds with include_opus=0 (including with third_party/opus deleted to simulate the Chromium build).

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2953 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org 2012-10-19 07:13:52 +00:00
parent cd19707945
commit c0773fc8b0
6 changed files with 23 additions and 15 deletions

View File

@ -32,10 +32,12 @@
'webrtc_root%': '<(webrtc_root)',
'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
'include_opus%': 0,
},
'build_with_chromium%': '<(build_with_chromium)',
'webrtc_root%': '<(webrtc_root)',
'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
'include_opus%': '<(include_opus)',
# The Chromium common.gypi we use treats all gyp files without
# chromium_code==1 as third party code. This disables many of the
@ -62,6 +64,9 @@
'build_libyuv%': 1,
'build_libvpx%': 1,
# Enable to use the Mozilla internal Opus version.
'build_with_mozilla%': 0,
'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
'conditions': [
@ -86,9 +91,6 @@
# Disable the use of protocol buffers in production code.
'enable_protobuf%': 0,
# Disable Mozilla internal Opus version
'build_with_mozilla%': 0,
}, { # Settings for the standalone (not-in-Chromium) build.
'include_pulse_audio%': 1,
'include_internal_audio_device%': 1,

View File

@ -88,7 +88,7 @@
#endif
#ifdef WEBRTC_CODEC_OPUS
#include "acm_opus.h"
#include "opus_interface.h"
#include "modules/audio_coding/codecs/opus/interface/opus_interface.h"
#endif
#ifdef WEBRTC_CODEC_SPEEX
#include "acm_speex.h"

View File

@ -18,7 +18,7 @@
#include "webrtc_neteq_help_macros.h"
#ifdef WEBRTC_CODEC_OPUS
#include "opus_interface.h"
#include "modules/audio_coding/codecs/opus/interface/opus_interface.h"
#endif
namespace webrtc {

View File

@ -12,9 +12,11 @@
#define WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_OPUS_H_
#include "acm_generic_codec.h"
#include "opus_interface.h"
#include "resampler.h"
struct WebRtcOpusEncInst;
struct WebRtcOpusDecInst;
namespace webrtc {
class ACMOpus : public ACMGenericCodec {
@ -48,8 +50,8 @@ class ACMOpus : public ACMGenericCodec {
int16_t SetBitRateSafe(const int32_t rate);
OpusEncInst* _encoderInstPtr;
OpusDecInst* _decoderInstPtr;
WebRtcOpusEncInst* _encoderInstPtr;
WebRtcOpusDecInst* _decoderInstPtr;
uint16_t _sampleFreq;
uint16_t _bitrate;
};

View File

@ -15,7 +15,6 @@
'iLBC',
'iSAC',
'iSACFix',
'webrtc_opus',
'PCM16B',
'NetEq',
'<(webrtc_root)/common_audio/common_audio.gyp:resampler',
@ -24,6 +23,12 @@
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
],
'audio_coding_defines': [],
'conditions': [
['include_opus==1', {
'audio_coding_dependencies': ['webrtc_opus',],
'audio_coding_defines': ['WEBRTC_CODEC_OPUS',],
}],
],
},
'targets': [
{
@ -38,13 +43,11 @@
'include_dirs': [
'../interface',
'../../../interface',
'../../codecs/opus/interface',
],
'direct_dependent_settings': {
'include_dirs': [
'../interface',
'../../../interface',
'../../codecs/opus/interface',
'../interface',
'../../../interface',
],
},
'sources': [

View File

@ -15,7 +15,6 @@
'audio_coding/codecs/ilbc/ilbc.gypi',
'audio_coding/codecs/isac/main/source/isac.gypi',
'audio_coding/codecs/isac/fix/source/isacfix.gypi',
'audio_coding/codecs/opus/opus.gypi',
'audio_coding/codecs/pcm16b/pcm16b.gypi',
'audio_coding/main/source/audio_coding_module.gypi',
'audio_coding/neteq/neteq.gypi',
@ -34,8 +33,10 @@
'video_render/main/source/video_render.gypi',
'rtp_rtcp/source/rtp_rtcp.gypi',
],
'conditions': [
['include_opus==1', {
'includes': ['audio_coding/codecs/opus/opus.gypi',],
}],
['include_tests==1', {
'includes': [
'audio_coding/codecs/isac/isac_test.gypi',