Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2174)

Side by Side Diff: media/tools/media_bench/media_bench.cc

Issue 7629007: Enable logging for media_bench. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 void LeaveTimingSection() { 84 void LeaveTimingSection() {
85 } 85 }
86 #endif 86 #endif
87 87
88 int main(int argc, const char** argv) { 88 int main(int argc, const char** argv) {
89 base::AtExitManager exit_manager; 89 base::AtExitManager exit_manager;
90 90
91 CommandLine::Init(argc, argv); 91 CommandLine::Init(argc, argv);
92
93 logging::InitLogging(
94 NULL,
95 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
96 logging::LOCK_LOG_FILE, // Ignored.
97 logging::DELETE_OLD_LOG_FILE, // Ignored.
98 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
99
92 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 100 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
93
94 const CommandLine::StringVector& filenames = cmd_line->GetArgs(); 101 const CommandLine::StringVector& filenames = cmd_line->GetArgs();
95 if (filenames.empty()) { 102 if (filenames.empty()) {
96 std::cerr << "Usage: " << argv[0] << " [OPTIONS] FILE [DUMPFILE]\n" 103 std::cerr << "Usage: " << argv[0] << " [OPTIONS] FILE [DUMPFILE]\n"
97 << " --stream=[audio|video] " 104 << " --stream=[audio|video] "
98 << "Benchmark either the audio or video stream\n" 105 << "Benchmark either the audio or video stream\n"
99 << " --video-threads=N " 106 << " --video-threads=N "
100 << "Decode video using N threads\n" 107 << "Decode video using N threads\n"
101 << " --verbose=N " 108 << " --verbose=N "
102 << "Set FFmpeg log verbosity (-8 to 48)\n" 109 << "Set FFmpeg log verbosity (-8 to 48)\n"
103 << " --frames=N " 110 << " --frames=N "
(...skipping 11 matching lines...) Expand all
115 << " --md5 " 122 << " --md5 "
116 << "Hash decoded buffers (MD5)\n" 123 << "Hash decoded buffers (MD5)\n"
117 << " --skip=[1|2|3] " 124 << " --skip=[1|2|3] "
118 << "1=loop nonref, 2=loop, 3= frame nonref\n" << std::endl; 125 << "1=loop nonref, 2=loop, 3= frame nonref\n" << std::endl;
119 return 1; 126 return 1;
120 } 127 }
121 128
122 // Initialize our media library (try loading DLLs, etc.) before continuing. 129 // Initialize our media library (try loading DLLs, etc.) before continuing.
123 // We use an empty file path as the parameter to force searching of the 130 // We use an empty file path as the parameter to force searching of the
124 // default locations for necessary DLLs and DSOs. 131 // default locations for necessary DLLs and DSOs.
125 if (media::InitializeMediaLibrary(FilePath()) == false) { 132 if (!media::InitializeMediaLibrary(FilePath())) {
126 std::cerr << "Unable to initialize the media library."; 133 std::cerr << "Unable to initialize the media library." << std::endl;
127 return 1; 134 return 1;
128 } 135 }
129 136
130 // Retrieve command line options. 137 // Retrieve command line options.
131 FilePath in_path(filenames[0]); 138 FilePath in_path(filenames[0]);
132 FilePath out_path; 139 FilePath out_path;
133 if (filenames.size() > 1) 140 if (filenames.size() > 1)
134 out_path = FilePath(filenames[1]); 141 out_path = FilePath(filenames[1]);
135 AVMediaType target_codec = AVMEDIA_TYPE_UNKNOWN; 142 AVMediaType target_codec = AVMEDIA_TYPE_UNKNOWN;
136 143
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 #if defined(ENABLE_WINDOWS_EXCEPTIONS) 594 #if defined(ENABLE_WINDOWS_EXCEPTIONS)
588 } __except(EXCEPTION_EXECUTE_HANDLER) { 595 } __except(EXCEPTION_EXECUTE_HANDLER) {
589 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() 596 *log_out << " Exception:" << std::setw(11) << GetExceptionCode()
590 << " " << in_path.value() << std::endl; 597 << " " << in_path.value() << std::endl;
591 return 1; 598 return 1;
592 } 599 }
593 #endif 600 #endif
594 CommandLine::Reset(); 601 CommandLine::Reset();
595 return 0; 602 return 0;
596 } 603 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698