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

Unified Diff: media/tools/media_bench/media_bench.cc

Issue 6993042: ffmpeg chromium glue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: once more new test_expectations.txt Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/test/ffmpeg_tests/ffmpeg_tests.cc ('k') | media/video/ffmpeg_video_decode_engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/media_bench/media_bench.cc
===================================================================
--- media/tools/media_bench/media_bench.cc (revision 91170)
+++ media/tools/media_bench/media_bench.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -132,15 +132,15 @@
FilePath out_path;
if (filenames.size() > 1)
out_path = FilePath(filenames[1]);
- CodecType target_codec = CODEC_TYPE_UNKNOWN;
+ AVMediaType target_codec = AVMEDIA_TYPE_UNKNOWN;
// Determine whether to benchmark audio or video decoding.
std::string stream(cmd_line->GetSwitchValueASCII(switches::kStream));
if (!stream.empty()) {
if (stream.compare("audio") == 0) {
- target_codec = CODEC_TYPE_AUDIO;
+ target_codec = AVMEDIA_TYPE_AUDIO;
} else if (stream.compare("video") == 0) {
- target_codec = CODEC_TYPE_VIDEO;
+ target_codec = AVMEDIA_TYPE_VIDEO;
} else {
std::cerr << "Unknown --stream option " << stream << std::endl;
return 1;
@@ -239,7 +239,7 @@
NULL, 0, NULL);
if (result < 0) {
switch (result) {
- case AVERROR_NOFMT:
+ case AVERROR(EINVAL):
std::cerr << "Error: File format not supported "
<< in_path.value() << std::endl;
break;
@@ -293,7 +293,7 @@
*log_out << " ";
}
- if (!codec || (codec_context->codec_type == CODEC_TYPE_UNKNOWN)) {
+ if (!codec || (codec_context->codec_type == AVMEDIA_TYPE_UNKNOWN)) {
*log_out << "Stream #" << i << ": Unknown" << std::endl;
} else {
// Print out stream information
@@ -339,11 +339,8 @@
}
// Initialize threaded decode.
- if (target_codec == CODEC_TYPE_VIDEO && video_threads > 0) {
- if (avcodec_thread_init(codec_context, video_threads) < 0) {
- std::cerr << "Warning: Could not initialize threading!\n"
- << "Did you build with pthread/w32thread support?" << std::endl;
- }
+ if (target_codec == AVMEDIA_TYPE_VIDEO && video_threads > 0) {
+ codec_context->thread_count = video_threads;
}
// Initialize our codec.
@@ -402,7 +399,7 @@
// Only decode packets from our target stream.
if (packet.stream_index == target_stream) {
int result = -1;
- if (target_codec == CODEC_TYPE_AUDIO) {
+ if (target_codec == AVMEDIA_TYPE_AUDIO) {
int size_out = AVCODEC_MAX_AUDIO_FRAME_SIZE;
base::TimeTicks decode_start = base::TimeTicks::HighResNow();
@@ -434,7 +431,7 @@
MD5Update(&ctx, u8_samples, size_out);
}
}
- } else if (target_codec == CODEC_TYPE_VIDEO) {
+ } else if (target_codec == AVMEDIA_TYPE_VIDEO) {
int got_picture = 0;
base::TimeTicks decode_start = base::TimeTicks::HighResNow();
« no previous file with comments | « media/test/ffmpeg_tests/ffmpeg_tests.cc ('k') | media/video/ffmpeg_video_decode_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698