| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 _RunCommand([sys.executable, test_script]) | 82 _RunCommand([sys.executable, test_script]) |
| 83 | 83 |
| 84 # Pull the output video. | 84 # Pull the output video. |
| 85 test_video = os.path.join(temp_dir, 'test_video.y4m') | 85 test_video = os.path.join(temp_dir, 'test_video.y4m') |
| 86 _RunCommand(['adb', 'pull', '/sdcard/output.y4m', test_video]) | 86 _RunCommand(['adb', 'pull', '/sdcard/output.y4m', test_video]) |
| 87 | 87 |
| 88 test_video_yuv = os.path.join(temp_dir, 'test_video.yuv') | 88 test_video_yuv = os.path.join(temp_dir, 'test_video.yuv') |
| 89 | 89 |
| 90 ffmpeg_path = os.path.join(toolchain_dir, 'linux', 'ffmpeg') | 90 ffmpeg_path = os.path.join(toolchain_dir, 'linux', 'ffmpeg') |
| 91 | 91 |
| 92 def convert_video(input_video, output_video): | 92 def ConvertVideo(input_video, output_video): |
| 93 _RunCommand([ffmpeg_path, '-y', '-i', input_video, output_video]) | 93 _RunCommand([ffmpeg_path, '-y', '-i', input_video, output_video]) |
| 94 | 94 |
| 95 convert_video(test_video, test_video_yuv) | 95 ConvertVideo(test_video, test_video_yuv) |
| 96 | 96 |
| 97 reference_video = os.path.join(SRC_DIR, | 97 reference_video = os.path.join(SRC_DIR, |
| 98 'resources', 'reference_video_640x360_30fps.y4m') | 98 'resources', 'reference_video_640x360_30fps.y4m') |
| 99 | 99 |
| 100 reference_video_yuv = os.path.join(temp_dir, | 100 reference_video_yuv = os.path.join(temp_dir, |
| 101 'reference_video_640x360_30fps.yuv') | 101 'reference_video_640x360_30fps.yuv') |
| 102 | 102 |
| 103 convert_video(reference_video, reference_video_yuv) | 103 ConvertVideo(reference_video, reference_video_yuv) |
| 104 | 104 |
| 105 # Run compare script. | 105 # Run compare script. |
| 106 compare_script = os.path.join(SRC_DIR, 'webrtc', 'tools', | 106 compare_script = os.path.join(SRC_DIR, 'webrtc', 'tools', |
| 107 'compare_videos.py') | 107 'compare_videos.py') |
| 108 zxing_path = os.path.join(toolchain_dir, 'linux', 'zxing') | 108 zxing_path = os.path.join(toolchain_dir, 'linux', 'zxing') |
| 109 | 109 |
| 110 # The frame_analyzer binary should be built for local computer and not for | 110 # The frame_analyzer binary should be built for local computer and not for |
| 111 # Android | 111 # Android |
| 112 frame_analyzer = os.path.join(build_dir_x86, 'frame_analyzer') | 112 frame_analyzer = os.path.join(build_dir_x86, 'frame_analyzer') |
| 113 | 113 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 124 '--stats_file_ref', stats_file_ref, | 124 '--stats_file_ref', stats_file_ref, |
| 125 '--stats_file_test', stats_file_test, '--frame_analyzer', frame_analyzer, | 125 '--stats_file_test', stats_file_test, '--frame_analyzer', frame_analyzer, |
| 126 '--ffmpeg_path', ffmpeg_path, '--zxing_path', zxing_path]) | 126 '--ffmpeg_path', ffmpeg_path, '--zxing_path', zxing_path]) |
| 127 | 127 |
| 128 shutil.rmtree(temp_dir) | 128 shutil.rmtree(temp_dir) |
| 129 | 129 |
| 130 | 130 |
| 131 if __name__ == '__main__': | 131 if __name__ == '__main__': |
| 132 sys.exit(main()) | 132 sys.exit(main()) |
| 133 | 133 |
| OLD | NEW |