diff options
author | Henrik Kjellander <kjellander@webrtc.org> | 2015-05-25 12:55:39 +0200 |
---|---|---|
committer | Henrik Kjellander <kjellander@webrtc.org> | 2015-05-25 10:55:50 +0000 |
commit | 57e5fd2e604ff7e60425c3f7654b40da03fc763c (patch) | |
tree | c2955f0767b14356b6dea5af58f2d187716f1114 | |
parent | 00aac5aacfa1778cafa1a67036743df990e21153 (diff) | |
download | webrtc-57e5fd2e604ff7e60425c3f7654b40da03fc763c.tar.gz |
PRESUBMIT: Improve PyLint check and add GN format check.
Add pylintrc file based on
https://code.google.com/p/chromium/codesearch#chromium/src/tools/perf/pylintrc
bit tightened up quite a bit (the one in depot_tools is far
more relaxed).
Remove a few excluded directories from pylint check and fixed/
suppressed all warnings generated.
Add GN format check + formatted all GN files using 'gn format'.
Cleanup redundant rules in tools/PRESUBMIT.py
TESTED=Ran 'git cl presubmit -vv', fixed the PyLint violations.
Ran it again with a modification in webrtc/build/webrtc.gni, formatted
all the GN files and ran it again.
R=henrika@webrtc.org, phoglund@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/50069004
Cr-Commit-Position: refs/heads/master@{#9274}
40 files changed, 299 insertions, 280 deletions
@@ -18,9 +18,7 @@ secondary_source = "//build/secondary/" # matching these patterns (see "gn help label_pattern" for format) will have # their includes checked for proper dependencies when you run either # "gn check" or "gn gen --check". -check_targets = [ - "//webrtc/*", -] +check_targets = [ "//webrtc/*" ] # These are the list of GN files that run exec_script. This whitelist exists # to force additional review for new uses of exec_script, which is strongly diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 55e7e06f7c..c6cb81612e 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -24,11 +24,11 @@ def _CheckNoIOStreamInHeaders(input_api, output_api): files.append(f) if len(files): - return [ output_api.PresubmitError( + return [output_api.PresubmitError( 'Do not #include <iostream> in header files, since it inserts static ' + 'initialization into every file including the header. Instead, ' + '#include <ostream>. See http://crbug.com/94794', - files) ] + files)] return [] @@ -79,8 +79,8 @@ def _CheckApprovedFilesLintClean(input_api, output_api, verbosity_level = 1 files = [] for f in input_api.AffectedSourceFiles(source_file_filter): - # Note that moved/renamed files also count as added for svn. - if (f.Action() == 'A'): + # Note that moved/renamed files also count as added. + if f.Action() == 'A': files.append(f.AbsoluteLocalPath()) for file_name in files: @@ -202,7 +202,7 @@ def _CheckUnwantedDependencies(input_api, output_api): if not CppChecker.IsCppFile(f.LocalPath()): continue - changed_lines = [line for _line_num, line in f.ChangedContents()] + changed_lines = [line for _, line in f.ChangedContents()] added_includes.append([f.LocalPath(), changed_lines]) deps_checker = checkdeps.DepsChecker(input_api.PresubmitLocalPath()) @@ -233,7 +233,6 @@ def _CheckUnwantedDependencies(input_api, output_api): def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" - # TODO(kjellander): Use presubmit_canned_checks.PanProjectChecks too. results = [] results.extend(input_api.canned_checks.RunPylint(input_api, output_api, black_list=(r'^.*gviz_api\.py$', @@ -243,13 +242,11 @@ def _CommonChecks(input_api, output_api): r'^buildtools/.*\.py$', r'^chromium/.*\.py$', r'^out.*/.*\.py$', - r'^talk/site_scons/site_tools/talk_linux.py$', r'^testing/.*\.py$', r'^third_party/.*\.py$', r'^tools/clang/.*\.py$', r'^tools/gn/.*\.py$', r'^tools/gyp/.*\.py$', - r'^tools/perf_expectations/.*\.py$', r'^tools/protoc_wrapper/.*\.py$', r'^tools/python/.*\.py$', r'^tools/python_charts/data/.*\.py$', @@ -258,14 +255,15 @@ def _CommonChecks(input_api, output_api): # TODO(phoglund): should arguably be checked. r'^tools/valgrind-webrtc/.*\.py$', r'^tools/valgrind/.*\.py$', - # TODO(phoglund): should arguably be checked. - r'^webrtc/build/.*\.py$', r'^xcodebuild.*/.*\.py$',), - disabled_warnings=['F0401', # Failed to import x 'E0611', # No package y in x 'W0232', # Class has no __init__ method - ])) + ], + pylintrc='pylintrc')) + # WebRTC can't use the presubmit_canned_checks.PanProjectChecks function since + # we need to have different license checks in talk/ and webrtc/ directories. + # Instead, hand-picked checks are included below. results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, maxlen=80)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( @@ -285,6 +283,8 @@ def _CommonChecks(input_api, output_api): def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) + results.extend( + input_api.canned_checks.CheckGNFormatted(input_api, output_api)) return results @@ -312,7 +312,7 @@ def GetDefaultTryConfigs(bots=None): For WebRTC purposes, we always return an empty list of tests, since we want to run all tests by default on all our trybots. """ - return { 'tryserver.webrtc': dict((bot, []) for bot in bots)} + return {'tryserver.webrtc': dict((bot, []) for bot in bots)} # pylint: disable=W0613 @@ -377,7 +377,7 @@ def GetPreferredTryMasters(project, change): if all(re.search(r'[\\/]BUILD.gn$', f) for f in files): return GetDefaultTryConfigs(android_gn_bots + linux_gn_bots + mac_gn_bots + win_gn_bots) - if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files): + if all(re.search('[/_])mac[/_.]', f) for f in files): return GetDefaultTryConfigs(mac_bots) if all(re.search('(^|[/_])win[/_.]', f) for f in files): return GetDefaultTryConfigs(win_bots) diff --git a/pylintrc b/pylintrc new file mode 100644 index 0000000000..b8bea33489 --- /dev/null +++ b/pylintrc @@ -0,0 +1,17 @@ +[MESSAGES CONTROL] + +# Disable the message, report, category or checker with the given id(s). +# TODO(kjellander): Reduce this list to as small as possible. +disable=I0010,I0011,bad-continuation,broad-except,duplicate-code,eval-used,exec-used,fixme,invalid-name,missing-docstring,no-init,no-member,too-few-public-methods,too-many-ancestors,too-many-arguments,too-many-branches,too-many-function-args,too-many-instance-attributes,too-many-lines,too-many-locals,too-many-public-methods,too-many-return-statements,too-many-statements + + +[REPORTS] + +# Don't write out full reports, just messages. +reports=no + + +[FORMAT] + +# We use two spaces for indents, instead of the usual four spaces or tab. +indent-string=' ' diff --git a/setup_links.py b/setup_links.py index 2060110b4f..992c03efc7 100755 --- a/setup_links.py +++ b/setup_links.py @@ -171,7 +171,7 @@ class Remove(Action): else: log('Removing %s: %s', filesystem_type, self._path) - def doit(self, _links_db): + def doit(self, _): os.remove(self._path) @@ -187,7 +187,7 @@ class Rmtree(Action): else: logging.warn('Removing directory: %s', self._path) - def doit(self, _links_db): + def doit(self, _): if sys.platform.startswith('win'): # shutil.rmtree() doesn't work on Windows if any of the directories are # read-only, which svn repositories are. @@ -202,7 +202,7 @@ class Makedirs(Action): self._priority = 1 self._path = path - def doit(self, _links_db): + def doit(self, _): try: os.makedirs(self._path) except OSError as e: @@ -258,7 +258,7 @@ if sys.platform.startswith('win'): os.symlink = symlink -class WebRTCLinkSetup(): +class WebRTCLinkSetup(object): def __init__(self, links_db, force=False, dry_run=False, prompt=False): self._force = force self._dry_run = dry_run @@ -482,7 +482,7 @@ def main(): logging.error('On Windows, you now need to have administrator ' 'privileges for the shell running %s (or ' '`gclient sync|runhooks`).\nPlease start another command ' - 'prompt as Administrator and try again.' % sys.argv[0]) + 'prompt as Administrator and try again.', sys.argv[0]) return 1 if not os.path.exists(CHROMIUM_CHECKOUT): diff --git a/tools/PRESUBMIT.py b/tools/PRESUBMIT.py index 6e96ceb086..2f7b835ba9 100644 --- a/tools/PRESUBMIT.py +++ b/tools/PRESUBMIT.py @@ -8,13 +8,13 @@ def _LicenseHeader(input_api): """Returns the license header regexp.""" - # Accept any year number from 2011 to the current year + # Accept any year number from 2003 to the current year current_year = int(input_api.time.strftime('%Y')) - allowed_years = (str(s) for s in reversed(xrange(2011, current_year + 1))) + allowed_years = (str(s) for s in reversed(xrange(2003, current_year + 1))) years_re = '(' + '|'.join(allowed_years) + ')' license_header = ( - r'.*? Copyright \(c\) %(year)s The WebRTC project authors\. ' - r'All Rights Reserved\.\n' + r'.*? Copyright( \(c\))? %(year)s The WebRTC [Pp]roject [Aa]uthors\. ' + r'All [Rr]ights [Rr]eserved\.\n' r'.*?\n' r'.*? Use of this source code is governed by a BSD-style license\n' r'.*? that can be found in the LICENSE file in the root of the source\n' @@ -30,14 +30,6 @@ def _LicenseHeader(input_api): def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] - results.extend(input_api.canned_checks.CheckLongLines( - input_api, output_api, maxlen=80)) - results.extend(input_api.canned_checks.CheckChangeHasNoTabs( - input_api, output_api)) - results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( - input_api, output_api)) - results.extend(input_api.canned_checks.CheckChangeTodoHasOwner( - input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LicenseHeader(input_api))) return results @@ -50,13 +42,4 @@ def CheckChangeOnUpload(input_api, output_api): def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) - results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) - results.extend(input_api.canned_checks.CheckChangeWasUploaded( - input_api, output_api)) - results.extend(input_api.canned_checks.CheckChangeHasDescription( - input_api, output_api)) - results.extend(input_api.canned_checks.CheckChangeHasBugField( - input_api, output_api)) - results.extend(input_api.canned_checks.CheckChangeHasTestField( - input_api, output_api)) return results diff --git a/tools/autoroller/cl_description.py b/tools/autoroller/cl_description.py index 317e196a6b..95e2f2c8e9 100755 --- a/tools/autoroller/cl_description.py +++ b/tools/autoroller/cl_description.py @@ -24,6 +24,7 @@ CHROMIUM_COMMIT_TEMPLATE = CHROMIUM_SRC_URL + '/+/%s' CHROMIUM_FILE_TEMPLATE = CHROMIUM_SRC_URL + '/+/%s/%s' GIT_NUMBER_RE = re.compile('^Cr-Commit-Position: .*#([0-9]+).*$') +CLANG_REVISION_RE = re.compile(r'^CLANG_REVISION=(\d+)$') SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) CHECKOUT_ROOT_DIR = os.path.join(SCRIPT_DIR, os.pardir, os.pardir) sys.path.append(CHECKOUT_ROOT_DIR) @@ -156,8 +157,11 @@ def calculate_changed_deps(current_deps, new_deps): def calculate_changed_clang(new_cr_rev): def get_clang_rev(lines): - key = 'CLANG_REVISION=' - return filter(lambda x: x.startswith(key), lines)[0][len(key):].strip() + for line in lines: + match = CLANG_REVISION_RE.match(line) + if match: + return match.group(1) + return None chromium_src_path = os.path.join(CHECKOUT_ROOT_DIR, 'chromium', 'src', CLANG_UPDATE_SCRIPT_LOCAL_PATH) diff --git a/tools/cpu/cpu_mon.py b/tools/cpu/cpu_mon.py index 756ab5c0c2..9a13723ed2 100644 --- a/tools/cpu/cpu_mon.py +++ b/tools/cpu/cpu_mon.py @@ -9,7 +9,6 @@ # be found in the AUTHORS file in the root of the source tree. -import argparse import psutil import sys diff --git a/tools/network_emulator/network_emulator.py b/tools/network_emulator/network_emulator.py index 2531f1ed8c..9bdf7bd95b 100644 --- a/tools/network_emulator/network_emulator.py +++ b/tools/network_emulator/network_emulator.py @@ -186,4 +186,4 @@ def _run_ipfw_command(command, fail_msg=None): if process.returncode != 0: raise NetworkEmulatorError(fail_msg, cmd_string, process.returncode, output, error) - return output.strip()
\ No newline at end of file + return output.strip() diff --git a/tools/perf/perf_utils.py b/tools/perf/perf_utils.py index 77eda1e7a3..3d3cb10fb6 100644 --- a/tools/perf/perf_utils.py +++ b/tools/perf/perf_utils.py @@ -1,6 +1,12 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. +#!/usr/bin/env python +# +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. # Copied from /src/chrome/test/pyautolib/pyauto_utils.py in Chromium. @@ -28,4 +34,4 @@ def PrintPerfResult(graph_name, series_name, data_point, units, print '%sRESULT %s: %s= %s %s' % ( waterfall_indicator, graph_name, series_name, str(data_point).replace(' ', ''), units) - sys.stdout.flush()
\ No newline at end of file + sys.stdout.flush() diff --git a/tools/python_charts/webrtc/__init__.py b/tools/python_charts/webrtc/__init__.py index c1caaa254d..674c80f373 100644 --- a/tools/python_charts/webrtc/__init__.py +++ b/tools/python_charts/webrtc/__init__.py @@ -5,4 +5,4 @@ # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree.
\ No newline at end of file +# be found in the AUTHORS file in the root of the source tree. diff --git a/tools/python_charts/webrtc/data_helper.py b/tools/python_charts/webrtc/data_helper.py index 80cc78f9e5..3073a3839c 100644 --- a/tools/python_charts/webrtc/data_helper.py +++ b/tools/python_charts/webrtc/data_helper.py @@ -89,7 +89,7 @@ class DataHelper(object): # We're going to have one dictionary per row. # Create that and copy frame_number values from the first data set for source_row in self.data_list[0]: - row_dict = { 'frame_number': source_row['frame_number'] } + row_dict = {'frame_number': source_row['frame_number']} result_data_table.append(row_dict) # Pick target field data points from the all data tables diff --git a/tools/python_charts/webrtc/data_helper_test.py b/tools/python_charts/webrtc/data_helper_test.py index 53b31bdee1..44fc74ddbc 100644 --- a/tools/python_charts/webrtc/data_helper_test.py +++ b/tools/python_charts/webrtc/data_helper_test.py @@ -18,7 +18,7 @@ class Test(unittest.TestCase): {'frame_number': 1, 'ssim': 0.55, 'psnr': 30.55}] self.frame_data_1 = [{'frame_number': 0, 'ssim': 0.6, 'psnr': 30.6}, {'frame_number': 0, 'ssim': 0.66, 'psnr': 30.66}] - self.all_data = [ self.frame_data_0, self.frame_data_1 ] + self.all_data = [self.frame_data_0, self.frame_data_1] # Test with frame_number column in a non-first position sice we need to # support reordering that to be able to use the gviz_api as we want. diff --git a/tools/python_charts/webrtc/main.py b/tools/python_charts/webrtc/main.py index 90c9ba0ec3..d3fb40c888 100644 --- a/tools/python_charts/webrtc/main.py +++ b/tools/python_charts/webrtc/main.py @@ -37,7 +37,7 @@ def main(): page_template_filename = '../templates/chart_page_template.html' # The data files must be located in the project tree for app engine being # able to access them. - data_filenames = [ '../data/vp8_sw.py', '../data/vp8_hw.py' ] + data_filenames = ['../data/vp8_sw.py', '../data/vp8_hw.py'] # Will contain info/error messages to be displayed on the resulting page. messages = [] # Load the page HTML template. diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index 45b05b64e4..6c6c23cfa0 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -20,13 +20,12 @@ config("common_inherited_config") { defines += [ "WEBRTC_MOZILLA_BUILD" ] } if (build_with_chromium) { - defines = [ - "WEBRTC_CHROMIUM_BUILD", - ] + defines = [ "WEBRTC_CHROMIUM_BUILD" ] include_dirs = [ # overrides must be included first as that is the mechanism for # selecting the override headers in Chromium. "overrides", + # Allow includes to be prefixed with webrtc/ in case it is not an # immediate subdirectory of the top-level. "..", @@ -73,6 +72,7 @@ config("common_config") { if (rtc_have_dbus_glib) { defines += [ "HAVE_DBUS_GLIB" ] + # TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h> # is still not found even if the execution of # build/config/linux/pkg-config.py dbus-glib-1 returns correct include @@ -93,6 +93,7 @@ config("common_config") { if (current_cpu != "arm64" || !is_android) { cflags = [ "-Wextra", + # We need to repeat some flags from Chromium"s common.gypi # here that get overridden by -Wextra. "-Wno-unused-parameter", @@ -101,6 +102,7 @@ config("common_config") { ] cflags_cc = [ "-Wnon-virtual-dtor", + # This is enabled for clang; enable for gcc as well. "-Woverloaded-virtual", ] @@ -172,7 +174,7 @@ source_set("webrtc") { ] configs += [ ":common_config" ] - public_configs = [ ":common_inherited_config"] + public_configs = [ ":common_inherited_config" ] deps = [ ":webrtc_common", @@ -199,8 +201,8 @@ source_set("webrtc") { if (build_with_chromium) { deps += [ - "modules/video_capture", - "modules/video_render", + "modules/video_capture", + "modules/video_render", ] } } @@ -221,8 +223,8 @@ source_set("webrtc_common") { sources = [ "common_types.cc", "common_types.h", - "config.h", "config.cc", + "config.h", "engine_configurations.h", "typedefs.h", ] diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index d755bb736e..44f13474b3 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -29,9 +29,7 @@ config("rtc_base_config") { } config("rtc_base_chromium_config") { - defines = [ - "NO_MAIN_THREAD_WRAPPING", - ] + defines = [ "NO_MAIN_THREAD_WRAPPING" ] } config("openssl_config") { @@ -54,6 +52,7 @@ config("ios_config") { #"Foundation.framework", # Already included in //build/config:default_libs. "Security.framework", "SystemConfiguration.framework", + #"UIKit.framework", # Already included in //build/config:default_libs. ] } @@ -61,6 +60,7 @@ config("ios_config") { config("mac_config") { libs = [ "Cocoa.framework", + #"Foundation.framework", # Already included in //build/config:default_libs. #"IOKit.framework", # Already included in //build/config:default_libs. #"Security.framework", # Already included in //build/config:default_libs. @@ -79,9 +79,13 @@ if (is_linux && !build_with_chromium) { # WebRTC cannot use as we don't sync src/crypto from Chromium. group("linux_system_ssl") { if (use_openssl) { - deps = [ "//third_party/boringssl" ] + deps = [ + "//third_party/boringssl", + ] } else { - deps = [ "//net/third_party/nss/ssl:libssl" ] + deps = [ + "//net/third_party/nss/ssl:libssl", + ] public_configs = [ "//net/third_party/nss/ssl:ssl_config", @@ -182,9 +186,7 @@ static_library("rtc_base") { ":rtc_base_config", ] - defines = [ - "LOGGING=1", - ] + defines = [ "LOGGING=1" ] sources = [ "arraysize.h", @@ -348,9 +350,9 @@ static_library("rtc_base") { public_configs += [ ":rtc_base_chromium_config" ] } else { sources += [ + "asyncinvoker-inl.h", "asyncinvoker.cc", "asyncinvoker.h", - "asyncinvoker-inl.h", "bandwidthsmoother.cc", "bandwidthsmoother.h", "bind.h", @@ -382,8 +384,8 @@ static_library("rtc_base") { "refcount.h", "referencecountedsingletonfactory.h", "rollingaccumulator.h", - "scopedptrcollection.h", "scoped_ref_ptr.h", + "scopedptrcollection.h", "sec_buffer.h", "sharedexclusivelock.cc", "sharedexclusivelock.h", @@ -398,8 +400,8 @@ static_library("rtc_base") { "virtualsocketserver.cc", "virtualsocketserver.h", "window.h", - "windowpickerfactory.h", "windowpicker.h", + "windowpickerfactory.h", ] deps += [ "..:webrtc_common" ] @@ -524,7 +526,7 @@ static_library("rtc_base") { libs += [ "log", - "GLESv2" + "GLESv2", ] } diff --git a/webrtc/build/android/test_runner.py b/webrtc/build/android/test_runner.py index 6169bbc7e9..2fec37c60c 100755 --- a/webrtc/build/android/test_runner.py +++ b/webrtc/build/android/test_runner.py @@ -25,7 +25,7 @@ CHROMIUM_BUILD_ANDROID_DIR = os.path.join(SRC_DIR, 'build', 'android') sys.path.insert(0, CHROMIUM_BUILD_ANDROID_DIR) -import test_runner +import test_runner # pylint: disable=W0406 from pylib.gtest import gtest_config from pylib.gtest import setup diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni index 336f7a117a..d03a4ed8c9 100644 --- a/webrtc/build/webrtc.gni +++ b/webrtc/build/webrtc.gni @@ -68,7 +68,6 @@ declare_args() { # Exclude internal ADM since Chromium uses its own IO handling. rtc_include_internal_audio_device = false - } else { # Settings for the standalone (not-in-Chromium) build. @@ -109,7 +108,7 @@ declare_args() { # WebRTC builds ARM v7 Neon instruction set optimized code for both iOS and # Android, which is why we currently cannot use the variables in # //build/config/arm.gni (since it disables Neon for Android). - rtc_build_armv7_neon = (current_cpu == "arm" && arm_version >= 7) + rtc_build_armv7_neon = current_cpu == "arm" && arm_version >= 7 } # Make it possible to provide custom locations for some libraries (move these diff --git a/webrtc/common_audio/BUILD.gn b/webrtc/common_audio/BUILD.gn index f6e0144948..3d4a3321a0 100644 --- a/webrtc/common_audio/BUILD.gn +++ b/webrtc/common_audio/BUILD.gn @@ -51,9 +51,6 @@ source_set("common_audio") { "resampler/sinc_resampler.h", "ring_buffer.c", "ring_buffer.h", - "signal_processing/include/real_fft.h", - "signal_processing/include/signal_processing_library.h", - "signal_processing/include/spl_inl.h", "signal_processing/auto_corr_to_refl_coef.c", "signal_processing/auto_correlation.c", "signal_processing/complex_fft_tables.h", @@ -68,12 +65,15 @@ source_set("common_audio") { "signal_processing/get_hanning_window.c", "signal_processing/get_scaling_square.c", "signal_processing/ilbc_specific_functions.c", + "signal_processing/include/real_fft.h", + "signal_processing/include/signal_processing_library.h", + "signal_processing/include/spl_inl.h", "signal_processing/levinson_durbin.c", "signal_processing/lpc_to_refl_coef.c", "signal_processing/min_max_operations.c", "signal_processing/randomization_functions.c", - "signal_processing/refl_coef_to_lpc.c", "signal_processing/real_fft.c", + "signal_processing/refl_coef_to_lpc.c", "signal_processing/resample.c", "signal_processing/resample_48khz.c", "signal_processing/resample_by_2.c", @@ -90,7 +90,6 @@ source_set("common_audio") { "vad/include/vad.h", "vad/include/webrtc_vad.h", "vad/vad.cc", - "vad/webrtc_vad.c", "vad/vad_core.c", "vad/vad_core.h", "vad/vad_filterbank.c", @@ -99,15 +98,18 @@ source_set("common_audio") { "vad/vad_gmm.h", "vad/vad_sp.c", "vad/vad_sp.h", - "wav_header.cc", - "wav_header.h", + "vad/webrtc_vad.c", "wav_file.cc", "wav_file.h", + "wav_header.cc", + "wav_header.h", "window_generator.cc", "window_generator.h", ] - deps = [ "../system_wrappers" ] + deps = [ + "../system_wrappers", + ] defines = [] if (rtc_use_openmax_dl) { @@ -141,12 +143,12 @@ source_set("common_audio") { if (current_cpu == "mipsel") { sources += [ - "signal_processing/include/spl_inl_mips.h", "signal_processing/complex_bit_reverse_mips.c", "signal_processing/complex_fft_mips.c", "signal_processing/cross_correlation_mips.c", "signal_processing/downsample_fast_mips.c", "signal_processing/filter_ar_fast_q12_mips.c", + "signal_processing/include/spl_inl_mips.h", "signal_processing/min_max_operations_mips.c", "signal_processing/resample_by_2_mips.c", "signal_processing/spl_sqrt_floor_mips.c", @@ -167,9 +169,7 @@ source_set("common_audio") { } if (is_win) { - cflags = [ - "/wd4334", # Ignore warning on shift operator promotion. - ] + cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion. } configs += [ "..:common_config" ] diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn index e5cac4d447..c8f348a122 100644 --- a/webrtc/common_video/BUILD.gn +++ b/webrtc/common_video/BUILD.gn @@ -53,7 +53,9 @@ source_set("common_video") { if (rtc_build_libyuv) { deps += [ "$rtc_libyuv_dir" ] - public_deps = [ "$rtc_libyuv_dir" ] + public_deps = [ + "$rtc_libyuv_dir", + ] } else { # Need to add a directory normally exported by libyuv. include_dirs += [ "$rtc_libyuv_dir/include" ] diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn index 6593ed6b2f..896b6641b8 100644 --- a/webrtc/modules/audio_coding/BUILD.gn +++ b/webrtc/modules/audio_coding/BUILD.gn @@ -86,7 +86,9 @@ source_set("audio_decoder_interface") { ] configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] - deps = [ "../..:webrtc_common" ] + deps = [ + "../..:webrtc_common", + ] } source_set("audio_encoder_interface") { @@ -96,7 +98,9 @@ source_set("audio_encoder_interface") { ] configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] - deps = [ "../..:webrtc_common" ] + deps = [ + "../..:webrtc_common", + ] } config("cng_config") { @@ -130,9 +134,7 @@ source_set("cng") { } config("red_config") { - include_dirs = [ - "codecs/red", - ] + include_dirs = [ "codecs/red" ] } source_set("red") { @@ -163,12 +165,12 @@ config("g711_config") { source_set("g711") { sources = [ - "codecs/g711/include/audio_encoder_pcm.h", - "codecs/g711/include/g711_interface.h", "codecs/g711/audio_encoder_pcm.cc", - "codecs/g711/g711_interface.c", "codecs/g711/g711.c", "codecs/g711/g711.h", + "codecs/g711/g711_interface.c", + "codecs/g711/include/audio_encoder_pcm.h", + "codecs/g711/include/g711_interface.h", ] configs += [ "../..:common_config" ] @@ -178,7 +180,9 @@ source_set("g711") { ":g711_config", ] - deps = [ ":audio_encoder_interface" ] + deps = [ + ":audio_encoder_interface", + ] } config("g722_config") { @@ -191,12 +195,12 @@ config("g722_config") { source_set("g722") { sources = [ "codecs/g722/audio_encoder_g722.cc", - "codecs/g722/include/audio_encoder_g722.h", - "codecs/g722/include/g722_interface.h", - "codecs/g722/g722_interface.c", - "codecs/g722/g722_encode.c", "codecs/g722/g722_decode.c", "codecs/g722/g722_enc_dec.h", + "codecs/g722/g722_encode.c", + "codecs/g722/g722_interface.c", + "codecs/g722/include/audio_encoder_g722.h", + "codecs/g722/include/g722_interface.h", ] configs += [ "../..:common_config" ] @@ -206,7 +210,9 @@ source_set("g722") { ":g722_config", ] - deps = [ ":audio_encoder_interface" ] + deps = [ + ":audio_encoder_interface", + ] } config("ilbc_config") { @@ -218,28 +224,27 @@ config("ilbc_config") { source_set("ilbc") { sources = [ - "codecs/ilbc/audio_encoder_ilbc.cc", - "codecs/ilbc/include/audio_encoder_ilbc.h", "codecs/ilbc/abs_quant.c", "codecs/ilbc/abs_quant.h", "codecs/ilbc/abs_quant_loop.c", "codecs/ilbc/abs_quant_loop.h", + "codecs/ilbc/audio_encoder_ilbc.cc", "codecs/ilbc/augmented_cb_corr.c", "codecs/ilbc/augmented_cb_corr.h", "codecs/ilbc/bw_expand.c", "codecs/ilbc/bw_expand.h", "codecs/ilbc/cb_construct.c", "codecs/ilbc/cb_construct.h", + "codecs/ilbc/cb_mem_energy.c", + "codecs/ilbc/cb_mem_energy.h", "codecs/ilbc/cb_mem_energy_augmentation.c", "codecs/ilbc/cb_mem_energy_augmentation.h", - "codecs/ilbc/cb_mem_energy.c", "codecs/ilbc/cb_mem_energy_calc.c", "codecs/ilbc/cb_mem_energy_calc.h", - "codecs/ilbc/cb_mem_energy.h", "codecs/ilbc/cb_search.c", + "codecs/ilbc/cb_search.h", "codecs/ilbc/cb_search_core.c", "codecs/ilbc/cb_search_core.h", - "codecs/ilbc/cb_search.h", "codecs/ilbc/cb_update_best_index.c", "codecs/ilbc/cb_update_best_index.h", "codecs/ilbc/chebyshev.c", @@ -263,12 +268,12 @@ source_set("ilbc") { "codecs/ilbc/encode.h", "codecs/ilbc/energy_inverse.c", "codecs/ilbc/energy_inverse.h", + "codecs/ilbc/enh_upsample.c", + "codecs/ilbc/enh_upsample.h", "codecs/ilbc/enhancer.c", "codecs/ilbc/enhancer.h", "codecs/ilbc/enhancer_interface.c", "codecs/ilbc/enhancer_interface.h", - "codecs/ilbc/enh_upsample.c", - "codecs/ilbc/enh_upsample.h", "codecs/ilbc/filtered_cb_vecs.c", "codecs/ilbc/filtered_cb_vecs.h", "codecs/ilbc/frame_classify.c", @@ -288,6 +293,7 @@ source_set("ilbc") { "codecs/ilbc/hp_output.c", "codecs/ilbc/hp_output.h", "codecs/ilbc/ilbc.c", + "codecs/ilbc/include/audio_encoder_ilbc.h", "codecs/ilbc/index_conv_dec.c", "codecs/ilbc/index_conv_dec.h", "codecs/ilbc/index_conv_enc.c", @@ -397,8 +403,8 @@ source_set("isac") { "codecs/isac/main/source/codec.h", "codecs/isac/main/source/crc.c", "codecs/isac/main/source/crc.h", - "codecs/isac/main/source/decode_bwe.c", "codecs/isac/main/source/decode.c", + "codecs/isac/main/source/decode_bwe.c", "codecs/isac/main/source/encode.c", "codecs/isac/main/source/encode_lpc_swb.c", "codecs/isac/main/source/encode_lpc_swb.h", @@ -406,10 +412,10 @@ source_set("isac") { "codecs/isac/main/source/entropy_coding.h", "codecs/isac/main/source/fft.c", "codecs/isac/main/source/fft.h", - "codecs/isac/main/source/filterbanks.c", + "codecs/isac/main/source/filter_functions.c", "codecs/isac/main/source/filterbank_tables.c", "codecs/isac/main/source/filterbank_tables.h", - "codecs/isac/main/source/filter_functions.c", + "codecs/isac/main/source/filterbanks.c", "codecs/isac/main/source/intialize.c", "codecs/isac/main/source/isac.c", "codecs/isac/main/source/lattice.c", @@ -477,17 +483,17 @@ source_set("isacfix") { "codecs/isac/fix/source/bandwidth_estimator.c", "codecs/isac/fix/source/bandwidth_estimator.h", "codecs/isac/fix/source/codec.h", - "codecs/isac/fix/source/decode_bwe.c", "codecs/isac/fix/source/decode.c", + "codecs/isac/fix/source/decode_bwe.c", "codecs/isac/fix/source/decode_plc.c", "codecs/isac/fix/source/encode.c", "codecs/isac/fix/source/entropy_coding.c", "codecs/isac/fix/source/entropy_coding.h", "codecs/isac/fix/source/fft.c", "codecs/isac/fix/source/fft.h", - "codecs/isac/fix/source/filterbanks.c", "codecs/isac/fix/source/filterbank_tables.c", "codecs/isac/fix/source/filterbank_tables.h", + "codecs/isac/fix/source/filterbanks.c", "codecs/isac/fix/source/filters.c", "codecs/isac/fix/source/initialize.c", "codecs/isac/fix/source/isacfix.c", @@ -544,17 +550,13 @@ source_set("isacfix") { # //build/config/arm.gni instead, to reduce code duplication. # Remove the -mfpu=vfpv3-d16 cflag. configs -= [ "//build/config/compiler:compiler_arm_fpu" ] - cflags = [ - "-mfpu=neon", - ] + cflags = [ "-mfpu=neon" ] sources += [ "codecs/isac/fix/source/lattice_armv7.S", "codecs/isac/fix/source/pitch_filter_armv6.S", ] - sources -= [ - "codecs/isac/fix/source/pitch_filter_c.c", - ] + sources -= [ "codecs/isac/fix/source/pitch_filter_c.c" ] } if (current_cpu == "mipsel") { @@ -565,22 +567,16 @@ source_set("isacfix") { "codecs/isac/fix/source/pitch_estimator_mips.c", "codecs/isac/fix/source/transform_mips.c", ] - sources -= [ - "codecs/isac/fix/source/pitch_estimator_c.c" - ] + sources -= [ "codecs/isac/fix/source/pitch_estimator_c.c" ] if (mips_dsp_rev > 0) { - sources += [ - "codecs/isac/fix/source/filterbanks_mips.c" - ] + sources += [ "codecs/isac/fix/source/filterbanks_mips.c" ] } if (mips_dsp_rev > 1) { sources += [ "codecs/isac/fix/source/lpc_masking_model_mips.c", "codecs/isac/fix/source/pitch_filter_mips.c", ] - sources -= [ - "codecs/isac/fix/source/pitch_filter_c.c" - ] + sources -= [ "codecs/isac/fix/source/pitch_filter_c.c" ] } } @@ -606,16 +602,14 @@ if (rtc_build_armv7_neon || current_cpu == "arm64") { # //build/config/arm.gni instead, to reduce code duplication. # Remove the -mfpu=vfpv3-d16 cflag. configs -= [ "//build/config/compiler:compiler_arm_fpu" ] - cflags = [ - "-mfpu=neon", - ] + cflags = [ "-mfpu=neon" ] } if (current_cpu != "arm64" || !is_clang) { # Disable AllpassFilter2FixDec16Neon function due to a clang bug. # Refer more details at: # https://code.google.com/p/webrtc/issues/detail?id=4567 - sources += [ "codecs/isac/fix/source/filterbanks_neon.c", ] + sources += [ "codecs/isac/fix/source/filterbanks_neon.c" ] } # Disable LTO in audio_processing_neon target due to compiler bug. @@ -629,7 +623,9 @@ if (rtc_build_armv7_neon || current_cpu == "arm64") { configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] - deps = [ "../../common_audio" ] + deps = [ + "../../common_audio", + ] } } @@ -642,9 +638,9 @@ config("pcm16b_config") { source_set("pcm16b") { sources = [ + "codecs/pcm16b/audio_encoder_pcm16b.cc", "codecs/pcm16b/include/audio_encoder_pcm16b.h", "codecs/pcm16b/include/pcm16b.h", - "codecs/pcm16b/audio_encoder_pcm16b.cc", "codecs/pcm16b/pcm16b.c", ] @@ -674,7 +670,9 @@ source_set("webrtc_opus") { "codecs/opus/opus_interface.c", ] - deps = [ ":audio_encoder_interface" ] + deps = [ + ":audio_encoder_interface", + ] if (rtc_build_opus) { configs += [ "../..:common_config" ] @@ -697,7 +695,6 @@ config("neteq_config") { source_set("neteq") { sources = [ - "neteq/interface/neteq.h", "neteq/accelerate.cc", "neteq/accelerate.h", "neteq/audio_classifier.cc", @@ -735,13 +732,12 @@ source_set("neteq") { "neteq/dtmf_tone_generator.h", "neteq/expand.cc", "neteq/expand.h", + "neteq/interface/neteq.h", "neteq/merge.cc", "neteq/merge.h", + "neteq/neteq.cc", "neteq/neteq_impl.cc", "neteq/neteq_impl.h", - "neteq/neteq.cc", - "neteq/statistics_calculator.cc", - "neteq/statistics_calculator.h", "neteq/normal.cc", "neteq/normal.h", "neteq/packet_buffer.cc", @@ -756,12 +752,14 @@ source_set("neteq") { "neteq/random_vector.h", "neteq/rtcp.cc", "neteq/rtcp.h", + "neteq/statistics_calculator.cc", + "neteq/statistics_calculator.h", "neteq/sync_buffer.cc", "neteq/sync_buffer.h", - "neteq/timestamp_scaler.cc", - "neteq/timestamp_scaler.h", "neteq/time_stretch.cc", "neteq/time_stretch.h", + "neteq/timestamp_scaler.cc", + "neteq/timestamp_scaler.h", ] configs += [ "../..:common_config" ] diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn index f23905fc27..f32c056245 100644 --- a/webrtc/modules/audio_device/BUILD.gn +++ b/webrtc/modules/audio_device/BUILD.gn @@ -18,17 +18,17 @@ config("audio_device_config") { source_set("audio_device") { sources = [ - "include/audio_device.h", - "include/audio_device_defines.h", "audio_device_buffer.cc", "audio_device_buffer.h", + "audio_device_config.h", "audio_device_generic.cc", "audio_device_generic.h", - "audio_device_config.h", "dummy/audio_device_dummy.cc", "dummy/audio_device_dummy.h", "dummy/file_audio_device.cc", "dummy/file_audio_device.h", + "include/audio_device.h", + "include/audio_device_defines.h", ] include_dirs = [] @@ -149,7 +149,7 @@ source_set("audio_device") { configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config", - ":audio_device_config", + ":audio_device_config", ] if (is_clang) { @@ -166,5 +166,3 @@ source_set("audio_device") { "../utility", ] } - - diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn index 30ad8e4281..092be1ef14 100644 --- a/webrtc/modules/audio_processing/BUILD.gn +++ b/webrtc/modules/audio_processing/BUILD.gn @@ -129,7 +129,9 @@ source_set("audio_processing") { public_configs = [ "../..:common_inherited_config" ] defines = [] - deps = [ "../..:webrtc_common" ] + deps = [ + "../..:webrtc_common", + ] if (aec_debug_dump) { defines += [ "WEBRTC_AEC_DEBUG_DUMP" ] @@ -212,7 +214,9 @@ source_set("audio_processing") { if (rtc_enable_protobuf) { proto_library("audioproc_debug_proto") { - sources = [ "debug.proto" ] + sources = [ + "debug.proto", + ] proto_out_dir = "webrtc/audio_processing" } @@ -246,7 +250,9 @@ if (rtc_build_armv7_neon || current_cpu == "arm64") { configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] - deps = [ "../../common_audio" ] + deps = [ + "../../common_audio", + ] # Enable compilation for the ARM v7 Neon instruction set. This is needed # since //build/config/arm.gni only enables Neon for iOS, not Android. @@ -258,7 +264,7 @@ if (rtc_build_armv7_neon || current_cpu == "arm64") { # "-mfpu=neon" is not requried for arm64 in GCC. if (current_cpu != "arm64") { - cflags = [ "-mfpu=neon" ] + cflags = [ "-mfpu=neon" ] } # Disable LTO in audio_processing_neon target due to compiler bug. diff --git a/webrtc/modules/bitrate_controller/BUILD.gn b/webrtc/modules/bitrate_controller/BUILD.gn index f7f67b899c..9280f03679 100644 --- a/webrtc/modules/bitrate_controller/BUILD.gn +++ b/webrtc/modules/bitrate_controller/BUILD.gn @@ -24,7 +24,7 @@ source_set("bitrate_controller") { if (is_win) { cflags = [ # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267" # size_t to int truncations + "/wd4267", # size_t to int truncations ] } @@ -37,5 +37,7 @@ source_set("bitrate_controller") { configs -= [ "//build/config/clang:find_bad_constructs" ] } - deps = [ "../../system_wrappers" ] + deps = [ + "../../system_wrappers", + ] } diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn index c23aa0312d..ca1e66ec92 100644 --- a/webrtc/modules/desktop_capture/BUILD.gn +++ b/webrtc/modules/desktop_capture/BUILD.gn @@ -10,7 +10,7 @@ import("//build/config/ui.gni") import("../../build/webrtc.gni") use_desktop_capture_differ_sse2 = - (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) + !is_ios && (current_cpu == "x86" || current_cpu == "x64") source_set("desktop_capture") { sources = [ @@ -21,17 +21,17 @@ source_set("desktop_capture") { "cropping_window_capturer_win.cc", "desktop_and_cursor_composer.cc", "desktop_and_cursor_composer.h", + "desktop_capture_options.cc", + "desktop_capture_options.h", "desktop_capture_types.h", "desktop_capturer.h", + "desktop_capturer.h", "desktop_frame.cc", "desktop_frame.h", "desktop_frame_win.cc", "desktop_frame_win.h", "desktop_geometry.cc", "desktop_geometry.h", - "desktop_capture_options.h", - "desktop_capture_options.cc", - "desktop_capturer.h", "desktop_region.cc", "desktop_region.h", "differ.cc", @@ -40,8 +40,8 @@ source_set("desktop_capture") { "differ_block.h", "mac/desktop_configuration.h", "mac/desktop_configuration.mm", - "mac/desktop_configuration_monitor.h", "mac/desktop_configuration_monitor.cc", + "mac/desktop_configuration_monitor.h", "mac/full_screen_chrome_window_detector.cc", "mac/full_screen_chrome_window_detector.h", "mac/scoped_pixel_buffer_object.cc", @@ -72,12 +72,12 @@ source_set("desktop_capture") { "win/scoped_gdi_object.h", "win/scoped_thread_desktop.cc", "win/scoped_thread_desktop.h", + "win/screen_capture_utils.cc", + "win/screen_capture_utils.h", "win/screen_capturer_win_gdi.cc", "win/screen_capturer_win_gdi.h", "win/screen_capturer_win_magnifier.cc", "win/screen_capturer_win_magnifier.h", - "win/screen_capture_utils.cc", - "win/screen_capture_utils.h", "win/window_capture_utils.cc", "win/window_capture_utils.h", "window_capturer.cc", @@ -91,14 +91,14 @@ source_set("desktop_capture") { "mouse_cursor_monitor_x11.cc", "screen_capturer_x11.cc", "window_capturer_x11.cc", - "x11/shared_x_display.h", "x11/shared_x_display.cc", + "x11/shared_x_display.h", "x11/x_error_trap.cc", "x11/x_error_trap.h", "x11/x_server_pixel_buffer.cc", "x11/x_server_pixel_buffer.h", ] - configs += ["//build/config/linux:x11"] + configs += [ "//build/config/linux:x11" ] } if (!is_win && !is_mac && !use_x11) { @@ -118,7 +118,7 @@ source_set("desktop_capture") { } configs += [ "../..:common_config" ] - public_configs = [ "../..:common_inherited_config"] + public_configs = [ "../..:common_inherited_config" ] if (is_clang) { # Suppress warnings from Chrome's Clang plugins. @@ -132,7 +132,7 @@ source_set("desktop_capture") { ] if (use_desktop_capture_differ_sse2) { - deps += [":desktop_capture_differ_sse2"] + deps += [ ":desktop_capture_differ_sse2" ] } } @@ -150,7 +150,7 @@ if (use_desktop_capture_differ_sse2) { public_configs = [ "../..:common_inherited_config" ] if (is_posix && !is_mac) { - cflags = ["-msse2"] + cflags = [ "-msse2" ] } } } diff --git a/webrtc/modules/pacing/BUILD.gn b/webrtc/modules/pacing/BUILD.gn index ffced4d882..296bf1795f 100644 --- a/webrtc/modules/pacing/BUILD.gn +++ b/webrtc/modules/pacing/BUILD.gn @@ -8,10 +8,10 @@ source_set("pacing") { sources = [ - "include/paced_sender.h", - "include/packet_router.h", "bitrate_prober.cc", "bitrate_prober.h", + "include/paced_sender.h", + "include/packet_router.h", "paced_sender.cc", "packet_router.cc", ] @@ -25,5 +25,7 @@ source_set("pacing") { configs -= [ "//build/config/clang:find_bad_constructs" ] } - deps = [ "../../system_wrappers" ] + deps = [ + "../../system_wrappers", + ] } diff --git a/webrtc/modules/remote_bitrate_estimator/BUILD.gn b/webrtc/modules/remote_bitrate_estimator/BUILD.gn index fe06c6d777..1858e9ab7d 100644 --- a/webrtc/modules/remote_bitrate_estimator/BUILD.gn +++ b/webrtc/modules/remote_bitrate_estimator/BUILD.gn @@ -14,7 +14,7 @@ source_set("remote_bitrate_estimator") { "rate_statistics.h", ] - configs += [ "../../:common_inherited_config"] + configs += [ "../../:common_inherited_config" ] deps = [ ":rbe_components", @@ -43,7 +43,9 @@ source_set("rbe_components") { configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] - deps = [ "../..:webrtc_common" ] + deps = [ + "../..:webrtc_common", + ] if (is_clang) { # Suppress warnings from Chrome's Clang plugins. diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn index bbf69f4f2d..0eda287a4c 100644 --- a/webrtc/modules/rtp_rtcp/BUILD.gn +++ b/webrtc/modules/rtp_rtcp/BUILD.gn @@ -10,7 +10,6 @@ import("../../build/webrtc.gni") source_set("rtp_rtcp") { sources = [ - # Common "interface/fec_receiver.h", "interface/receive_statistics.h", "interface/remote_ntp_time_estimator.h", @@ -19,18 +18,28 @@ source_set("rtp_rtcp") { "interface/rtp_receiver.h", "interface/rtp_rtcp.h", "interface/rtp_rtcp_defines.h", + "mocks/mock_rtp_rtcp.h", "source/bitrate.cc", "source/bitrate.h", "source/byte_io.h", + "source/dtmf_queue.cc", + "source/dtmf_queue.h", + "source/fec_private_tables_bursty.h", + "source/fec_private_tables_random.h", "source/fec_receiver_impl.cc", "source/fec_receiver_impl.h", + "source/forward_error_correction.cc", + "source/forward_error_correction.h", + "source/forward_error_correction_internal.cc", + "source/forward_error_correction_internal.h", + "source/h264_sps_parser.cc", + "source/h264_sps_parser.h", + "source/mock/mock_rtp_payload_strategy.h", + "source/producer_fec.cc", + "source/producer_fec.h", "source/receive_statistics_impl.cc", "source/receive_statistics_impl.h", "source/remote_ntp_time_estimator.cc", - "source/rtp_header_parser.cc", - "source/rtp_rtcp_config.h", - "source/rtp_rtcp_impl.cc", - "source/rtp_rtcp_impl.h", "source/rtcp_packet.cc", "source/rtcp_packet.h", "source/rtcp_receiver.cc", @@ -41,59 +50,46 @@ source_set("rtp_rtcp") { "source/rtcp_sender.h", "source/rtcp_utility.cc", "source/rtcp_utility.h", + "source/rtp_format.cc", + "source/rtp_format.h", + "source/rtp_format_h264.cc", + "source/rtp_format_h264.h", + "source/rtp_format_video_generic.cc", + "source/rtp_format_video_generic.h", + "source/rtp_format_vp8.cc", + "source/rtp_format_vp8.h", "source/rtp_header_extension.cc", "source/rtp_header_extension.h", + "source/rtp_header_parser.cc", + "source/rtp_packet_history.cc", + "source/rtp_packet_history.h", + "source/rtp_payload_registry.cc", + "source/rtp_receiver_audio.cc", + "source/rtp_receiver_audio.h", "source/rtp_receiver_impl.cc", "source/rtp_receiver_impl.h", + "source/rtp_receiver_strategy.cc", + "source/rtp_receiver_strategy.h", + "source/rtp_receiver_video.cc", + "source/rtp_receiver_video.h", + "source/rtp_rtcp_config.h", + "source/rtp_rtcp_impl.cc", + "source/rtp_rtcp_impl.h", "source/rtp_sender.cc", "source/rtp_sender.h", + "source/rtp_sender_audio.cc", + "source/rtp_sender_audio.h", + "source/rtp_sender_video.cc", + "source/rtp_sender_video.h", "source/rtp_utility.cc", "source/rtp_utility.h", "source/ssrc_database.cc", "source/ssrc_database.h", "source/tmmbr_help.cc", "source/tmmbr_help.h", - # Audio Files - "source/dtmf_queue.cc", - "source/dtmf_queue.h", - "source/rtp_receiver_audio.cc", - "source/rtp_receiver_audio.h", - "source/rtp_sender_audio.cc", - "source/rtp_sender_audio.h", - # Video Files - "source/fec_private_tables_random.h", - "source/fec_private_tables_bursty.h", - "source/forward_error_correction.cc", - "source/forward_error_correction.h", - "source/forward_error_correction_internal.cc", - "source/forward_error_correction_internal.h", - "source/h264_sps_parser.cc", - "source/h264_sps_parser.h", - "source/producer_fec.cc", - "source/producer_fec.h", - "source/rtp_packet_history.cc", - "source/rtp_packet_history.h", - "source/rtp_payload_registry.cc", - "source/rtp_receiver_strategy.cc", - "source/rtp_receiver_strategy.h", - "source/rtp_receiver_video.cc", - "source/rtp_receiver_video.h", - "source/rtp_sender_video.cc", - "source/rtp_sender_video.h", "source/video_codec_information.h", - "source/rtp_format.cc", - "source/rtp_format.h", - "source/rtp_format_h264.cc", - "source/rtp_format_h264.h", - "source/rtp_format_vp8.cc", - "source/rtp_format_vp8.h", - "source/rtp_format_video_generic.cc", - "source/rtp_format_video_generic.h", "source/vp8_partition_aggregator.cc", "source/vp8_partition_aggregator.h", - # Mocks - "mocks/mock_rtp_rtcp.h", - "source/mock/mock_rtp_payload_strategy.h", ] configs += [ "../..:common_config" ] @@ -116,6 +112,7 @@ source_set("rtp_rtcp") { cflags = [ # TODO(jschuh): Bug 1348: fix this warning. "/wd4267", # size_t to int truncations + # TODO(kjellander): Bug 261: fix this warning. "/wd4373", # virtual function override. ] diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn index 0ba15c00cd..f29e5b6c67 100644 --- a/webrtc/modules/video_capture/BUILD.gn +++ b/webrtc/modules/video_capture/BUILD.gn @@ -128,7 +128,7 @@ if (!build_with_chromium) { libs = [ "Strmiids.lib" ] - deps += [ "//third_party/winsdk_samples"] + deps += [ "//third_party/winsdk_samples" ] } if (is_android) { sources = [ @@ -159,6 +159,7 @@ if (!build_with_chromium) { cflags = [ "-fobjc-arc", # CLANG_ENABLE_OBJC_ARC = YES. + # To avoid warnings for deprecated videoMinFrameDuration and # videoMaxFrameDuration properties in iOS 7.0. # See webrtc:3705 for more details. diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn index 402502de58..88f9bbaaa7 100644 --- a/webrtc/modules/video_coding/BUILD.gn +++ b/webrtc/modules/video_coding/BUILD.gn @@ -44,9 +44,9 @@ source_set("video_coding") { "main/source/nack_fec_tables.h", "main/source/packet.cc", "main/source/packet.h", - "main/source/qm_select_data.h", "main/source/qm_select.cc", "main/source/qm_select.h", + "main/source/qm_select_data.h", "main/source/receiver.cc", "main/source/receiver.h", "main/source/rtt_filter.cc", @@ -110,13 +110,15 @@ source_set("video_coding_utility") { configs -= [ "//build/config/clang:find_bad_constructs" ] } - deps = [ "../../system_wrappers" ] + deps = [ + "../../system_wrappers", + ] } source_set("webrtc_i420") { sources = [ - "codecs/i420/main/source/i420.cc", "codecs/i420/main/interface/i420.h", + "codecs/i420/main/source/i420.cc", ] configs += [ "../..:common_config" ] @@ -128,7 +130,9 @@ source_set("webrtc_i420") { configs -= [ "//build/config/clang:find_bad_constructs" ] } - deps = [ "../../system_wrappers" ] + deps = [ + "../../system_wrappers", + ] } source_set("webrtc_vp8") { @@ -174,9 +178,7 @@ source_set("webrtc_vp8") { "../../system_wrappers", ] if (rtc_build_libvpx) { - deps += [ - rtc_libvpx_dir, - ] + deps += [ rtc_libvpx_dir ] } } @@ -190,7 +192,9 @@ source_set("webrtc_vp9") { "codecs/vp9/vp9_impl.h", ] } else { - sources = [ "codecs/vp9/vp9_dummy_impl.cc" ] + sources = [ + "codecs/vp9/vp9_dummy_impl.cc", + ] } configs += [ "../..:common_config" ] @@ -208,8 +212,6 @@ source_set("webrtc_vp9") { "../../system_wrappers", ] if (rtc_build_libvpx) { - deps += [ - rtc_libvpx_dir, - ] + deps += [ rtc_libvpx_dir ] } } diff --git a/webrtc/modules/video_processing/BUILD.gn b/webrtc/modules/video_processing/BUILD.gn index 2f05fb5313..00d2911eef 100644 --- a/webrtc/modules/video_processing/BUILD.gn +++ b/webrtc/modules/video_processing/BUILD.gn @@ -54,7 +54,9 @@ source_set("video_processing") { if (build_video_processing_sse2) { source_set("video_processing_sse2") { - sources = [ "main/source/content_analysis_sse2.cc" ] + sources = [ + "main/source/content_analysis_sse2.cc", + ] configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] diff --git a/webrtc/modules/video_render/BUILD.gn b/webrtc/modules/video_render/BUILD.gn index 8a2b9231b2..8e67cc6fe0 100644 --- a/webrtc/modules/video_render/BUILD.gn +++ b/webrtc/modules/video_render/BUILD.gn @@ -119,17 +119,17 @@ if (!build_with_chromium) { ] directxsdk_exists = - (exec_script("//build/dir_exists.py", - [ rebase_path("//third_party/directxsdk/files", - root_build_dir) ], - "trim string") == "True") + exec_script("//build/dir_exists.py", + [ rebase_path("//third_party/directxsdk/files", + root_build_dir) ], + "trim string") == "True" if (directxsdk_exists) { directxsdk_path = "//third_party/directxsdk/files" } else { directxsdk_path = exec_script("../../build/find_directx_sdk.py", [], "trim string") } - include_dirs = [ directxsdk_path + "/Include" ] + include_dirs = [ directxsdk_path + "/Include" ] } if (is_android) { sources += [ @@ -164,7 +164,7 @@ if (!build_with_chromium) { cflags += [ "-fobjc-arc" ] # CLANG_ENABLE_OBJC_ARC = YES. } - all_dependent_configs = [ ":video_render_internal_impl_config"] + all_dependent_configs = [ ":video_render_internal_impl_config" ] configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn index b9d93a6b09..6d16ac278d 100644 --- a/webrtc/system_wrappers/BUILD.gn +++ b/webrtc/system_wrappers/BUILD.gn @@ -16,8 +16,8 @@ static_library("system_wrappers") { "interface/atomic32.h", "interface/clock.h", "interface/condition_variable_wrapper.h", - "interface/cpu_info.h", "interface/cpu_features_wrapper.h", + "interface/cpu_info.h", "interface/critical_section_wrapper.h", "interface/data_log.h", "interface/data_log_c.h", @@ -50,14 +50,14 @@ static_library("system_wrappers") { "source/atomic32_win.cc", "source/clock.cc", "source/condition_variable.cc", - "source/condition_variable_posix.cc", - "source/condition_variable_posix.h", "source/condition_variable_event_win.cc", "source/condition_variable_event_win.h", "source/condition_variable_native_win.cc", "source/condition_variable_native_win.h", - "source/cpu_info.cc", + "source/condition_variable_posix.cc", + "source/condition_variable_posix.h", "source/cpu_features.cc", + "source/cpu_info.cc", "source/critical_section.cc", "source/critical_section_posix.cc", "source/critical_section_posix.h", @@ -83,12 +83,12 @@ static_library("system_wrappers") { "source/rw_lock_win.h", "source/sleep.cc", "source/sort.cc", - "source/tick_util.cc", "source/thread.cc", "source/thread_posix.cc", "source/thread_posix.h", "source/thread_win.cc", "source/thread_win.h", + "source/tick_util.cc", "source/timestamp_extrapolator.cc", "source/trace_impl.cc", "source/trace_impl.h", @@ -100,9 +100,7 @@ static_library("system_wrappers") { configs += [ "..:common_config" ] - public_configs = [ - "..:common_inherited_config", - ] + public_configs = [ "..:common_inherited_config" ] if (rtc_enable_data_logging) { sources += [ "source/data_log.cc" ] @@ -112,7 +110,9 @@ static_library("system_wrappers") { defines = [] libs = [] - deps = [ "..:webrtc_common" ] + deps = [ + "..:webrtc_common", + ] if (is_android) { sources += [ @@ -122,6 +122,7 @@ static_library("system_wrappers") { defines += [ "WEBRTC_THREAD_RR", + # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now, # remove it after I verify that CLOCK_MONOTONIC is fully functional @@ -146,9 +147,7 @@ static_library("system_wrappers") { } if (!is_mac && !is_ios) { - sources += [ - "source/atomic32_posix.cc", - ] + sources += [ "source/atomic32_posix.cc" ] } if (is_ios || is_mac) { @@ -159,9 +158,7 @@ static_library("system_wrappers") { } if (is_ios) { - sources += [ - "source/atomic32_mac.cc", - ] + sources += [ "source/atomic32_mac.cc" ] } if (is_win) { @@ -173,9 +170,7 @@ static_library("system_wrappers") { ] } - deps += [ - "../base:rtc_base_approved", - ] + deps += [ "../base:rtc_base_approved" ] } source_set("field_trial_default") { @@ -206,7 +201,6 @@ source_set("metrics_default") { } source_set("system_wrappers_default") { - configs += [ "..:common_config" ] public_configs = [ "..:common_inherited_config" ] @@ -224,6 +218,8 @@ if (is_android) { configs += [ "..:common_config" ] public_configs = [ "..:common_inherited_config" ] - deps = [ "//third_party/android_tools:cpu_features" ] + deps = [ + "//third_party/android_tools:cpu_features", + ] } } diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn index 337dcf6db6..ed1dc75078 100644 --- a/webrtc/test/BUILD.gn +++ b/webrtc/test/BUILD.gn @@ -30,7 +30,7 @@ source_set("field_trial") { ] configs += [ "..:common_config" ] - public_configs = [ "..:common_inherited_config"] + public_configs = [ "..:common_inherited_config" ] } source_set("histogram") { @@ -45,7 +45,7 @@ source_set("histogram") { ] configs += [ "..:common_config" ] - public_configs = [ "..:common_inherited_config"] + public_configs = [ "..:common_inherited_config" ] } source_set("test_support") { @@ -81,7 +81,7 @@ source_set("test_support") { } configs += [ "..:common_config" ] - public_configs = [ "..:common_inherited_config"] + public_configs = [ "..:common_inherited_config" ] } source_set("test_support_main") { @@ -103,5 +103,5 @@ source_set("test_support_main") { ] configs += [ "..:common_config" ] - public_configs = [ "..:common_inherited_config"] + public_configs = [ "..:common_inherited_config" ] } diff --git a/webrtc/tools/BUILD.gn b/webrtc/tools/BUILD.gn index 882a16e306..1378e18913 100644 --- a/webrtc/tools/BUILD.gn +++ b/webrtc/tools/BUILD.gn @@ -16,12 +16,12 @@ source_set("tools") { source_set("command_line_parser") { sources = [ - "simple_command_line_parser.h", "simple_command_line_parser.cc", + "simple_command_line_parser.h", ] configs += [ "..:common_config" ] - public_configs = [ "..:common_inherited_config"] + public_configs = [ "..:common_inherited_config" ] } # TODO(kjellander): Convert all of tools.gyp into GN here. @@ -35,7 +35,7 @@ if (!build_with_chromium) { ] configs += [ "..:common_config" ] - public_configs = [ "..:common_inherited_config"] + public_configs = [ "..:common_inherited_config" ] deps = [ ":command_line_parser", diff --git a/webrtc/tools/barcode_tools/barcode_decoder.py b/webrtc/tools/barcode_tools/barcode_decoder.py index b7b7ddd4a6..e615fa83b8 100755 --- a/webrtc/tools/barcode_tools/barcode_decoder.py +++ b/webrtc/tools/barcode_tools/barcode_decoder.py @@ -56,7 +56,7 @@ def convert_yuv_to_png_files(yuv_file_name, yuv_frame_width, yuv_frame_height, print 'Error executing command: %s. Error: %s' % (command, err) return False except OSError: - print ('Did not find %s. Have you installed it?' % ffmpeg_path) + print 'Did not find %s. Have you installed it?' % ffmpeg_path return False return True @@ -111,7 +111,7 @@ def _decode_barcode_in_file(file_name, command_line_decoder): print err return False except OSError: - print ('Did not find %s. Have you installed it?' % command_line_decoder) + print 'Did not find %s. Have you installed it?' % command_line_decoder return False return True @@ -200,7 +200,7 @@ def _check_barcode(barcode): return dsum == int(barcode[11]) -def _count_frames_in(input_directory = '.'): +def _count_frames_in(input_directory='.'): """Calculates the number of frames in the input directory. The function calculates the number of frames in the input directory. The @@ -252,7 +252,7 @@ def _parse_args(): 'decoded. If using Windows and a Cygwin-compiled ' 'zxing.exe, you should keep the default value to ' 'avoid problems. Default: %default')) - options, _args = parser.parse_args() + options, _ = parser.parse_args() return options diff --git a/webrtc/tools/barcode_tools/yuv_cropper.py b/webrtc/tools/barcode_tools/yuv_cropper.py index 9652c168c7..c57a90db08 100755 --- a/webrtc/tools/barcode_tools/yuv_cropper.py +++ b/webrtc/tools/barcode_tools/yuv_cropper.py @@ -122,4 +122,4 @@ def _main(): if __name__ == '__main__': - sys.exit(_main())
\ No newline at end of file + sys.exit(_main()) diff --git a/webrtc/tools/compare_videos.py b/webrtc/tools/compare_videos.py index f6275a67d3..6aa659be36 100755 --- a/webrtc/tools/compare_videos.py +++ b/webrtc/tools/compare_videos.py @@ -55,7 +55,7 @@ def _ParseArgs(): help='Width of the YUV file\'s frames. Default: %default') parser.add_option('--yuv_frame_height', type='int', default=480, help='Height of the YUV file\'s frames. Default: %default') - options, _args = parser.parse_args() + options, _ = parser.parse_args() if not options.ref_video: parser.error('You must provide a path to the reference video!') diff --git a/webrtc/video/BUILD.gn b/webrtc/video/BUILD.gn index 0504dbe88c..95780ffc22 100644 --- a/webrtc/video/BUILD.gn +++ b/webrtc/video/BUILD.gn @@ -43,4 +43,3 @@ source_set("video") { "../video_engine:video_engine_core", ] } - diff --git a/webrtc/video_engine/BUILD.gn b/webrtc/video_engine/BUILD.gn index 3e5f9c692c..d0090ffa47 100644 --- a/webrtc/video_engine/BUILD.gn +++ b/webrtc/video_engine/BUILD.gn @@ -9,7 +9,9 @@ import("../build/webrtc.gni") source_set("video_engine") { - deps = [ ":video_engine_core" ] + deps = [ + ":video_engine_core", + ] } source_set("video_engine_core") { @@ -29,9 +31,9 @@ source_set("video_engine_core") { "vie_capturer.cc", "vie_capturer.h", "vie_channel.cc", + "vie_channel.h", "vie_channel_group.cc", "vie_channel_group.h", - "vie_channel.h", "vie_defines.h", "vie_encoder.cc", "vie_encoder.h", @@ -58,6 +60,7 @@ source_set("video_engine_core") { cflags = [ # TODO(jschuh): Bug 1348: fix size_t to int truncations. "/wd4267", # size_t to int truncation. + # Bug 261. "/wd4373", # legacy warning for ignoring const / volatile in signatures. ] diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn index c55dc8ed07..62386f55b0 100644 --- a/webrtc/voice_engine/BUILD.gn +++ b/webrtc/voice_engine/BUILD.gn @@ -9,8 +9,15 @@ import("../build/webrtc.gni") source_set("voice_engine") { - sources = [ + "channel.cc", + "channel.h", + "channel_manager.cc", + "channel_manager.h", + "dtmf_inband.cc", + "dtmf_inband.h", + "dtmf_inband_queue.cc", + "dtmf_inband_queue.h", "include/voe_audio_processing.h", "include/voe_base.h", "include/voe_codec.h", @@ -24,14 +31,6 @@ source_set("voice_engine") { "include/voe_rtp_rtcp.h", "include/voe_video_sync.h", "include/voe_volume_control.h", - "channel.cc", - "channel.h", - "channel_manager.cc", - "channel_manager.h", - "dtmf_inband.cc", - "dtmf_inband.h", - "dtmf_inband_queue.cc", - "dtmf_inband_queue.h", "level_indicator.cc", "level_indicator.h", "monitor_module.cc", |