OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Standalone benchmarking application based on FFmpeg. This tool is used to | 5 // Standalone benchmarking application based on FFmpeg. This tool is used to |
6 // measure decoding performance between different FFmpeg compile and run-time | 6 // measure decoding performance between different FFmpeg compile and run-time |
7 // options. We also use this tool to measure performance regressions when | 7 // options. We also use this tool to measure performance regressions when |
8 // testing newer builds of FFmpeg from trunk. | 8 // testing newer builds of FFmpeg from trunk. |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 std::ostream* log_out = &std::cout; | 217 std::ostream* log_out = &std::cout; |
218 #if defined(ENABLE_WINDOWS_EXCEPTIONS) | 218 #if defined(ENABLE_WINDOWS_EXCEPTIONS) |
219 // Catch exceptions so this tool can be used in automated testing. | 219 // Catch exceptions so this tool can be used in automated testing. |
220 __try { | 220 __try { |
221 #endif | 221 #endif |
222 | 222 |
223 // Register FFmpeg and attempt to open file. | 223 // Register FFmpeg and attempt to open file. |
224 avcodec_init(); | 224 avcodec_init(); |
225 av_log_set_level(verbose_level); | 225 av_log_set_level(verbose_level); |
226 av_register_all(); | 226 av_register_all(); |
227 av_register_protocol(&kFFmpegFileProtocol); | 227 av_register_protocol2(&kFFmpegFileProtocol, sizeof(kFFmpegFileProtocol)); |
228 AVFormatContext* format_context = NULL; | 228 AVFormatContext* format_context = NULL; |
229 // av_open_input_file wants a char*, which can't work with wide paths. | 229 // av_open_input_file wants a char*, which can't work with wide paths. |
230 // So we assume ASCII on Windows. On other platforms we can pass the | 230 // So we assume ASCII on Windows. On other platforms we can pass the |
231 // path bytes through verbatim. | 231 // path bytes through verbatim. |
232 #if defined(OS_WIN) | 232 #if defined(OS_WIN) |
233 std::string string_path = WideToASCII(in_path.value()); | 233 std::string string_path = WideToASCII(in_path.value()); |
234 #else | 234 #else |
235 const std::string& string_path = in_path.value(); | 235 const std::string& string_path = in_path.value(); |
236 #endif | 236 #endif |
237 int result = av_open_input_file(&format_context, string_path.c_str(), | 237 int result = av_open_input_file(&format_context, string_path.c_str(), |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 #if defined(ENABLE_WINDOWS_EXCEPTIONS) | 572 #if defined(ENABLE_WINDOWS_EXCEPTIONS) |
573 } __except(EXCEPTION_EXECUTE_HANDLER) { | 573 } __except(EXCEPTION_EXECUTE_HANDLER) { |
574 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() | 574 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() |
575 << " " << in_path.value() << std::endl; | 575 << " " << in_path.value() << std::endl; |
576 return 1; | 576 return 1; |
577 } | 577 } |
578 #endif | 578 #endif |
579 CommandLine::Reset(); | 579 CommandLine::Reset(); |
580 return 0; | 580 return 0; |
581 } | 581 } |
OLD | NEW |