| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <iomanip> | 10 #include <iomanip> |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 << " --djb2 (aka --hash) " | 119 << " --djb2 (aka --hash) " |
| 120 << "Hash decoded buffers (DJB2)\n" | 120 << "Hash decoded buffers (DJB2)\n" |
| 121 << " --md5 " | 121 << " --md5 " |
| 122 << "Hash decoded buffers (MD5)\n" | 122 << "Hash decoded buffers (MD5)\n" |
| 123 << " --skip=[1|2|3] " | 123 << " --skip=[1|2|3] " |
| 124 << "1=loop nonref, 2=loop, 3= frame nonref\n" << std::endl; | 124 << "1=loop nonref, 2=loop, 3= frame nonref\n" << std::endl; |
| 125 return 1; | 125 return 1; |
| 126 } | 126 } |
| 127 | 127 |
| 128 // Initialize our media library (try loading DLLs, etc.) before continuing. | 128 // Initialize our media library (try loading DLLs, etc.) before continuing. |
| 129 FilePath media_path; | 129 base::FilePath media_path; |
| 130 PathService::Get(base::DIR_MODULE, &media_path); | 130 PathService::Get(base::DIR_MODULE, &media_path); |
| 131 if (!media::InitializeMediaLibrary(media_path)) { | 131 if (!media::InitializeMediaLibrary(media_path)) { |
| 132 std::cerr << "Unable to initialize the media library." << std::endl; | 132 std::cerr << "Unable to initialize the media library." << std::endl; |
| 133 return 1; | 133 return 1; |
| 134 } | 134 } |
| 135 | 135 |
| 136 // Retrieve command line options. | 136 // Retrieve command line options. |
| 137 FilePath in_path(filenames[0]); | 137 base::FilePath in_path(filenames[0]); |
| 138 FilePath out_path; | 138 base::FilePath out_path; |
| 139 if (filenames.size() > 1) | 139 if (filenames.size() > 1) |
| 140 out_path = FilePath(filenames[1]); | 140 out_path = base::FilePath(filenames[1]); |
| 141 AVMediaType target_codec = AVMEDIA_TYPE_UNKNOWN; | 141 AVMediaType target_codec = AVMEDIA_TYPE_UNKNOWN; |
| 142 | 142 |
| 143 // Determine whether to benchmark audio or video decoding. | 143 // Determine whether to benchmark audio or video decoding. |
| 144 std::string stream(cmd_line->GetSwitchValueASCII(switches::kStream)); | 144 std::string stream(cmd_line->GetSwitchValueASCII(switches::kStream)); |
| 145 if (!stream.empty()) { | 145 if (!stream.empty()) { |
| 146 if (stream.compare("audio") == 0) { | 146 if (stream.compare("audio") == 0) { |
| 147 target_codec = AVMEDIA_TYPE_AUDIO; | 147 target_codec = AVMEDIA_TYPE_AUDIO; |
| 148 } else if (stream.compare("video") == 0) { | 148 } else if (stream.compare("video") == 0) { |
| 149 target_codec = AVMEDIA_TYPE_VIDEO; | 149 target_codec = AVMEDIA_TYPE_VIDEO; |
| 150 } else { | 150 } else { |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 #if defined(ENABLE_WINDOWS_EXCEPTIONS) | 581 #if defined(ENABLE_WINDOWS_EXCEPTIONS) |
| 582 } __except(EXCEPTION_EXECUTE_HANDLER) { | 582 } __except(EXCEPTION_EXECUTE_HANDLER) { |
| 583 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() | 583 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() |
| 584 << " " << in_path.value() << std::endl; | 584 << " " << in_path.value() << std::endl; |
| 585 return 1; | 585 return 1; |
| 586 } | 586 } |
| 587 #endif | 587 #endif |
| 588 CommandLine::Reset(); | 588 CommandLine::Reset(); |
| 589 return 0; | 589 return 0; |
| 590 } | 590 } |
| OLD | NEW |