From 830099eba4599a2646719e2e8f23a526bc782121 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Wed, 31 Aug 2011 17:03:54 +0000 Subject: [PATCH] Add a gyp flag to disable video functionality from dependencies shared by voice and video engine. Currently, this is just the utility module. It relies on the already existing WEBRTC_MODULE_UTILITY_VIDEO define. Review URL: http://webrtc-codereview.appspot.com/133007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@496 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/build/common.gypi | 22 ++++++++++++------ src/modules/utility/source/utility.gyp | 31 +++++++++++++++++--------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/src/build/common.gypi b/src/build/common.gypi index b85fe119a..84e22f74d 100644 --- a/src/build/common.gypi +++ b/src/build/common.gypi @@ -17,14 +17,18 @@ # dict that operate on these variables (e.g., for setting # 'include_pulse_audio', we need to have 'build_with_chromium' already set). 'variables': { - # TODO(ajm): use webrtc_standalone to match NaCl? 'build_with_chromium%': 1, # 1 to build webrtc with chromium }, 'build_with_chromium%': '<(build_with_chromium)', + # Adds video support to dependencies shared by voice and video engine. + # This should normally be enabled; the intended use is to disable only + # when building voice engine exclusively. + 'enable_video%': 1, + # Selects fixed-point code where possible. - # TODO(ajm): we'd like to set this based on the target OS/architecture. + # TODO(andrew): we'd like to set this based on the target OS/architecture. 'prefer_fixed_point%': 0, # Enable data logging. Produces text files with data logged within engines @@ -33,7 +37,7 @@ 'conditions': [ ['OS=="win"', { - # TODO(ajm, perkj): does this need to be here? + # TODO(andrew, perkj): does this need to be here? # Path needed to build Direct Show base classes on Windows. # The code is included in the Windows SDK. 'direct_show_base_classes': @@ -43,11 +47,15 @@ # Exclude pulse audio on Chromium since its prerequisites don't require # pulse audio. 'include_pulse_audio%': 0, + # Exclude internal ADM since Chromium uses its own IO handling. 'include_internal_audio_device%': 0, }, { + # Settings for the standalone (not-in-Chromium) build. 'include_pulse_audio%': 1, + 'include_internal_audio_device%': 1, + # The Chromium common.gypi we use treats all gyp files without # chromium_code==1 as third party code. This disables many of the # preferred warning settings. @@ -69,13 +77,13 @@ 'WEBRTC_TARGET_PC', 'WEBRTC_LINUX', 'WEBRTC_THREAD_RR', - # TODO(ajm): can we select this automatically? + # TODO(andrew): can we select this automatically? # Define this if the Linux system does not support CLOCK_MONOTONIC. #'WEBRTC_CLOCK_TYPE_REALTIME', ], }], ['OS=="mac"', { - # TODO(ajm): what about PowerPC? + # TODO(andrew): what about PowerPC? # Setup for Intel 'defines': [ 'WEBRTC_TARGET_MAC_INTEL', @@ -109,8 +117,8 @@ 'target_conditions': [ ['chromium_code==1', { - # TODO(ajm): This block disables some warnings from the chromium_code - # configuration. Remove when possible. + # TODO(andrew): This block disables some warnings from the chromium_code + # configuration. Remove when possible. 'conditions': [ ['OS=="mac"', { 'xcode_settings': { diff --git a/src/modules/utility/source/utility.gyp b/src/modules/utility/source/utility.gyp index cd48c2dfd..1150cf48a 100644 --- a/src/modules/utility/source/utility.gyp +++ b/src/modules/utility/source/utility.gyp @@ -12,19 +12,13 @@ 'type': '<(library)', 'dependencies': [ '../../audio_coding/main/source/audio_coding_module.gyp:audio_coding_module', - '../../video_coding/main/source/video_coding.gyp:webrtc_video_coding', '../../../common_audio/resampler/main/source/resampler.gyp:resampler', '../../../system_wrappers/source/system_wrappers.gyp:system_wrappers', ], - 'defines': [ - 'WEBRTC_MODULE_UTILITY_VIDEO', # for compiling support for video recording - ], 'include_dirs': [ '../interface', '../../interface', - '../../../common_video/vplib/main/interface', '../../media_file/interface', - '../../video_coding/main/interface' ], 'direct_dependent_settings': { 'include_dirs': [ @@ -48,11 +42,26 @@ 'process_thread_impl.h', 'rtp_dump_impl.cc', 'rtp_dump_impl.h', - # Video only - # TODO: Use some variable for building for video and voice or voice only - 'frame_scaler.cc', - 'video_coder.cc', - 'video_frames_queue.cc', + ], + 'conditions': [ + ['enable_video==1', { + # Adds support for video recording. + 'defines': [ + 'WEBRTC_MODULE_UTILITY_VIDEO', + ], + 'dependencies': [ + '../../video_coding/main/source/video_coding.gyp:webrtc_video_coding', + ], + 'include_dirs': [ + '../../video_coding/main/interface', + '../../../common_video/vplib/main/interface', + ], + 'sources': [ + 'frame_scaler.cc', + 'video_coder.cc', + 'video_frames_queue.cc', + ], + }], ], }, ],