diff --git a/.gitignore b/.gitignore index 726febc0ee..90c43dfb82 100644 --- a/.gitignore +++ b/.gitignore @@ -57,9 +57,9 @@ /tools_webrtc/video_quality_toolchain/mac/zxing /tools_webrtc/video_quality_toolchain/win/*.dll /tools_webrtc/video_quality_toolchain/win/*.exe -/webrtc/tools/testing/*.zip -/webrtc/tools/testing/*.gz -/webrtc/tools/testing/golang/*/*.gz -/webrtc/tools/testing/golang/*/*.zip +/webrtc/rtc_tools/testing/*.zip +/webrtc/rtc_tools/testing/*.gz +/webrtc/rtc_tools/testing/golang/*/*.gz +/webrtc/rtc_tools/testing/golang/*/*.zip /x86-generic_out/ /xcodebuild diff --git a/BUILD.gn b/BUILD.gn index 4e6816fd85..19a60d55c7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -13,7 +13,7 @@ group("default") { deps = [ "//webrtc", "//webrtc/examples", - "//webrtc/tools", + "//webrtc/rtc_tools", ] if (rtc_include_tests) { deps += [ "//webrtc:webrtc_tests" ] diff --git a/tools_webrtc/mb/gn_isolate_map.pyl b/tools_webrtc/mb/gn_isolate_map.pyl index a9c870f9e7..3fa6c465e3 100644 --- a/tools_webrtc/mb/gn_isolate_map.pyl +++ b/tools_webrtc/mb/gn_isolate_map.pyl @@ -95,7 +95,7 @@ "type": "console_test_launcher", }, "tools_unittests": { - "label": "//webrtc/tools:tools_unittests", + "label": "//webrtc/rtc_tools:tools_unittests", "type": "console_test_launcher", }, "video_engine_tests": { diff --git a/webrtc/DEPS b/webrtc/DEPS index 333b48ab11..0e986a2ceb 100644 --- a/webrtc/DEPS +++ b/webrtc/DEPS @@ -23,7 +23,7 @@ include_rules = [ "+webrtc/modules/include", "+webrtc/rtc_base", "+webrtc/test", - "+webrtc/tools", + "+webrtc/rtc_tools", ] # The below rules will be removed when webrtc:4243 is fixed. diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn index ccdc21e232..85813fa222 100644 --- a/webrtc/examples/BUILD.gn +++ b/webrtc/examples/BUILD.gn @@ -549,7 +549,7 @@ if (is_linux || is_win) { deps = [ "//webrtc:webrtc_common", "//webrtc/base:rtc_base_approved", - "//webrtc/tools:command_line_parser", + "//webrtc/rtc_tools:command_line_parser", ] if (!build_with_chromium && is_clang) { # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). diff --git a/webrtc/examples/peerconnection/server/main.cc b/webrtc/examples/peerconnection/server/main.cc index 44f42a6595..bd52e673b6 100644 --- a/webrtc/examples/peerconnection/server/main.cc +++ b/webrtc/examples/peerconnection/server/main.cc @@ -17,7 +17,7 @@ #include "webrtc/examples/peerconnection/server/data_socket.h" #include "webrtc/examples/peerconnection/server/peer_channel.h" #include "webrtc/examples/peerconnection/server/utils.h" -#include "webrtc/tools/simple_command_line_parser.h" +#include "webrtc/rtc_tools/simple_command_line_parser.h" static const size_t kMaxConnections = (FD_SETSIZE - 2); diff --git a/webrtc/modules/audio_processing/DEPS b/webrtc/modules/audio_processing/DEPS index bfaaaf5f5d..9b588d0936 100644 --- a/webrtc/modules/audio_processing/DEPS +++ b/webrtc/modules/audio_processing/DEPS @@ -7,7 +7,7 @@ include_rules = [ specific_include_rules = { ".*test\.cc": [ - "+webrtc/tools", + "+webrtc/rtc_tools", # Android platform build has different paths. "+gtest", "+external/webrtc", diff --git a/webrtc/modules/video_coding/DEPS b/webrtc/modules/video_coding/DEPS index 01cd4d574d..8399d79704 100644 --- a/webrtc/modules/video_coding/DEPS +++ b/webrtc/modules/video_coding/DEPS @@ -6,7 +6,7 @@ include_rules = [ "+webrtc/common_video", "+webrtc/media/base", "+webrtc/system_wrappers", - "+webrtc/tools", + "+webrtc/rtc_tools", ] specific_include_rules = { diff --git a/webrtc/rtc_tools/BUILD.gn b/webrtc/rtc_tools/BUILD.gn new file mode 100644 index 0000000000..e224380cc7 --- /dev/null +++ b/webrtc/rtc_tools/BUILD.gn @@ -0,0 +1,350 @@ +# Copyright (c) 2014 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. + +import("//third_party/protobuf/proto_library.gni") +import("../webrtc.gni") + +group("rtc_tools") { + # This target shall build all targets in tools/. + testonly = true + + public_deps = [ + ":command_line_parser", + ":frame_analyzer", + ":frame_editor", + ":psnr_ssim_analyzer", + ":rgba_to_i420_converter", + ] + if (rtc_include_internal_audio_device) { + public_deps += [ ":force_mic_volume_max" ] + } + if (rtc_enable_protobuf) { + public_deps += [ ":chart_proto" ] + } + + if (rtc_include_tests) { + public_deps += [ + ":activity_metric", + ":tools_unittests", + ] + if (rtc_enable_protobuf) { + public_deps += [ + ":event_log_visualizer", + ":rtp_analyzer", + "network_tester", + ] + } + } +} + +rtc_static_library("command_line_parser") { + sources = [ + "simple_command_line_parser.cc", + "simple_command_line_parser.h", + ] + deps = [ + "../base:gtest_prod", + "../base:rtc_base_approved", + ] +} + +rtc_static_library("video_quality_analysis") { + sources = [ + "frame_analyzer/video_quality_analysis.cc", + "frame_analyzer/video_quality_analysis.h", + ] + + deps = [ + "../common_video", + ] + public_deps = [ + "../common_video", + ] +} + +rtc_executable("frame_analyzer") { + sources = [ + "frame_analyzer/frame_analyzer.cc", + ] + + deps = [ + ":command_line_parser", + ":video_quality_analysis", + "//build/win:default_exe_manifest", + ] +} + +rtc_executable("psnr_ssim_analyzer") { + sources = [ + "psnr_ssim_analyzer/psnr_ssim_analyzer.cc", + ] + + deps = [ + ":command_line_parser", + ":video_quality_analysis", + "//build/win:default_exe_manifest", + ] +} + +rtc_static_library("reference_less_video_analysis_lib") { + sources = [ + "frame_analyzer/reference_less_video_analysis_lib.cc", + "frame_analyzer/reference_less_video_analysis_lib.h", + ] + + deps = [ + ":video_quality_analysis", + ] +} + +rtc_executable("reference_less_video_analysis") { + sources = [ + "frame_analyzer/reference_less_video_analysis.cc", + ] + + deps = [ + ":command_line_parser", + ":reference_less_video_analysis_lib", + "//build/win:default_exe_manifest", + ] +} + +rtc_executable("rgba_to_i420_converter") { + sources = [ + "converter/converter.cc", + "converter/converter.h", + "converter/rgba_to_i420_converter.cc", + ] + + deps = [ + ":command_line_parser", + "../common_video", + "//build/win:default_exe_manifest", + ] +} + +rtc_static_library("frame_editing_lib") { + sources = [ + "frame_editing/frame_editing_lib.cc", + "frame_editing/frame_editing_lib.h", + ] + + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + + deps = [ + "..:webrtc_common", + "../common_video", + ] +} + +rtc_executable("frame_editor") { + sources = [ + "frame_editing/frame_editing.cc", + ] + + deps = [ + ":command_line_parser", + ":frame_editing_lib", + "//build/win:default_exe_manifest", + ] +} + +# It doesn't make sense to build this tool without the ADM enabled. +if (rtc_include_internal_audio_device) { + rtc_executable("force_mic_volume_max") { + sources = [ + "force_mic_volume_max/force_mic_volume_max.cc", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + + deps = [ + "../modules/audio_device", + "../system_wrappers:system_wrappers_default", + "//build/win:default_exe_manifest", + ] + } +} + +if (rtc_enable_protobuf) { + proto_library("chart_proto") { + sources = [ + "event_log_visualizer/chart.proto", + ] + proto_out_dir = "webrtc/rtc_tools/event_log_visualizer" + } + + rtc_static_library("event_log_visualizer_utils") { + sources = [ + "event_log_visualizer/analyzer.cc", + "event_log_visualizer/analyzer.h", + "event_log_visualizer/plot_base.cc", + "event_log_visualizer/plot_base.h", + "event_log_visualizer/plot_protobuf.cc", + "event_log_visualizer/plot_protobuf.h", + "event_log_visualizer/plot_python.cc", + "event_log_visualizer/plot_python.h", + ] + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + defines = [ "ENABLE_RTC_EVENT_LOG" ] + deps = [ + "..:video_stream_api", + "../base:rtc_base_approved", + "../call:call_interfaces", + "../logging:rtc_event_log_impl", + "../logging:rtc_event_log_parser", + "../modules:module_api", + "../modules/audio_coding:ana_debug_dump_proto", + "../modules/audio_coding:neteq_tools", + + # TODO(kwiberg): Remove this dependency. + "../api/audio_codecs:audio_codecs_api", + "../modules/congestion_controller", + "../modules/rtp_rtcp", + "../system_wrappers:system_wrappers_default", + "//build/config:exe_and_shlib_deps", + ] + public_deps = [ + ":chart_proto", + "../logging:rtc_event_log_parser", + ] + } +} + +# Exclude tools depending on gflags since that's not available in Chromium. +if (rtc_include_tests) { + if (rtc_enable_protobuf) { + rtc_executable("event_log_visualizer") { + testonly = true + sources = [ + "event_log_visualizer/main.cc", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + + defines = [ "ENABLE_RTC_EVENT_LOG" ] + deps = [ + ":event_log_visualizer_utils", + "../base:rtc_base_approved", + "../test:field_trial", + "../test:test_support", + ] + } + } + + rtc_executable("activity_metric") { + testonly = true + sources = [ + "agc/activity_metric.cc", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + + deps = [ + "../base:rtc_base_approved", + "../modules:module_api", + "../modules/audio_processing", + "../system_wrappers:metrics_default", + "../test:test_support", + "//build/win:default_exe_manifest", + "//testing/gtest", + ] + } + + tools_unittests_resources = [ + "//resources/foreman_cif.yuv", + "//resources/reference_less_video_test_file.y4m", + "//resources/video_quality_analysis_frame.txt", + ] + + if (is_ios) { + bundle_data("tools_unittests_bundle_data") { + testonly = true + sources = tools_unittests_resources + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } + } + + rtc_test("tools_unittests") { + testonly = true + + sources = [ + "frame_analyzer/reference_less_video_analysis_unittest.cc", + "frame_analyzer/video_quality_analysis_unittest.cc", + "frame_editing/frame_editing_unittest.cc", + "simple_command_line_parser_unittest.cc", + ] + + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + + deps = [ + ":command_line_parser", + ":frame_editing_lib", + ":reference_less_video_analysis_lib", + ":video_quality_analysis", + "../test:test_main", + "//testing/gtest", + ] + + if (rtc_enable_protobuf) { + deps += [ "network_tester:network_tester_unittests" ] + } + + data = tools_unittests_resources + if (is_android) { + deps += [ "//testing/android/native_test:native_test_support" ] + shard_timeout = 900 + } + if (is_ios) { + deps += [ ":tools_unittests_bundle_data" ] + } + } + + if (rtc_enable_protobuf) { + copy("rtp_analyzer") { + sources = [ + "py_event_log_analyzer/misc.py", + "py_event_log_analyzer/pb_parse.py", + "py_event_log_analyzer/rtp_analyzer.py", + "py_event_log_analyzer/rtp_analyzer.sh", + ] + outputs = [ + "$root_build_dir/{{source_file_part}}", + ] + deps = [ + "../logging:rtc_event_log_proto", + ] + } + } +} diff --git a/webrtc/tools/DEPS b/webrtc/rtc_tools/DEPS similarity index 100% rename from webrtc/tools/DEPS rename to webrtc/rtc_tools/DEPS diff --git a/webrtc/tools/OWNERS b/webrtc/rtc_tools/OWNERS similarity index 100% rename from webrtc/tools/OWNERS rename to webrtc/rtc_tools/OWNERS diff --git a/webrtc/tools/agc/activity_metric.cc b/webrtc/rtc_tools/agc/activity_metric.cc similarity index 100% rename from webrtc/tools/agc/activity_metric.cc rename to webrtc/rtc_tools/agc/activity_metric.cc diff --git a/webrtc/tools/author_line_count.sh b/webrtc/rtc_tools/author_line_count.sh similarity index 100% rename from webrtc/tools/author_line_count.sh rename to webrtc/rtc_tools/author_line_count.sh diff --git a/webrtc/tools/barcode_tools/DEPS b/webrtc/rtc_tools/barcode_tools/DEPS similarity index 100% rename from webrtc/tools/barcode_tools/DEPS rename to webrtc/rtc_tools/barcode_tools/DEPS diff --git a/webrtc/tools/barcode_tools/README b/webrtc/rtc_tools/barcode_tools/README similarity index 93% rename from webrtc/tools/barcode_tools/README rename to webrtc/rtc_tools/barcode_tools/README index 00c5136c88..a23e798064 100644 --- a/webrtc/tools/barcode_tools/README +++ b/webrtc/rtc_tools/barcode_tools/README @@ -9,7 +9,7 @@ This script depends on: To automatically download Zxing for the encoder script, checkout this directory as a separate gclient solution, like this: -gclient config http://webrtc.googlecode.com/svn/trunk/webrtc/tools/barcode_tools +gclient config http://webrtc.googlecode.com/svn/trunk/webrtc/rtc_tools/barcode_tools gclient sync Then the Zxing Java source code will be put in third_party/zxing. diff --git a/webrtc/tools/barcode_tools/barcode_decoder.py b/webrtc/rtc_tools/barcode_tools/barcode_decoder.py similarity index 99% rename from webrtc/tools/barcode_tools/barcode_decoder.py rename to webrtc/rtc_tools/barcode_tools/barcode_decoder.py index b89d6a4134..2abd677b4b 100755 --- a/webrtc/tools/barcode_tools/barcode_decoder.py +++ b/webrtc/rtc_tools/barcode_tools/barcode_decoder.py @@ -260,7 +260,7 @@ def main(): """The main function. A simple invocation is: - ./webrtc/tools/barcode_tools/barcode_decoder.py + ./webrtc/rtc_tools/barcode_tools/barcode_decoder.py --yuv_file= --yuv_frame_width=640 --yuv_frame_height=480 --stats_file= diff --git a/webrtc/tools/barcode_tools/barcode_encoder.py b/webrtc/rtc_tools/barcode_tools/barcode_encoder.py similarity index 99% rename from webrtc/tools/barcode_tools/barcode_encoder.py rename to webrtc/rtc_tools/barcode_tools/barcode_encoder.py index c0400dfccc..9ab8b50754 100755 --- a/webrtc/tools/barcode_tools/barcode_encoder.py +++ b/webrtc/rtc_tools/barcode_tools/barcode_encoder.py @@ -324,7 +324,7 @@ def main(): """The main function. A simple invocation will be: - ./webrtc/tools/barcode_tools/barcode_encoder.py --barcode_height=32 + ./webrtc/rtc_tools/barcode_tools/barcode_encoder.py --barcode_height=32 --base_frame_width=352 --base_frame_height=288 --base_yuv= --output_yuv= diff --git a/webrtc/tools/barcode_tools/build_zxing.py b/webrtc/rtc_tools/barcode_tools/build_zxing.py similarity index 100% rename from webrtc/tools/barcode_tools/build_zxing.py rename to webrtc/rtc_tools/barcode_tools/build_zxing.py diff --git a/webrtc/tools/barcode_tools/helper_functions.py b/webrtc/rtc_tools/barcode_tools/helper_functions.py similarity index 100% rename from webrtc/tools/barcode_tools/helper_functions.py rename to webrtc/rtc_tools/barcode_tools/helper_functions.py diff --git a/webrtc/tools/barcode_tools/yuv_cropper.py b/webrtc/rtc_tools/barcode_tools/yuv_cropper.py similarity index 100% rename from webrtc/tools/barcode_tools/yuv_cropper.py rename to webrtc/rtc_tools/barcode_tools/yuv_cropper.py diff --git a/webrtc/tools/class_usage.sh b/webrtc/rtc_tools/class_usage.sh similarity index 100% rename from webrtc/tools/class_usage.sh rename to webrtc/rtc_tools/class_usage.sh diff --git a/webrtc/rtc_tools/compare_videos.py b/webrtc/rtc_tools/compare_videos.py new file mode 100755 index 0000000000..ce5bff30c1 --- /dev/null +++ b/webrtc/rtc_tools/compare_videos.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python +# Copyright (c) 2013 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. + +import optparse +import os +import shutil +import subprocess +import sys +import tempfile + + +SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) + +# Chrome browsertests will throw away stderr; avoid that output gets lost. +sys.stderr = sys.stdout + + +def _ParseArgs(): + """Registers the command-line options.""" + usage = 'usage: %prog [options]' + parser = optparse.OptionParser(usage=usage) + + parser.add_option('--label', type='string', default='MY_TEST', + help=('Label of the test, used to identify different ' + 'tests. Default: %default')) + parser.add_option('--ref_video', type='string', + help='Reference video to compare with (YUV).') + parser.add_option('--test_video', type='string', + help=('Test video to be compared with the reference ' + 'video (YUV).')) + parser.add_option('--frame_analyzer', type='string', + help='Path to the frame analyzer executable.') + parser.add_option('--barcode_decoder', type='string', + help=('Path to the barcode decoder script. By default, we ' + 'will assume we can find it in barcode_tools/' + 'relative to this directory.')) + parser.add_option('--ffmpeg_path', type='string', + help=('The path to where the ffmpeg executable is located. ' + 'If omitted, it will be assumed to be present in the ' + 'PATH with the name ffmpeg[.exe].')) + parser.add_option('--zxing_path', type='string', + help=('The path to where the zxing executable is located. ' + 'If omitted, it will be assumed to be present in the ' + 'PATH with the name zxing[.exe].')) + parser.add_option('--stats_file_ref', type='string', default='stats_ref.txt', + help=('Path to the temporary stats file to be created and ' + 'used for the reference video file. ' + 'Default: %default')) + parser.add_option('--stats_file_test', type='string', + default='stats_test.txt', + help=('Path to the temporary stats file to be created and ' + 'used for the test video file. Default: %default')) + parser.add_option('--stats_file', type='string', + help=('DEPRECATED')) + parser.add_option('--yuv_frame_width', type='int', default=640, + 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, _ = parser.parse_args() + + if options.stats_file: + options.stats_file_test = options.stats_file + print ('WARNING: Using deprecated switch --stats_file. ' + 'The new flag is --stats_file_test.') + + if not options.ref_video: + parser.error('You must provide a path to the reference video!') + if not os.path.exists(options.ref_video): + parser.error('Cannot find the reference video at %s' % options.ref_video) + + if not options.test_video: + parser.error('You must provide a path to the test video!') + if not os.path.exists(options.test_video): + parser.error('Cannot find the test video at %s' % options.test_video) + + if not options.frame_analyzer: + parser.error('You must provide the path to the frame analyzer executable!') + if not os.path.exists(options.frame_analyzer): + parser.error('Cannot find frame analyzer executable at %s!' % + options.frame_analyzer) + return options + +def _DevNull(): + """On Windows, sometimes the inherited stdin handle from the parent process + fails. Workaround this by passing null to stdin to the subprocesses commands. + This function can be used to create the null file handler. + """ + return open(os.devnull, 'r') + +def DecodeBarcodesInVideo(options, path_to_decoder, video, stat_file): + # Run barcode decoder on the test video to identify frame numbers. + png_working_directory = tempfile.mkdtemp() + cmd = [ + sys.executable, + path_to_decoder, + '--yuv_file=%s' % video, + '--yuv_frame_width=%d' % options.yuv_frame_width, + '--yuv_frame_height=%d' % options.yuv_frame_height, + '--stats_file=%s' % stat_file, + '--png_working_dir=%s' % png_working_directory, + ] + if options.zxing_path: + cmd.append('--zxing_path=%s' % options.zxing_path) + if options.ffmpeg_path: + cmd.append('--ffmpeg_path=%s' % options.ffmpeg_path) + + + barcode_decoder = subprocess.Popen(cmd, stdin=_DevNull(), + stdout=sys.stdout, stderr=sys.stderr) + barcode_decoder.wait() + + shutil.rmtree(png_working_directory) + if barcode_decoder.returncode != 0: + print 'Failed to run barcode decoder script.' + return 1 + return 0 + +def main(): + """The main function. + + A simple invocation is: + ./webrtc/rtc_tools/barcode_tools/compare_videos.py + --ref_video= + --test_video= + --frame_analyzer= + + Notice that the prerequisites for barcode_decoder.py also applies to this + script. The means the following executables have to be available in the PATH: + * zxing + * ffmpeg + """ + options = _ParseArgs() + + if options.barcode_decoder: + path_to_decoder = options.barcode_decoder + else: + path_to_decoder = os.path.join(SCRIPT_DIR, 'barcode_tools', + 'barcode_decoder.py') + + if DecodeBarcodesInVideo(options, path_to_decoder, + options.ref_video, options.stats_file_ref) != 0: + return 1 + if DecodeBarcodesInVideo(options, path_to_decoder, + options.test_video, options.stats_file_test) != 0: + return 1 + + # Run frame analyzer to compare the videos and print output. + cmd = [ + options.frame_analyzer, + '--label=%s' % options.label, + '--reference_file=%s' % options.ref_video, + '--test_file=%s' % options.test_video, + '--stats_file_ref=%s' % options.stats_file_ref, + '--stats_file_test=%s' % options.stats_file_test, + '--width=%d' % options.yuv_frame_width, + '--height=%d' % options.yuv_frame_height, + ] + frame_analyzer = subprocess.Popen(cmd, stdin=_DevNull(), + stdout=sys.stdout, stderr=sys.stderr) + frame_analyzer.wait() + if frame_analyzer.returncode != 0: + print 'Failed to run frame analyzer.' + return 1 + + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/webrtc/tools/converter/converter.cc b/webrtc/rtc_tools/converter/converter.cc similarity index 99% rename from webrtc/tools/converter/converter.cc rename to webrtc/rtc_tools/converter/converter.cc index a9b453d509..0216ff53df 100644 --- a/webrtc/tools/converter/converter.cc +++ b/webrtc/rtc_tools/converter/converter.cc @@ -14,7 +14,7 @@ #include #include -#include "webrtc/tools/converter/converter.h" +#include "webrtc/rtc_tools/converter/converter.h" #ifdef WIN32 #define SEPARATOR '\\' diff --git a/webrtc/tools/converter/converter.h b/webrtc/rtc_tools/converter/converter.h similarity index 95% rename from webrtc/tools/converter/converter.h rename to webrtc/rtc_tools/converter/converter.h index f7641ff60d..2c19923283 100644 --- a/webrtc/tools/converter/converter.h +++ b/webrtc/rtc_tools/converter/converter.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TOOLS_CONVERTER_CONVERTER_H_ -#define WEBRTC_TOOLS_CONVERTER_CONVERTER_H_ +#ifndef WEBRTC_RTC_TOOLS_CONVERTER_CONVERTER_H_ +#define WEBRTC_RTC_TOOLS_CONVERTER_CONVERTER_H_ #include @@ -106,4 +106,4 @@ class Converter { } // namespace test } // namespace webrtc -#endif // WEBRTC_TOOLS_CONVERTER_CONVERTER_H_ +#endif // WEBRTC_RTC_TOOLS_CONVERTER_CONVERTER_H_ diff --git a/webrtc/tools/converter/rgba_to_i420_converter.cc b/webrtc/rtc_tools/converter/rgba_to_i420_converter.cc similarity index 96% rename from webrtc/tools/converter/rgba_to_i420_converter.cc rename to webrtc/rtc_tools/converter/rgba_to_i420_converter.cc index 6b1056fae4..723893e6db 100644 --- a/webrtc/tools/converter/rgba_to_i420_converter.cc +++ b/webrtc/rtc_tools/converter/rgba_to_i420_converter.cc @@ -15,8 +15,8 @@ #include #include -#include "webrtc/tools/converter/converter.h" -#include "webrtc/tools/simple_command_line_parser.h" +#include "webrtc/rtc_tools/converter/converter.h" +#include "webrtc/rtc_tools/simple_command_line_parser.h" /* * A command-line tool based on libyuv to convert a set of RGBA files to a YUV diff --git a/webrtc/tools/event_log_visualizer/OWNERS b/webrtc/rtc_tools/event_log_visualizer/OWNERS similarity index 100% rename from webrtc/tools/event_log_visualizer/OWNERS rename to webrtc/rtc_tools/event_log_visualizer/OWNERS diff --git a/webrtc/tools/event_log_visualizer/analyzer.cc b/webrtc/rtc_tools/event_log_visualizer/analyzer.cc similarity index 99% rename from webrtc/tools/event_log_visualizer/analyzer.cc rename to webrtc/rtc_tools/event_log_visualizer/analyzer.cc index 2851351685..a9fdce6059 100644 --- a/webrtc/tools/event_log_visualizer/analyzer.cc +++ b/webrtc/rtc_tools/event_log_visualizer/analyzer.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/event_log_visualizer/analyzer.h" +#include "webrtc/rtc_tools/event_log_visualizer/analyzer.h" #include #include diff --git a/webrtc/tools/event_log_visualizer/analyzer.h b/webrtc/rtc_tools/event_log_visualizer/analyzer.h similarity index 96% rename from webrtc/tools/event_log_visualizer/analyzer.h rename to webrtc/rtc_tools/event_log_visualizer/analyzer.h index fab52b96a1..cdc81f1f4c 100644 --- a/webrtc/tools/event_log_visualizer/analyzer.h +++ b/webrtc/rtc_tools/event_log_visualizer/analyzer.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ -#define WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ +#ifndef WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ +#define WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ #include #include @@ -23,7 +23,7 @@ #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" -#include "webrtc/tools/event_log_visualizer/plot_base.h" +#include "webrtc/rtc_tools/event_log_visualizer/plot_base.h" namespace webrtc { namespace plotting { @@ -203,4 +203,4 @@ class EventLogAnalyzer { } // namespace plotting } // namespace webrtc -#endif // WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ +#endif // WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_ diff --git a/webrtc/tools/event_log_visualizer/chart.proto b/webrtc/rtc_tools/event_log_visualizer/chart.proto similarity index 100% rename from webrtc/tools/event_log_visualizer/chart.proto rename to webrtc/rtc_tools/event_log_visualizer/chart.proto diff --git a/webrtc/tools/event_log_visualizer/main.cc b/webrtc/rtc_tools/event_log_visualizer/main.cc similarity index 97% rename from webrtc/tools/event_log_visualizer/main.cc rename to webrtc/rtc_tools/event_log_visualizer/main.cc index 91d599f2b3..6ceeeec4e9 100644 --- a/webrtc/tools/event_log_visualizer/main.cc +++ b/webrtc/rtc_tools/event_log_visualizer/main.cc @@ -12,11 +12,11 @@ #include "webrtc/base/flags.h" #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" +#include "webrtc/rtc_tools/event_log_visualizer/analyzer.h" +#include "webrtc/rtc_tools/event_log_visualizer/plot_base.h" +#include "webrtc/rtc_tools/event_log_visualizer/plot_python.h" #include "webrtc/test/field_trial.h" #include "webrtc/test/testsupport/fileutils.h" -#include "webrtc/tools/event_log_visualizer/analyzer.h" -#include "webrtc/tools/event_log_visualizer/plot_base.h" -#include "webrtc/tools/event_log_visualizer/plot_python.h" DEFINE_bool(incoming, true, "Plot statistics for incoming packets."); DEFINE_bool(outgoing, true, "Plot statistics for outgoing packets."); diff --git a/webrtc/tools/event_log_visualizer/plot_base.cc b/webrtc/rtc_tools/event_log_visualizer/plot_base.cc similarity index 97% rename from webrtc/tools/event_log_visualizer/plot_base.cc rename to webrtc/rtc_tools/event_log_visualizer/plot_base.cc index 63fb09272e..f1924b6f44 100644 --- a/webrtc/tools/event_log_visualizer/plot_base.cc +++ b/webrtc/rtc_tools/event_log_visualizer/plot_base.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/event_log_visualizer/plot_base.h" +#include "webrtc/rtc_tools/event_log_visualizer/plot_base.h" #include diff --git a/webrtc/tools/event_log_visualizer/plot_base.h b/webrtc/rtc_tools/event_log_visualizer/plot_base.h similarity index 96% rename from webrtc/tools/event_log_visualizer/plot_base.h rename to webrtc/rtc_tools/event_log_visualizer/plot_base.h index 0abd6befec..bdcea2e5c3 100644 --- a/webrtc/tools/event_log_visualizer/plot_base.h +++ b/webrtc/rtc_tools/event_log_visualizer/plot_base.h @@ -7,8 +7,8 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ -#define WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ +#ifndef WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ +#define WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ #include #include @@ -137,4 +137,4 @@ class PlotCollection { } // namespace plotting } // namespace webrtc -#endif // WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ +#endif // WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_ diff --git a/webrtc/tools/event_log_visualizer/plot_protobuf.cc b/webrtc/rtc_tools/event_log_visualizer/plot_protobuf.cc similarity index 97% rename from webrtc/tools/event_log_visualizer/plot_protobuf.cc rename to webrtc/rtc_tools/event_log_visualizer/plot_protobuf.cc index d5e9192351..f176414aa2 100644 --- a/webrtc/tools/event_log_visualizer/plot_protobuf.cc +++ b/webrtc/rtc_tools/event_log_visualizer/plot_protobuf.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/event_log_visualizer/plot_protobuf.h" +#include "webrtc/rtc_tools/event_log_visualizer/plot_protobuf.h" #include diff --git a/webrtc/tools/event_log_visualizer/plot_protobuf.h b/webrtc/rtc_tools/event_log_visualizer/plot_protobuf.h similarity index 76% rename from webrtc/tools/event_log_visualizer/plot_protobuf.h rename to webrtc/rtc_tools/event_log_visualizer/plot_protobuf.h index f80ff49e98..cd9fd91b65 100644 --- a/webrtc/tools/event_log_visualizer/plot_protobuf.h +++ b/webrtc/rtc_tools/event_log_visualizer/plot_protobuf.h @@ -7,14 +7,14 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_ -#define WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_ +#ifndef WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_ +#define WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_ #include "webrtc/base/ignore_wundef.h" RTC_PUSH_IGNORING_WUNDEF() -#include "webrtc/tools/event_log_visualizer/chart.pb.h" +#include "webrtc/rtc_tools/event_log_visualizer/chart.pb.h" RTC_POP_IGNORING_WUNDEF() -#include "webrtc/tools/event_log_visualizer/plot_base.h" +#include "webrtc/rtc_tools/event_log_visualizer/plot_base.h" namespace webrtc { namespace plotting { @@ -39,4 +39,4 @@ class ProtobufPlotCollection final : public PlotCollection { } // namespace plotting } // namespace webrtc -#endif // WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_ +#endif // WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_ diff --git a/webrtc/tools/event_log_visualizer/plot_python.cc b/webrtc/rtc_tools/event_log_visualizer/plot_python.cc similarity index 98% rename from webrtc/tools/event_log_visualizer/plot_python.cc rename to webrtc/rtc_tools/event_log_visualizer/plot_python.cc index 59270a0b95..d4ae043a1b 100644 --- a/webrtc/tools/event_log_visualizer/plot_python.cc +++ b/webrtc/rtc_tools/event_log_visualizer/plot_python.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/event_log_visualizer/plot_python.h" +#include "webrtc/rtc_tools/event_log_visualizer/plot_python.h" #include diff --git a/webrtc/tools/event_log_visualizer/plot_python.h b/webrtc/rtc_tools/event_log_visualizer/plot_python.h similarity index 76% rename from webrtc/tools/event_log_visualizer/plot_python.h rename to webrtc/rtc_tools/event_log_visualizer/plot_python.h index 2bf445a43e..cad2f45ea4 100644 --- a/webrtc/tools/event_log_visualizer/plot_python.h +++ b/webrtc/rtc_tools/event_log_visualizer/plot_python.h @@ -7,10 +7,10 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_ -#define WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_ +#ifndef WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_ +#define WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_ -#include "webrtc/tools/event_log_visualizer/plot_base.h" +#include "webrtc/rtc_tools/event_log_visualizer/plot_base.h" namespace webrtc { namespace plotting { @@ -33,4 +33,4 @@ class PythonPlotCollection final : public PlotCollection { } // namespace plotting } // namespace webrtc -#endif // WEBRTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_ +#endif // WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_ diff --git a/webrtc/tools/force_mic_volume_max/force_mic_volume_max.cc b/webrtc/rtc_tools/force_mic_volume_max/force_mic_volume_max.cc similarity index 100% rename from webrtc/tools/force_mic_volume_max/force_mic_volume_max.cc rename to webrtc/rtc_tools/force_mic_volume_max/force_mic_volume_max.cc diff --git a/webrtc/tools/frame_analyzer/frame_analyzer.cc b/webrtc/rtc_tools/frame_analyzer/frame_analyzer.cc similarity index 97% rename from webrtc/tools/frame_analyzer/frame_analyzer.cc rename to webrtc/rtc_tools/frame_analyzer/frame_analyzer.cc index 0a3be1939e..4af3389422 100644 --- a/webrtc/tools/frame_analyzer/frame_analyzer.cc +++ b/webrtc/rtc_tools/frame_analyzer/frame_analyzer.cc @@ -15,8 +15,8 @@ #include #include -#include "webrtc/tools/frame_analyzer/video_quality_analysis.h" -#include "webrtc/tools/simple_command_line_parser.h" +#include "webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h" +#include "webrtc/rtc_tools/simple_command_line_parser.h" /* * A command line tool running PSNR and SSIM on a reference video and a test diff --git a/webrtc/tools/frame_analyzer/reference_less_video_analysis.cc b/webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis.cc similarity index 90% rename from webrtc/tools/frame_analyzer/reference_less_video_analysis.cc rename to webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis.cc index 019564eaf4..6170da01f3 100644 --- a/webrtc/tools/frame_analyzer/reference_less_video_analysis.cc +++ b/webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis.cc @@ -11,8 +11,8 @@ #include #include -#include "webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.h" -#include "webrtc/tools/simple_command_line_parser.h" +#include "webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h" +#include "webrtc/rtc_tools/simple_command_line_parser.h" int main(int argc, char** argv) { // This captures the freezing metrics for reference less video analysis. diff --git a/webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.cc b/webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.cc similarity index 97% rename from webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.cc rename to webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.cc index ab484e9bb5..0f5c012d1d 100644 --- a/webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.cc +++ b/webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.cc @@ -14,8 +14,8 @@ #include #include -#include "webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.h" -#include "webrtc/tools/frame_analyzer/video_quality_analysis.h" +#include "webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h" +#include "webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h" #define STATS_LINE_LENGTH 28 #define PSNR_FREEZE_THRESHOLD 47 @@ -90,7 +90,7 @@ void print_freezing_metrics(const std::vector& psnr_per_frame, * 5) Total different identical frames found. * * Sample output: - * Printing metrics for file: /src/webrtc/tools/test_3.y4m + * Printing metrics for file: /src/webrtc/rtc_tools/test_3.y4m ============================= Total number of frames received: 74 Total identical frames: 5 diff --git a/webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.h b/webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h similarity index 89% rename from webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.h rename to webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h index 2fa0898c32..b50aa09250 100644 --- a/webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.h +++ b/webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TOOLS_FRAME_ANALYZER_REFERENCE_LESS_VIDEO_ANALYSIS_LIB_H_ -#define WEBRTC_TOOLS_FRAME_ANALYZER_REFERENCE_LESS_VIDEO_ANALYSIS_LIB_H_ +#ifndef WEBRTC_RTC_TOOLS_FRAME_ANALYZER_REFERENCE_LESS_VIDEO_ANALYSIS_LIB_H_ +#define WEBRTC_RTC_TOOLS_FRAME_ANALYZER_REFERENCE_LESS_VIDEO_ANALYSIS_LIB_H_ #include #include @@ -47,4 +47,4 @@ bool check_file_extension(const std::string& video_file_name); // for a list of video files. int run_analysis(const std::string& video_file); -#endif // WEBRTC_TOOLS_FRAME_ANALYZER_REFERENCE_LESS_VIDEO_ANALYSIS_LIB_H_ +#endif // WEBRTC_RTC_TOOLS_FRAME_ANALYZER_REFERENCE_LESS_VIDEO_ANALYSIS_LIB_H_ diff --git a/webrtc/tools/frame_analyzer/reference_less_video_analysis_unittest.cc b/webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_unittest.cc similarity index 96% rename from webrtc/tools/frame_analyzer/reference_less_video_analysis_unittest.cc rename to webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_unittest.cc index b8e1c551af..8d9e2578e1 100644 --- a/webrtc/tools/frame_analyzer/reference_less_video_analysis_unittest.cc +++ b/webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_unittest.cc @@ -13,9 +13,9 @@ #include #include +#include "webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h" #include "webrtc/test/gtest.h" #include "webrtc/test/testsupport/fileutils.h" -#include "webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.h" class ReferenceLessVideoAnalysisTest : public ::testing::Test { public: diff --git a/webrtc/tools/frame_analyzer/video_quality_analysis.cc b/webrtc/rtc_tools/frame_analyzer/video_quality_analysis.cc similarity index 99% rename from webrtc/tools/frame_analyzer/video_quality_analysis.cc rename to webrtc/rtc_tools/frame_analyzer/video_quality_analysis.cc index c8aa71af8e..2d8376c26f 100644 --- a/webrtc/tools/frame_analyzer/video_quality_analysis.cc +++ b/webrtc/rtc_tools/frame_analyzer/video_quality_analysis.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/frame_analyzer/video_quality_analysis.h" +#include "webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h" #include #include diff --git a/webrtc/tools/frame_analyzer/video_quality_analysis.h b/webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h similarity index 96% rename from webrtc/tools/frame_analyzer/video_quality_analysis.h rename to webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h index b72ad9ab21..8d03faecab 100644 --- a/webrtc/tools/frame_analyzer/video_quality_analysis.h +++ b/webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TOOLS_FRAME_ANALYZER_VIDEO_QUALITY_ANALYSIS_H_ -#define WEBRTC_TOOLS_FRAME_ANALYZER_VIDEO_QUALITY_ANALYSIS_H_ +#ifndef WEBRTC_RTC_TOOLS_FRAME_ANALYZER_VIDEO_QUALITY_ANALYSIS_H_ +#define WEBRTC_RTC_TOOLS_FRAME_ANALYZER_VIDEO_QUALITY_ANALYSIS_H_ #include #include @@ -147,4 +147,4 @@ bool ExtractFrameFromY4mFile(const char* i420_file_name, } // namespace test } // namespace webrtc -#endif // WEBRTC_TOOLS_FRAME_ANALYZER_VIDEO_QUALITY_ANALYSIS_H_ +#endif // WEBRTC_RTC_TOOLS_FRAME_ANALYZER_VIDEO_QUALITY_ANALYSIS_H_ diff --git a/webrtc/tools/frame_analyzer/video_quality_analysis_unittest.cc b/webrtc/rtc_tools/frame_analyzer/video_quality_analysis_unittest.cc similarity index 99% rename from webrtc/tools/frame_analyzer/video_quality_analysis_unittest.cc rename to webrtc/rtc_tools/frame_analyzer/video_quality_analysis_unittest.cc index aba849d2b3..bbaf5712f2 100644 --- a/webrtc/tools/frame_analyzer/video_quality_analysis_unittest.cc +++ b/webrtc/rtc_tools/frame_analyzer/video_quality_analysis_unittest.cc @@ -15,9 +15,9 @@ #include #include +#include "webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h" #include "webrtc/test/gtest.h" #include "webrtc/test/testsupport/fileutils.h" -#include "webrtc/tools/frame_analyzer/video_quality_analysis.h" namespace webrtc { namespace test { diff --git a/webrtc/tools/frame_editing/frame_editing.cc b/webrtc/rtc_tools/frame_editing/frame_editing.cc similarity index 97% rename from webrtc/tools/frame_editing/frame_editing.cc rename to webrtc/rtc_tools/frame_editing/frame_editing.cc index 015d5d99ae..9030674c01 100644 --- a/webrtc/tools/frame_editing/frame_editing.cc +++ b/webrtc/rtc_tools/frame_editing/frame_editing.cc @@ -8,13 +8,13 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/frame_editing/frame_editing_lib.h" +#include "webrtc/rtc_tools/frame_editing/frame_editing_lib.h" #include #include #include -#include "webrtc/tools/simple_command_line_parser.h" +#include "webrtc/rtc_tools/simple_command_line_parser.h" // A command-line tool to edit a YUV-video (I420 sub-sampled). int main(int argc, char** argv) { diff --git a/webrtc/tools/frame_editing/frame_editing_lib.cc b/webrtc/rtc_tools/frame_editing/frame_editing_lib.cc similarity index 97% rename from webrtc/tools/frame_editing/frame_editing_lib.cc rename to webrtc/rtc_tools/frame_editing/frame_editing_lib.cc index 175a6765bd..a20d8bbbeb 100644 --- a/webrtc/tools/frame_editing/frame_editing_lib.cc +++ b/webrtc/rtc_tools/frame_editing/frame_editing_lib.cc @@ -15,7 +15,7 @@ #include #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" -#include "webrtc/tools/frame_editing/frame_editing_lib.h" +#include "webrtc/rtc_tools/frame_editing/frame_editing_lib.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/tools/frame_editing/frame_editing_lib.h b/webrtc/rtc_tools/frame_editing/frame_editing_lib.h similarity index 89% rename from webrtc/tools/frame_editing/frame_editing_lib.h rename to webrtc/rtc_tools/frame_editing/frame_editing_lib.h index 94595c43bb..26435a34dd 100644 --- a/webrtc/tools/frame_editing/frame_editing_lib.h +++ b/webrtc/rtc_tools/frame_editing/frame_editing_lib.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_ -#define WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_ +#ifndef WEBRTC_RTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_ +#define WEBRTC_RTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_ #include @@ -36,4 +36,4 @@ int EditFrames(const std::string& in_path, int width, int height, int last_frame_to_process, const std::string& out_path); } // namespace webrtc -#endif // WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_ +#endif // WEBRTC_RTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_ diff --git a/webrtc/tools/frame_editing/frame_editing_unittest.cc b/webrtc/rtc_tools/frame_editing/frame_editing_unittest.cc similarity index 99% rename from webrtc/tools/frame_editing/frame_editing_unittest.cc rename to webrtc/rtc_tools/frame_editing/frame_editing_unittest.cc index 2e43545230..12d2d6c021 100644 --- a/webrtc/tools/frame_editing/frame_editing_unittest.cc +++ b/webrtc/rtc_tools/frame_editing/frame_editing_unittest.cc @@ -15,9 +15,9 @@ #include #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" +#include "webrtc/rtc_tools/frame_editing/frame_editing_lib.h" #include "webrtc/test/gtest.h" #include "webrtc/test/testsupport/fileutils.h" -#include "webrtc/tools/frame_editing/frame_editing_lib.h" namespace webrtc { namespace test { diff --git a/webrtc/tools/header_usage.sh b/webrtc/rtc_tools/header_usage.sh similarity index 100% rename from webrtc/tools/header_usage.sh rename to webrtc/rtc_tools/header_usage.sh diff --git a/webrtc/tools/loopback_test/OWNERS b/webrtc/rtc_tools/loopback_test/OWNERS similarity index 100% rename from webrtc/tools/loopback_test/OWNERS rename to webrtc/rtc_tools/loopback_test/OWNERS diff --git a/webrtc/tools/loopback_test/README b/webrtc/rtc_tools/loopback_test/README similarity index 100% rename from webrtc/tools/loopback_test/README rename to webrtc/rtc_tools/loopback_test/README diff --git a/webrtc/tools/loopback_test/adapter.js b/webrtc/rtc_tools/loopback_test/adapter.js similarity index 100% rename from webrtc/tools/loopback_test/adapter.js rename to webrtc/rtc_tools/loopback_test/adapter.js diff --git a/webrtc/tools/loopback_test/loopback_test.html b/webrtc/rtc_tools/loopback_test/loopback_test.html similarity index 100% rename from webrtc/tools/loopback_test/loopback_test.html rename to webrtc/rtc_tools/loopback_test/loopback_test.html diff --git a/webrtc/tools/loopback_test/loopback_test.js b/webrtc/rtc_tools/loopback_test/loopback_test.js similarity index 100% rename from webrtc/tools/loopback_test/loopback_test.js rename to webrtc/rtc_tools/loopback_test/loopback_test.js diff --git a/webrtc/tools/loopback_test/record-test.sh b/webrtc/rtc_tools/loopback_test/record-test.sh similarity index 100% rename from webrtc/tools/loopback_test/record-test.sh rename to webrtc/rtc_tools/loopback_test/record-test.sh diff --git a/webrtc/tools/loopback_test/run-server.sh b/webrtc/rtc_tools/loopback_test/run-server.sh similarity index 100% rename from webrtc/tools/loopback_test/run-server.sh rename to webrtc/rtc_tools/loopback_test/run-server.sh diff --git a/webrtc/tools/loopback_test/stat_tracker.js b/webrtc/rtc_tools/loopback_test/stat_tracker.js similarity index 100% rename from webrtc/tools/loopback_test/stat_tracker.js rename to webrtc/rtc_tools/loopback_test/stat_tracker.js diff --git a/webrtc/tools/network_tester/BUILD.gn b/webrtc/rtc_tools/network_tester/BUILD.gn similarity index 94% rename from webrtc/tools/network_tester/BUILD.gn rename to webrtc/rtc_tools/network_tester/BUILD.gn index 21b1cec995..bd069d6109 100644 --- a/webrtc/tools/network_tester/BUILD.gn +++ b/webrtc/rtc_tools/network_tester/BUILD.gn @@ -14,14 +14,14 @@ if (rtc_enable_protobuf) { sources = [ "network_tester_config.proto", ] - proto_out_dir = "webrtc/tools/network_tester" + proto_out_dir = "webrtc/rtc_tools/network_tester" } proto_library("network_tester_packet_proto") { sources = [ "network_tester_packet.proto", ] - proto_out_dir = "webrtc/tools/network_tester" + proto_out_dir = "webrtc/rtc_tools/network_tester" } rtc_static_library("network_tester") { @@ -75,7 +75,7 @@ if (rtc_enable_protobuf) { # gets additional generated targets which would require many lines here to # cover (which would be confusing to read and hard to maintain). if (!is_android && !is_ios) { - visibility = [ "//webrtc/tools:tools_unittests" ] + visibility = [ "//webrtc/rtc_tools:tools_unittests" ] } sources = [ "network_tester_unittest.cc", @@ -134,7 +134,7 @@ if (is_android) { "//webrtc/rtc_base:base_java", ] - shared_libraries = [ "//webrtc/tools/network_tester:network_tester_so" ] + shared_libraries = [ "//webrtc/rtc_tools/network_tester:network_tester_so" ] } android_library("NetworkTesterMobile_javalib") { diff --git a/webrtc/tools/network_tester/androidapp/AndroidManifest.xml b/webrtc/rtc_tools/network_tester/androidapp/AndroidManifest.xml similarity index 100% rename from webrtc/tools/network_tester/androidapp/AndroidManifest.xml rename to webrtc/rtc_tools/network_tester/androidapp/AndroidManifest.xml diff --git a/webrtc/tools/network_tester/androidapp/res/layout/activity_main.xml b/webrtc/rtc_tools/network_tester/androidapp/res/layout/activity_main.xml similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/layout/activity_main.xml rename to webrtc/rtc_tools/network_tester/androidapp/res/layout/activity_main.xml diff --git a/webrtc/tools/network_tester/androidapp/res/mipmap-hdpi/ic_launcher.png b/webrtc/rtc_tools/network_tester/androidapp/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/mipmap-hdpi/ic_launcher.png rename to webrtc/rtc_tools/network_tester/androidapp/res/mipmap-hdpi/ic_launcher.png diff --git a/webrtc/tools/network_tester/androidapp/res/mipmap-mdpi/ic_launcher.png b/webrtc/rtc_tools/network_tester/androidapp/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/mipmap-mdpi/ic_launcher.png rename to webrtc/rtc_tools/network_tester/androidapp/res/mipmap-mdpi/ic_launcher.png diff --git a/webrtc/tools/network_tester/androidapp/res/mipmap-xhdpi/ic_launcher.png b/webrtc/rtc_tools/network_tester/androidapp/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/mipmap-xhdpi/ic_launcher.png rename to webrtc/rtc_tools/network_tester/androidapp/res/mipmap-xhdpi/ic_launcher.png diff --git a/webrtc/tools/network_tester/androidapp/res/mipmap-xxhdpi/ic_launcher.png b/webrtc/rtc_tools/network_tester/androidapp/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/mipmap-xxhdpi/ic_launcher.png rename to webrtc/rtc_tools/network_tester/androidapp/res/mipmap-xxhdpi/ic_launcher.png diff --git a/webrtc/tools/network_tester/androidapp/res/mipmap-xxxhdpi/ic_launcher.png b/webrtc/rtc_tools/network_tester/androidapp/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/mipmap-xxxhdpi/ic_launcher.png rename to webrtc/rtc_tools/network_tester/androidapp/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/webrtc/tools/network_tester/androidapp/res/values-v17/styles.xml b/webrtc/rtc_tools/network_tester/androidapp/res/values-v17/styles.xml similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/values-v17/styles.xml rename to webrtc/rtc_tools/network_tester/androidapp/res/values-v17/styles.xml diff --git a/webrtc/tools/network_tester/androidapp/res/values-w820dp/dimens.xml b/webrtc/rtc_tools/network_tester/androidapp/res/values-w820dp/dimens.xml similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/values-w820dp/dimens.xml rename to webrtc/rtc_tools/network_tester/androidapp/res/values-w820dp/dimens.xml diff --git a/webrtc/tools/network_tester/androidapp/res/values/colors.xml b/webrtc/rtc_tools/network_tester/androidapp/res/values/colors.xml similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/values/colors.xml rename to webrtc/rtc_tools/network_tester/androidapp/res/values/colors.xml diff --git a/webrtc/tools/network_tester/androidapp/res/values/dimens.xml b/webrtc/rtc_tools/network_tester/androidapp/res/values/dimens.xml similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/values/dimens.xml rename to webrtc/rtc_tools/network_tester/androidapp/res/values/dimens.xml diff --git a/webrtc/tools/network_tester/androidapp/res/values/strings.xml b/webrtc/rtc_tools/network_tester/androidapp/res/values/strings.xml similarity index 100% rename from webrtc/tools/network_tester/androidapp/res/values/strings.xml rename to webrtc/rtc_tools/network_tester/androidapp/res/values/strings.xml diff --git a/webrtc/tools/network_tester/androidapp/src/com/google/media/networktester/MainActivity.java b/webrtc/rtc_tools/network_tester/androidapp/src/com/google/media/networktester/MainActivity.java similarity index 100% rename from webrtc/tools/network_tester/androidapp/src/com/google/media/networktester/MainActivity.java rename to webrtc/rtc_tools/network_tester/androidapp/src/com/google/media/networktester/MainActivity.java diff --git a/webrtc/tools/network_tester/androidapp/src/com/google/media/networktester/NetworkTester.java b/webrtc/rtc_tools/network_tester/androidapp/src/com/google/media/networktester/NetworkTester.java similarity index 100% rename from webrtc/tools/network_tester/androidapp/src/com/google/media/networktester/NetworkTester.java rename to webrtc/rtc_tools/network_tester/androidapp/src/com/google/media/networktester/NetworkTester.java diff --git a/webrtc/tools/network_tester/config_reader.cc b/webrtc/rtc_tools/network_tester/config_reader.cc similarity index 96% rename from webrtc/tools/network_tester/config_reader.cc rename to webrtc/rtc_tools/network_tester/config_reader.cc index 2718524d56..ccc4153404 100644 --- a/webrtc/tools/network_tester/config_reader.cc +++ b/webrtc/rtc_tools/network_tester/config_reader.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/network_tester/config_reader.h" +#include "webrtc/rtc_tools/network_tester/config_reader.h" #include #include diff --git a/webrtc/tools/network_tester/config_reader.h b/webrtc/rtc_tools/network_tester/config_reader.h similarity index 95% rename from webrtc/tools/network_tester/config_reader.h rename to webrtc/rtc_tools/network_tester/config_reader.h index 62e03da5b8..7d399f3106 100644 --- a/webrtc/tools/network_tester/config_reader.h +++ b/webrtc/rtc_tools/network_tester/config_reader.h @@ -21,7 +21,7 @@ #ifdef WEBRTC_NETWORK_TESTER_PROTO RTC_PUSH_IGNORING_WUNDEF() -#include "webrtc/tools/network_tester/network_tester_config.pb.h" +#include "webrtc/rtc_tools/network_tester/network_tester_config.pb.h" RTC_POP_IGNORING_WUNDEF() using webrtc::network_tester::config::NetworkTesterAllConfigs; #else diff --git a/webrtc/tools/network_tester/create_network_tester_config.py b/webrtc/rtc_tools/network_tester/create_network_tester_config.py similarity index 100% rename from webrtc/tools/network_tester/create_network_tester_config.py rename to webrtc/rtc_tools/network_tester/create_network_tester_config.py diff --git a/webrtc/tools/network_tester/jni.cpp b/webrtc/rtc_tools/network_tester/jni.cpp similarity index 96% rename from webrtc/tools/network_tester/jni.cpp rename to webrtc/rtc_tools/network_tester/jni.cpp index 469a1c98ce..b849afbbb8 100644 --- a/webrtc/tools/network_tester/jni.cpp +++ b/webrtc/rtc_tools/network_tester/jni.cpp @@ -13,7 +13,7 @@ #define JNIEXPORT __attribute__((visibility("default"))) #include -#include "webrtc/tools/network_tester/test_controller.h" +#include "webrtc/rtc_tools/network_tester/test_controller.h" extern "C" JNIEXPORT jlong JNICALL Java_com_google_media_networktester_NetworkTester_CreateTestController( diff --git a/webrtc/tools/network_tester/network_tester_config.proto b/webrtc/rtc_tools/network_tester/network_tester_config.proto similarity index 100% rename from webrtc/tools/network_tester/network_tester_config.proto rename to webrtc/rtc_tools/network_tester/network_tester_config.proto diff --git a/webrtc/tools/network_tester/network_tester_packet.proto b/webrtc/rtc_tools/network_tester/network_tester_packet.proto similarity index 100% rename from webrtc/tools/network_tester/network_tester_packet.proto rename to webrtc/rtc_tools/network_tester/network_tester_packet.proto diff --git a/webrtc/tools/network_tester/network_tester_unittest.cc b/webrtc/rtc_tools/network_tester/network_tester_unittest.cc similarity index 94% rename from webrtc/tools/network_tester/network_tester_unittest.cc rename to webrtc/rtc_tools/network_tester/network_tester_unittest.cc index fbb1bdb555..6c86a01318 100644 --- a/webrtc/tools/network_tester/network_tester_unittest.cc +++ b/webrtc/rtc_tools/network_tester/network_tester_unittest.cc @@ -11,7 +11,7 @@ #ifdef WEBRTC_NETWORK_TESTER_TEST_ENABLED -#include "webrtc/tools/network_tester/test_controller.h" +#include "webrtc/rtc_tools/network_tester/test_controller.h" #include "webrtc/base/gunit.h" #include "webrtc/test/gtest.h" diff --git a/webrtc/tools/network_tester/packet_logger.cc b/webrtc/rtc_tools/network_tester/packet_logger.cc similarity index 96% rename from webrtc/tools/network_tester/packet_logger.cc rename to webrtc/rtc_tools/network_tester/packet_logger.cc index d51c1b130a..5a32bea54f 100644 --- a/webrtc/tools/network_tester/packet_logger.cc +++ b/webrtc/rtc_tools/network_tester/packet_logger.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/network_tester/packet_logger.h" +#include "webrtc/rtc_tools/network_tester/packet_logger.h" #include "webrtc/base/checks.h" #include "webrtc/base/protobuf_utils.h" diff --git a/webrtc/tools/network_tester/packet_logger.h b/webrtc/rtc_tools/network_tester/packet_logger.h similarity index 94% rename from webrtc/tools/network_tester/packet_logger.h rename to webrtc/rtc_tools/network_tester/packet_logger.h index 35d6721903..8f8f767724 100644 --- a/webrtc/tools/network_tester/packet_logger.h +++ b/webrtc/rtc_tools/network_tester/packet_logger.h @@ -19,7 +19,7 @@ #ifdef WEBRTC_NETWORK_TESTER_PROTO RTC_PUSH_IGNORING_WUNDEF() -#include "webrtc/tools/network_tester/network_tester_packet.pb.h" +#include "webrtc/rtc_tools/network_tester/network_tester_packet.pb.h" RTC_POP_IGNORING_WUNDEF() using webrtc::network_tester::packet::NetworkTesterPacket; #else diff --git a/webrtc/tools/network_tester/packet_sender.cc b/webrtc/rtc_tools/network_tester/packet_sender.cc similarity index 95% rename from webrtc/tools/network_tester/packet_sender.cc rename to webrtc/rtc_tools/network_tester/packet_sender.cc index 6bd4dd075c..ca5b8e9df2 100644 --- a/webrtc/tools/network_tester/packet_sender.cc +++ b/webrtc/rtc_tools/network_tester/packet_sender.cc @@ -8,15 +8,15 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/network_tester/packet_sender.h" +#include "webrtc/rtc_tools/network_tester/packet_sender.h" #include #include #include #include "webrtc/base/timeutils.h" -#include "webrtc/tools/network_tester/config_reader.h" -#include "webrtc/tools/network_tester/test_controller.h" +#include "webrtc/rtc_tools/network_tester/config_reader.h" +#include "webrtc/rtc_tools/network_tester/test_controller.h" namespace webrtc { diff --git a/webrtc/tools/network_tester/packet_sender.h b/webrtc/rtc_tools/network_tester/packet_sender.h similarity index 96% rename from webrtc/tools/network_tester/packet_sender.h rename to webrtc/rtc_tools/network_tester/packet_sender.h index 0f1ae26161..8c4e988ac8 100644 --- a/webrtc/tools/network_tester/packet_sender.h +++ b/webrtc/rtc_tools/network_tester/packet_sender.h @@ -21,7 +21,7 @@ #ifdef WEBRTC_NETWORK_TESTER_PROTO RTC_PUSH_IGNORING_WUNDEF() -#include "webrtc/tools/network_tester/network_tester_packet.pb.h" +#include "webrtc/rtc_tools/network_tester/network_tester_packet.pb.h" RTC_POP_IGNORING_WUNDEF() using webrtc::network_tester::packet::NetworkTesterPacket; #else diff --git a/webrtc/tools/network_tester/parse_packet_log.py b/webrtc/rtc_tools/network_tester/parse_packet_log.py similarity index 99% rename from webrtc/tools/network_tester/parse_packet_log.py rename to webrtc/rtc_tools/network_tester/parse_packet_log.py index 3b263e0d67..98fd0f6964 100755 --- a/webrtc/tools/network_tester/parse_packet_log.py +++ b/webrtc/rtc_tools/network_tester/parse_packet_log.py @@ -6,7 +6,7 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -# To run this script please copy "out//pyproto/webrtc/tools/ +# To run this script please copy "out//pyproto/webrtc/rtc_tools/ # network_tester/network_tester_packet_pb2.py" next to this script. # The you can run this script with: # "python parse_packet_log.py -f packet_log.dat" diff --git a/webrtc/tools/network_tester/server.cc b/webrtc/rtc_tools/network_tester/server.cc similarity index 90% rename from webrtc/tools/network_tester/server.cc rename to webrtc/rtc_tools/network_tester/server.cc index 0983f1e169..c358f39e49 100644 --- a/webrtc/tools/network_tester/server.cc +++ b/webrtc/rtc_tools/network_tester/server.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/network_tester/test_controller.h" +#include "webrtc/rtc_tools/network_tester/test_controller.h" int main() { webrtc::TestController server(9090, 9090, "server_config.dat", diff --git a/webrtc/tools/network_tester/test_controller.cc b/webrtc/rtc_tools/network_tester/test_controller.cc similarity index 98% rename from webrtc/tools/network_tester/test_controller.cc rename to webrtc/rtc_tools/network_tester/test_controller.cc index 40af6437cb..45b1de236e 100644 --- a/webrtc/tools/network_tester/test_controller.cc +++ b/webrtc/rtc_tools/network_tester/test_controller.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/network_tester/test_controller.h" +#include "webrtc/rtc_tools/network_tester/test_controller.h" namespace webrtc { diff --git a/webrtc/tools/network_tester/test_controller.h b/webrtc/rtc_tools/network_tester/test_controller.h similarity index 92% rename from webrtc/tools/network_tester/test_controller.h rename to webrtc/rtc_tools/network_tester/test_controller.h index d8f3463766..16087404b1 100644 --- a/webrtc/tools/network_tester/test_controller.h +++ b/webrtc/rtc_tools/network_tester/test_controller.h @@ -21,12 +21,12 @@ #include "webrtc/base/ignore_wundef.h" #include "webrtc/p2p/base/basicpacketsocketfactory.h" #include "webrtc/p2p/base/udptransport.h" -#include "webrtc/tools/network_tester/packet_logger.h" -#include "webrtc/tools/network_tester/packet_sender.h" +#include "webrtc/rtc_tools/network_tester/packet_logger.h" +#include "webrtc/rtc_tools/network_tester/packet_sender.h" #ifdef WEBRTC_NETWORK_TESTER_PROTO RTC_PUSH_IGNORING_WUNDEF() -#include "webrtc/tools/network_tester/network_tester_packet.pb.h" +#include "webrtc/rtc_tools/network_tester/network_tester_packet.pb.h" RTC_POP_IGNORING_WUNDEF() using webrtc::network_tester::packet::NetworkTesterPacket; #else diff --git a/webrtc/tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc b/webrtc/rtc_tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc similarity index 97% rename from webrtc/tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc rename to webrtc/rtc_tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc index 737661c3df..b20875ad51 100644 --- a/webrtc/tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc +++ b/webrtc/rtc_tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc @@ -16,8 +16,8 @@ #include #include -#include "webrtc/tools/frame_analyzer/video_quality_analysis.h" -#include "webrtc/tools/simple_command_line_parser.h" +#include "webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h" +#include "webrtc/rtc_tools/simple_command_line_parser.h" #define MAX_NUM_FRAMES_PER_FILE INT_MAX diff --git a/webrtc/tools/py_event_log_analyzer/README b/webrtc/rtc_tools/py_event_log_analyzer/README similarity index 100% rename from webrtc/tools/py_event_log_analyzer/README rename to webrtc/rtc_tools/py_event_log_analyzer/README diff --git a/webrtc/tools/py_event_log_analyzer/misc.py b/webrtc/rtc_tools/py_event_log_analyzer/misc.py similarity index 100% rename from webrtc/tools/py_event_log_analyzer/misc.py rename to webrtc/rtc_tools/py_event_log_analyzer/misc.py diff --git a/webrtc/tools/py_event_log_analyzer/misc_test.py b/webrtc/rtc_tools/py_event_log_analyzer/misc_test.py similarity index 100% rename from webrtc/tools/py_event_log_analyzer/misc_test.py rename to webrtc/rtc_tools/py_event_log_analyzer/misc_test.py diff --git a/webrtc/tools/py_event_log_analyzer/pb_parse.py b/webrtc/rtc_tools/py_event_log_analyzer/pb_parse.py similarity index 100% rename from webrtc/tools/py_event_log_analyzer/pb_parse.py rename to webrtc/rtc_tools/py_event_log_analyzer/pb_parse.py diff --git a/webrtc/tools/py_event_log_analyzer/rtp_analyzer.py b/webrtc/rtc_tools/py_event_log_analyzer/rtp_analyzer.py similarity index 100% rename from webrtc/tools/py_event_log_analyzer/rtp_analyzer.py rename to webrtc/rtc_tools/py_event_log_analyzer/rtp_analyzer.py diff --git a/webrtc/tools/py_event_log_analyzer/rtp_analyzer.sh b/webrtc/rtc_tools/py_event_log_analyzer/rtp_analyzer.sh similarity index 100% rename from webrtc/tools/py_event_log_analyzer/rtp_analyzer.sh rename to webrtc/rtc_tools/py_event_log_analyzer/rtp_analyzer.sh diff --git a/webrtc/tools/py_event_log_analyzer/rtp_analyzer_test.py b/webrtc/rtc_tools/py_event_log_analyzer/rtp_analyzer_test.py similarity index 100% rename from webrtc/tools/py_event_log_analyzer/rtp_analyzer_test.py rename to webrtc/rtc_tools/py_event_log_analyzer/rtp_analyzer_test.py diff --git a/webrtc/tools/rtcbot/OWNERS b/webrtc/rtc_tools/rtcbot/OWNERS similarity index 100% rename from webrtc/tools/rtcbot/OWNERS rename to webrtc/rtc_tools/rtcbot/OWNERS diff --git a/webrtc/tools/rtcbot/README b/webrtc/rtc_tools/rtcbot/README similarity index 100% rename from webrtc/tools/rtcbot/README rename to webrtc/rtc_tools/rtcbot/README diff --git a/webrtc/tools/rtcbot/bot/api.js b/webrtc/rtc_tools/rtcbot/bot/api.js similarity index 100% rename from webrtc/tools/rtcbot/bot/api.js rename to webrtc/rtc_tools/rtcbot/bot/api.js diff --git a/webrtc/tools/rtcbot/bot/browser/bot.js b/webrtc/rtc_tools/rtcbot/bot/browser/bot.js similarity index 100% rename from webrtc/tools/rtcbot/bot/browser/bot.js rename to webrtc/rtc_tools/rtcbot/bot/browser/bot.js diff --git a/webrtc/tools/rtcbot/bot/browser/index.html b/webrtc/rtc_tools/rtcbot/bot/browser/index.html similarity index 100% rename from webrtc/tools/rtcbot/bot/browser/index.html rename to webrtc/rtc_tools/rtcbot/bot/browser/index.html diff --git a/webrtc/tools/rtcbot/botmanager.js b/webrtc/rtc_tools/rtcbot/botmanager.js similarity index 100% rename from webrtc/tools/rtcbot/botmanager.js rename to webrtc/rtc_tools/rtcbot/botmanager.js diff --git a/webrtc/tools/rtcbot/main.js b/webrtc/rtc_tools/rtcbot/main.js similarity index 100% rename from webrtc/tools/rtcbot/main.js rename to webrtc/rtc_tools/rtcbot/main.js diff --git a/webrtc/tools/rtcbot/rtcBotReportVisualizer/index.html b/webrtc/rtc_tools/rtcbot/rtcBotReportVisualizer/index.html similarity index 100% rename from webrtc/tools/rtcbot/rtcBotReportVisualizer/index.html rename to webrtc/rtc_tools/rtcbot/rtcBotReportVisualizer/index.html diff --git a/webrtc/tools/rtcbot/rtcBotReportVisualizer/main.js b/webrtc/rtc_tools/rtcbot/rtcBotReportVisualizer/main.js similarity index 100% rename from webrtc/tools/rtcbot/rtcBotReportVisualizer/main.js rename to webrtc/rtc_tools/rtcbot/rtcBotReportVisualizer/main.js diff --git a/webrtc/tools/rtcbot/test.js b/webrtc/rtc_tools/rtcbot/test.js similarity index 100% rename from webrtc/tools/rtcbot/test.js rename to webrtc/rtc_tools/rtcbot/test.js diff --git a/webrtc/tools/rtcbot/test/oneWayVideoStreamingWithDownloadingFile.js b/webrtc/rtc_tools/rtcbot/test/oneWayVideoStreamingWithDownloadingFile.js similarity index 100% rename from webrtc/tools/rtcbot/test/oneWayVideoStreamingWithDownloadingFile.js rename to webrtc/rtc_tools/rtcbot/test/oneWayVideoStreamingWithDownloadingFile.js diff --git a/webrtc/tools/rtcbot/test/ping_pong.js b/webrtc/rtc_tools/rtcbot/test/ping_pong.js similarity index 100% rename from webrtc/tools/rtcbot/test/ping_pong.js rename to webrtc/rtc_tools/rtcbot/test/ping_pong.js diff --git a/webrtc/tools/rtcbot/test/simple_offer_answer.js b/webrtc/rtc_tools/rtcbot/test/simple_offer_answer.js similarity index 100% rename from webrtc/tools/rtcbot/test/simple_offer_answer.js rename to webrtc/rtc_tools/rtcbot/test/simple_offer_answer.js diff --git a/webrtc/tools/rtcbot/test/three_bots_video_conference.js b/webrtc/rtc_tools/rtcbot/test/three_bots_video_conference.js similarity index 100% rename from webrtc/tools/rtcbot/test/three_bots_video_conference.js rename to webrtc/rtc_tools/rtcbot/test/three_bots_video_conference.js diff --git a/webrtc/tools/rtcbot/test/two_way_video_streaming.js b/webrtc/rtc_tools/rtcbot/test/two_way_video_streaming.js similarity index 100% rename from webrtc/tools/rtcbot/test/two_way_video_streaming.js rename to webrtc/rtc_tools/rtcbot/test/two_way_video_streaming.js diff --git a/webrtc/tools/rtcbot/test/webrtc_video_streaming.js b/webrtc/rtc_tools/rtcbot/test/webrtc_video_streaming.js similarity index 100% rename from webrtc/tools/rtcbot/test/webrtc_video_streaming.js rename to webrtc/rtc_tools/rtcbot/test/webrtc_video_streaming.js diff --git a/webrtc/tools/simple_command_line_parser.cc b/webrtc/rtc_tools/simple_command_line_parser.cc similarity index 98% rename from webrtc/tools/simple_command_line_parser.cc rename to webrtc/rtc_tools/simple_command_line_parser.cc index 863e7a904d..fae02ae246 100644 --- a/webrtc/tools/simple_command_line_parser.cc +++ b/webrtc/rtc_tools/simple_command_line_parser.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/tools/simple_command_line_parser.h" +#include "webrtc/rtc_tools/simple_command_line_parser.h" #include #include diff --git a/webrtc/tools/simple_command_line_parser.h b/webrtc/rtc_tools/simple_command_line_parser.h similarity index 100% rename from webrtc/tools/simple_command_line_parser.h rename to webrtc/rtc_tools/simple_command_line_parser.h diff --git a/webrtc/tools/simple_command_line_parser_unittest.cc b/webrtc/rtc_tools/simple_command_line_parser_unittest.cc similarity index 98% rename from webrtc/tools/simple_command_line_parser_unittest.cc rename to webrtc/rtc_tools/simple_command_line_parser_unittest.cc index 739ce83ae1..c71b472492 100644 --- a/webrtc/tools/simple_command_line_parser_unittest.cc +++ b/webrtc/rtc_tools/simple_command_line_parser_unittest.cc @@ -9,7 +9,7 @@ */ #include "webrtc/test/gtest.h" -#include "webrtc/tools/simple_command_line_parser.h" +#include "webrtc/rtc_tools/simple_command_line_parser.h" namespace webrtc { namespace test { diff --git a/webrtc/tools/testing/README.md b/webrtc/rtc_tools/testing/README.md similarity index 90% rename from webrtc/tools/testing/README.md rename to webrtc/rtc_tools/testing/README.md index 9068b5bfd3..7d5c774cf0 100644 --- a/webrtc/tools/testing/README.md +++ b/webrtc/rtc_tools/testing/README.md @@ -20,7 +20,7 @@ Updating prebuilt_apprtc.zip: - Remove unneeded files: - `rm -rf .git node_modules browsers` - `zip -r prebuilt_apprtc.zip apprtc/` -- `mv prebuilt_apprtc.zip webrtc/src/webrtc/tools/testing/prebuilt_apprtc.zip` +- `mv prebuilt_apprtc.zip webrtc/src/webrtc/rtc_tools/testing/prebuilt_apprtc.zip` Updating golang/*: @@ -32,7 +32,7 @@ Updating golang/*: After updating the archives: -- `cd webrtc/src/webrtc/tools/testing` +- `cd webrtc/src/webrtc/rtc_tools/testing` - For each updated archive: - `upload_to_google_storage.py file.zip --bucket=chromium-webrtc-resources` - `git commit -a && git cl upload` diff --git a/webrtc/tools/testing/build_apprtc.py b/webrtc/rtc_tools/testing/build_apprtc.py similarity index 100% rename from webrtc/tools/testing/build_apprtc.py rename to webrtc/rtc_tools/testing/build_apprtc.py diff --git a/webrtc/tools/testing/download_apprtc.py b/webrtc/rtc_tools/testing/download_apprtc.py similarity index 100% rename from webrtc/tools/testing/download_apprtc.py rename to webrtc/rtc_tools/testing/download_apprtc.py diff --git a/webrtc/tools/testing/golang/linux/go.tar.gz.sha1 b/webrtc/rtc_tools/testing/golang/linux/go.tar.gz.sha1 similarity index 100% rename from webrtc/tools/testing/golang/linux/go.tar.gz.sha1 rename to webrtc/rtc_tools/testing/golang/linux/go.tar.gz.sha1 diff --git a/webrtc/tools/testing/golang/mac/go.tar.gz.sha1 b/webrtc/rtc_tools/testing/golang/mac/go.tar.gz.sha1 similarity index 100% rename from webrtc/tools/testing/golang/mac/go.tar.gz.sha1 rename to webrtc/rtc_tools/testing/golang/mac/go.tar.gz.sha1 diff --git a/webrtc/tools/testing/golang/win/go.zip.sha1 b/webrtc/rtc_tools/testing/golang/win/go.zip.sha1 similarity index 100% rename from webrtc/tools/testing/golang/win/go.zip.sha1 rename to webrtc/rtc_tools/testing/golang/win/go.zip.sha1 diff --git a/webrtc/tools/testing/prebuilt_apprtc.zip.sha1 b/webrtc/rtc_tools/testing/prebuilt_apprtc.zip.sha1 similarity index 100% rename from webrtc/tools/testing/prebuilt_apprtc.zip.sha1 rename to webrtc/rtc_tools/testing/prebuilt_apprtc.zip.sha1 diff --git a/webrtc/tools/testing/setup_apprtc.py b/webrtc/rtc_tools/testing/setup_apprtc.py similarity index 100% rename from webrtc/tools/testing/setup_apprtc.py rename to webrtc/rtc_tools/testing/setup_apprtc.py diff --git a/webrtc/tools/testing/utils.py b/webrtc/rtc_tools/testing/utils.py similarity index 100% rename from webrtc/tools/testing/utils.py rename to webrtc/rtc_tools/testing/utils.py diff --git a/webrtc/tools/video_analysis.py b/webrtc/rtc_tools/video_analysis.py similarity index 99% rename from webrtc/tools/video_analysis.py rename to webrtc/rtc_tools/video_analysis.py index 4bc45ffdff..885c2f542b 100755 --- a/webrtc/tools/video_analysis.py +++ b/webrtc/rtc_tools/video_analysis.py @@ -408,7 +408,7 @@ def FlipAndCropRecordings(options, test_file_name, test_file_location, def CompareVideos(options, cropped_ref_file, cropped_test_file): - """Runs the compare_video.py script from src/webrtc/tools using the file path. + """Runs the compare_video.py script from src/webrtc/rtc_tools using the file path. Uses the path from recording_result and writes the output to a file named in the reference video diff --git a/webrtc/tools/video_analysis_test.py b/webrtc/rtc_tools/video_analysis_test.py similarity index 100% rename from webrtc/tools/video_analysis_test.py rename to webrtc/rtc_tools/video_analysis_test.py diff --git a/webrtc/tools/BUILD.gn b/webrtc/tools/BUILD.gn index ff45daf09c..35e4669166 100644 --- a/webrtc/tools/BUILD.gn +++ b/webrtc/tools/BUILD.gn @@ -6,7 +6,7 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -import("//third_party/protobuf/proto_library.gni") +# TODO(kjellander): Remove when bugs.webrtc.org/7855 is completed. import("../webrtc.gni") group("tools") { @@ -14,337 +14,58 @@ group("tools") { testonly = true public_deps = [ - ":command_line_parser", - ":frame_analyzer", - ":frame_editor", - ":psnr_ssim_analyzer", - ":rgba_to_i420_converter", - ] - if (rtc_include_internal_audio_device) { - public_deps += [ ":force_mic_volume_max" ] - } - if (rtc_enable_protobuf) { - public_deps += [ ":chart_proto" ] - } - - if (rtc_include_tests) { - public_deps += [ - ":activity_metric", - ":tools_unittests", - ] - if (rtc_enable_protobuf) { - public_deps += [ - ":event_log_visualizer", - ":rtp_analyzer", - "network_tester", - ] - } - } -} - -rtc_static_library("command_line_parser") { - sources = [ - "simple_command_line_parser.cc", - "simple_command_line_parser.h", - ] - deps = [ - "../base:gtest_prod", - "../base:rtc_base_approved", + "../rtc_tools", ] } -rtc_static_library("video_quality_analysis") { - sources = [ - "frame_analyzer/video_quality_analysis.cc", - "frame_analyzer/video_quality_analysis.h", - ] - - deps = [ - "../common_video", - ] - public_deps = [ - "../common_video", - ] +group("command_line_parser") { + public_deps = [ "../rtc_tools:command_line_parser" ] } -rtc_executable("frame_analyzer") { - sources = [ - "frame_analyzer/frame_analyzer.cc", - ] - - deps = [ - ":command_line_parser", - ":video_quality_analysis", - "//build/win:default_exe_manifest", - ] +group("video_quality_analysis") { + public_deps = [ "../rtc_tools:video_quality_analysis" ] } -rtc_executable("psnr_ssim_analyzer") { - sources = [ - "psnr_ssim_analyzer/psnr_ssim_analyzer.cc", - ] - - deps = [ - ":command_line_parser", - ":video_quality_analysis", - "//build/win:default_exe_manifest", - ] +group("frame_analyzer") { + public_deps = [ "../rtc_tools:frame_analyzer" ] } -rtc_static_library("reference_less_video_analysis_lib") { - sources = [ - "frame_analyzer/reference_less_video_analysis_lib.cc", - "frame_analyzer/reference_less_video_analysis_lib.h", - ] - - deps = [ - ":video_quality_analysis", - ] +group("psnr_ssim_analyzer") { + public_deps = [ "../rtc_tools:psnr_ssim_analyzer" ] } -rtc_executable("reference_less_video_analysis") { - sources = [ - "frame_analyzer/reference_less_video_analysis.cc", - ] - - deps = [ - ":command_line_parser", - ":reference_less_video_analysis_lib", - "//build/win:default_exe_manifest", - ] +group("reference_less_video_analysis_lib") { + public_deps = [ "../rtc_tools:reference_less_video_analysis_lib" ] } -rtc_executable("rgba_to_i420_converter") { - sources = [ - "converter/converter.cc", - "converter/converter.h", - "converter/rgba_to_i420_converter.cc", - ] - - deps = [ - ":command_line_parser", - "../common_video", - "//build/win:default_exe_manifest", - ] +group("reference_less_video_analysis") { + public_deps = [ "../rtc_tools:reference_less_video_analysis" ] } -rtc_static_library("frame_editing_lib") { - sources = [ - "frame_editing/frame_editing_lib.cc", - "frame_editing/frame_editing_lib.h", - ] - - # TODO(jschuh): Bug 1348: fix this warning. - configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - - deps = [ - "..:webrtc_common", - "../common_video", - ] +group("rgba_to_i420_converter") { + public_deps = [ "../rtc_tools:rgba_to_i420_converter" ] } -rtc_executable("frame_editor") { - sources = [ - "frame_editing/frame_editing.cc", - ] - - deps = [ - ":command_line_parser", - ":frame_editing_lib", - "//build/win:default_exe_manifest", - ] +group("frame_editing_lib") { + public_deps = [ "../rtc_tools:frame_editing_lib" ] +} + +group("frame_editor") { + public_deps = [ "../rtc_tools:frame_editor" ] } -# It doesn't make sense to build this tool without the ADM enabled. if (rtc_include_internal_audio_device) { - rtc_executable("force_mic_volume_max") { - sources = [ - "force_mic_volume_max/force_mic_volume_max.cc", - ] - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - - deps = [ - "../modules/audio_device", - "../system_wrappers:system_wrappers_default", - "//build/win:default_exe_manifest", - ] + group("force_mic_volume_max") { + public_deps = [ "../rtc_tools:force_mic_volume_max" ] + } } -} if (rtc_enable_protobuf) { - proto_library("chart_proto") { - sources = [ - "event_log_visualizer/chart.proto", - ] - proto_out_dir = "webrtc/tools/event_log_visualizer" + group("chart_proto") { + public_deps = [ "../rtc_tools:chart_proto" ] } - rtc_static_library("event_log_visualizer_utils") { - sources = [ - "event_log_visualizer/analyzer.cc", - "event_log_visualizer/analyzer.h", - "event_log_visualizer/plot_base.cc", - "event_log_visualizer/plot_base.h", - "event_log_visualizer/plot_protobuf.cc", - "event_log_visualizer/plot_protobuf.h", - "event_log_visualizer/plot_python.cc", - "event_log_visualizer/plot_python.h", - ] - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - defines = [ "ENABLE_RTC_EVENT_LOG" ] - deps = [ - "..:video_stream_api", - "../base:rtc_base_approved", - "../call:call_interfaces", - "../logging:rtc_event_log_impl", - "../logging:rtc_event_log_parser", - "../modules:module_api", - "../modules/audio_coding:ana_debug_dump_proto", - "../modules/audio_coding:neteq_tools", - - # TODO(kwiberg): Remove this dependency. - "../api/audio_codecs:audio_codecs_api", - "../modules/congestion_controller", - "../modules/rtp_rtcp", - "../system_wrappers:system_wrappers_default", - "//build/config:exe_and_shlib_deps", - ] - public_deps = [ - ":chart_proto", - "../logging:rtc_event_log_parser", - ] - } -} - -# Exclude tools depending on gflags since that's not available in Chromium. -if (rtc_include_tests) { - if (rtc_enable_protobuf) { - rtc_executable("event_log_visualizer") { - testonly = true - sources = [ - "event_log_visualizer/main.cc", - ] - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - - defines = [ "ENABLE_RTC_EVENT_LOG" ] - deps = [ - ":event_log_visualizer_utils", - "../base:rtc_base_approved", - "../test:field_trial", - "../test:test_support", - ] - } - } - - rtc_executable("activity_metric") { - testonly = true - sources = [ - "agc/activity_metric.cc", - ] - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - - deps = [ - "../base:rtc_base_approved", - "../modules:module_api", - "../modules/audio_processing", - "../system_wrappers:metrics_default", - "../test:test_support", - "//build/win:default_exe_manifest", - "//testing/gtest", - ] - } - - tools_unittests_resources = [ - "//resources/foreman_cif.yuv", - "//resources/reference_less_video_test_file.y4m", - "//resources/video_quality_analysis_frame.txt", - ] - - if (is_ios) { - bundle_data("tools_unittests_bundle_data") { - testonly = true - sources = tools_unittests_resources - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", - ] - } - } - - rtc_test("tools_unittests") { - testonly = true - - sources = [ - "frame_analyzer/reference_less_video_analysis_unittest.cc", - "frame_analyzer/video_quality_analysis_unittest.cc", - "frame_editing/frame_editing_unittest.cc", - "simple_command_line_parser_unittest.cc", - ] - - # TODO(jschuh): Bug 1348: fix this warning. - configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - - deps = [ - ":command_line_parser", - ":frame_editing_lib", - ":reference_less_video_analysis_lib", - ":video_quality_analysis", - "../test:test_main", - "//testing/gtest", - ] - - if (rtc_enable_protobuf) { - deps += [ "network_tester:network_tester_unittests" ] - } - - data = tools_unittests_resources - if (is_android) { - deps += [ "//testing/android/native_test:native_test_support" ] - shard_timeout = 900 - } - if (is_ios) { - deps += [ ":tools_unittests_bundle_data" ] - } - } - - if (rtc_enable_protobuf) { - copy("rtp_analyzer") { - sources = [ - "py_event_log_analyzer/misc.py", - "py_event_log_analyzer/pb_parse.py", - "py_event_log_analyzer/rtp_analyzer.py", - "py_event_log_analyzer/rtp_analyzer.sh", - ] - outputs = [ - "$root_build_dir/{{source_file_part}}", - ] - deps = [ - "../logging:rtc_event_log_proto", - ] - } + group("event_log_visualizer_utils") { + public_deps = [ "../rtc_tools:event_log_visualizer_utils" ] } } diff --git a/webrtc/tools/compare_videos.py b/webrtc/tools/compare_videos.py index c4a70c20fe..fcfbc38240 100755 --- a/webrtc/tools/compare_videos.py +++ b/webrtc/tools/compare_videos.py @@ -7,168 +7,12 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -import optparse import os -import shutil -import subprocess -import sys -import tempfile +# This is just a forwarding script during the transition of renaming tools to +# rtc_tools. To avoid breaking Chromium tests. SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) - -# Chrome browsertests will throw away stderr; avoid that output gets lost. -sys.stderr = sys.stdout - - -def _ParseArgs(): - """Registers the command-line options.""" - usage = 'usage: %prog [options]' - parser = optparse.OptionParser(usage=usage) - - parser.add_option('--label', type='string', default='MY_TEST', - help=('Label of the test, used to identify different ' - 'tests. Default: %default')) - parser.add_option('--ref_video', type='string', - help='Reference video to compare with (YUV).') - parser.add_option('--test_video', type='string', - help=('Test video to be compared with the reference ' - 'video (YUV).')) - parser.add_option('--frame_analyzer', type='string', - help='Path to the frame analyzer executable.') - parser.add_option('--barcode_decoder', type='string', - help=('Path to the barcode decoder script. By default, we ' - 'will assume we can find it in barcode_tools/' - 'relative to this directory.')) - parser.add_option('--ffmpeg_path', type='string', - help=('The path to where the ffmpeg executable is located. ' - 'If omitted, it will be assumed to be present in the ' - 'PATH with the name ffmpeg[.exe].')) - parser.add_option('--zxing_path', type='string', - help=('The path to where the zxing executable is located. ' - 'If omitted, it will be assumed to be present in the ' - 'PATH with the name zxing[.exe].')) - parser.add_option('--stats_file_ref', type='string', default='stats_ref.txt', - help=('Path to the temporary stats file to be created and ' - 'used for the reference video file. ' - 'Default: %default')) - parser.add_option('--stats_file_test', type='string', - default='stats_test.txt', - help=('Path to the temporary stats file to be created and ' - 'used for the test video file. Default: %default')) - parser.add_option('--stats_file', type='string', - help=('DEPRECATED')) - parser.add_option('--yuv_frame_width', type='int', default=640, - 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, _ = parser.parse_args() - - if options.stats_file: - options.stats_file_test = options.stats_file - print ('WARNING: Using deprecated switch --stats_file. ' - 'The new flag is --stats_file_test.') - - if not options.ref_video: - parser.error('You must provide a path to the reference video!') - if not os.path.exists(options.ref_video): - parser.error('Cannot find the reference video at %s' % options.ref_video) - - if not options.test_video: - parser.error('You must provide a path to the test video!') - if not os.path.exists(options.test_video): - parser.error('Cannot find the test video at %s' % options.test_video) - - if not options.frame_analyzer: - parser.error('You must provide the path to the frame analyzer executable!') - if not os.path.exists(options.frame_analyzer): - parser.error('Cannot find frame analyzer executable at %s!' % - options.frame_analyzer) - return options - -def _DevNull(): - """On Windows, sometimes the inherited stdin handle from the parent process - fails. Workaround this by passing null to stdin to the subprocesses commands. - This function can be used to create the null file handler. - """ - return open(os.devnull, 'r') - -def DecodeBarcodesInVideo(options, path_to_decoder, video, stat_file): - # Run barcode decoder on the test video to identify frame numbers. - png_working_directory = tempfile.mkdtemp() - cmd = [ - sys.executable, - path_to_decoder, - '--yuv_file=%s' % video, - '--yuv_frame_width=%d' % options.yuv_frame_width, - '--yuv_frame_height=%d' % options.yuv_frame_height, - '--stats_file=%s' % stat_file, - '--png_working_dir=%s' % png_working_directory, - ] - if options.zxing_path: - cmd.append('--zxing_path=%s' % options.zxing_path) - if options.ffmpeg_path: - cmd.append('--ffmpeg_path=%s' % options.ffmpeg_path) - - - barcode_decoder = subprocess.Popen(cmd, stdin=_DevNull(), - stdout=sys.stdout, stderr=sys.stderr) - barcode_decoder.wait() - - shutil.rmtree(png_working_directory) - if barcode_decoder.returncode != 0: - print 'Failed to run barcode decoder script.' - return 1 - return 0 - -def main(): - """The main function. - - A simple invocation is: - ./webrtc/tools/barcode_tools/compare_videos.py - --ref_video= - --test_video= - --frame_analyzer= - - Notice that the prerequisites for barcode_decoder.py also applies to this - script. The means the following executables have to be available in the PATH: - * zxing - * ffmpeg - """ - options = _ParseArgs() - - if options.barcode_decoder: - path_to_decoder = options.barcode_decoder - else: - path_to_decoder = os.path.join(SCRIPT_DIR, 'barcode_tools', - 'barcode_decoder.py') - - if DecodeBarcodesInVideo(options, path_to_decoder, - options.ref_video, options.stats_file_ref) != 0: - return 1 - if DecodeBarcodesInVideo(options, path_to_decoder, - options.test_video, options.stats_file_test) != 0: - return 1 - - # Run frame analyzer to compare the videos and print output. - cmd = [ - options.frame_analyzer, - '--label=%s' % options.label, - '--reference_file=%s' % options.ref_video, - '--test_file=%s' % options.test_video, - '--stats_file_ref=%s' % options.stats_file_ref, - '--stats_file_test=%s' % options.stats_file_test, - '--width=%d' % options.yuv_frame_width, - '--height=%d' % options.yuv_frame_height, - ] - frame_analyzer = subprocess.Popen(cmd, stdin=_DevNull(), - stdout=sys.stdout, stderr=sys.stderr) - frame_analyzer.wait() - if frame_analyzer.returncode != 0: - print 'Failed to run frame analyzer.' - return 1 - - return 0 - -if __name__ == '__main__': - sys.exit(main()) +RTC_TOOLS_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, + 'rtc_tools')) +os.system(os.path.join(RTC_TOOLS_DIR, 'compare_videos.py'))