OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 """ | 10 """ |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 temp_dir = tempfile.mkdtemp() | 97 temp_dir = tempfile.mkdtemp() |
98 else: | 98 else: |
99 if not os.path.exists(temp_dir): | 99 if not os.path.exists(temp_dir): |
100 os.makedirs(temp_dir) | 100 os.makedirs(temp_dir) |
101 | 101 |
102 if not build_dir_x86: | 102 if not build_dir_x86: |
103 build_dir_x86 = os.path.join(temp_dir, 'LocalBuild') | 103 build_dir_x86 = os.path.join(temp_dir, 'LocalBuild') |
104 _RunCommand(['gn', 'gen', build_dir_x86]) | 104 _RunCommand(['gn', 'gen', build_dir_x86]) |
105 _RunCommand(['ninja', '-C', build_dir_x86, 'frame_analyzer']) | 105 _RunCommand(['ninja', '-C', build_dir_x86, 'frame_analyzer']) |
106 | 106 |
107 tools_dir = os.path.join(SRC_DIR, 'tools-webrtc') | 107 tools_dir = os.path.join(SRC_DIR, 'tools_webrtc') |
108 toolchain_dir = os.path.join(tools_dir, 'video_quality_toolchain') | 108 toolchain_dir = os.path.join(tools_dir, 'video_quality_toolchain') |
109 | 109 |
110 # Download ffmpeg and zxing. | 110 # Download ffmpeg and zxing. |
111 download_script = os.path.join(tools_dir, 'download_tools.py') | 111 download_script = os.path.join(tools_dir, 'download_tools.py') |
112 _RunCommand([sys.executable, download_script, toolchain_dir]) | 112 _RunCommand([sys.executable, download_script, toolchain_dir]) |
113 | 113 |
114 # Select an Android device in case multiple are connected | 114 # Select an Android device in case multiple are connected |
115 for line in _RunCommandWithOutput([adb_path, 'devices']).splitlines(): | 115 for line in _RunCommandWithOutput([adb_path, 'devices']).splitlines(): |
116 if line.endswith('\tdevice'): | 116 if line.endswith('\tdevice'): |
117 android_device = line.split('\t')[0] | 117 android_device = line.split('\t')[0] |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 '--stats_file_ref', stats_file_ref, | 193 '--stats_file_ref', stats_file_ref, |
194 '--stats_file_test', stats_file_test, '--frame_analyzer', frame_analyzer, | 194 '--stats_file_test', stats_file_test, '--frame_analyzer', frame_analyzer, |
195 '--ffmpeg_path', ffmpeg_path, '--zxing_path', zxing_path]) | 195 '--ffmpeg_path', ffmpeg_path, '--zxing_path', zxing_path]) |
196 | 196 |
197 shutil.rmtree(temp_dir) | 197 shutil.rmtree(temp_dir) |
198 | 198 |
199 | 199 |
200 if __name__ == '__main__': | 200 if __name__ == '__main__': |
201 sys.exit(main()) | 201 sys.exit(main()) |
202 | 202 |
OLD | NEW |