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

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

Issue 9317096: Fix media code to work with new ffmpeg. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix years. Created 8 years, 10 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/webm/webm_stream_parser.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
diff --git a/media/tools/media_bench/media_bench.cc b/media/tools/media_bench/media_bench.cc
index fc732bf4acfe7c1a5c88fa9fe896542ee01dcb0a..532aa7d493e61398f121fa8cfbbd695c228a74ff 100644
--- a/media/tools/media_bench/media_bench.cc
+++ b/media/tools/media_bench/media_bench.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -228,12 +228,11 @@ int main(int argc, const char** argv) {
#endif
// Register FFmpeg and attempt to open file.
- avcodec_init();
av_log_set_level(verbose_level);
av_register_all();
av_register_protocol2(&kFFmpegFileProtocol, sizeof(kFFmpegFileProtocol));
AVFormatContext* format_context = NULL;
- // av_open_input_file wants a char*, which can't work with wide paths.
+ // avformat_open_input() wants a char*, which can't work with wide paths.
// So we assume ASCII on Windows. On other platforms we can pass the
// path bytes through verbatim.
#if defined(OS_WIN)
@@ -241,8 +240,8 @@ int main(int argc, const char** argv) {
#else
const std::string& string_path = in_path.value();
#endif
- int result = av_open_input_file(&format_context, string_path.c_str(),
- NULL, 0, NULL);
+ int result = avformat_open_input(&format_context, string_path.c_str(),
+ NULL, NULL);
if (result < 0) {
switch (result) {
case AVERROR(EINVAL):
@@ -279,7 +278,7 @@ int main(int argc, const char** argv) {
}
// Parse a little bit of the stream to fill out the format context.
- if (av_find_stream_info(format_context) < 0) {
+ if (avformat_find_stream_info(format_context, NULL) < 0) {
std::cerr << "Error: Could not find stream info for "
<< in_path.value() << std::endl;
return 1;
@@ -341,7 +340,7 @@ int main(int argc, const char** argv) {
}
if (error_correction) {
codec_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
- codec_context->error_recognition = FF_ER_CAREFUL;
+ codec_context->err_recognition = AV_EF_CAREFUL;
}
// Initialize threaded decode.
@@ -350,7 +349,7 @@ int main(int argc, const char** argv) {
}
// Initialize our codec.
- if (avcodec_open(codec_context, codec) < 0) {
+ if (avcodec_open2(codec_context, codec, NULL) < 0) {
std::cerr << "Error: Could not open codec "
<< (codec_context->codec ? codec_context->codec->name : "(NULL)")
<< " for " << in_path.value() << std::endl;
@@ -533,7 +532,7 @@ int main(int argc, const char** argv) {
if (codec_context)
avcodec_close(codec_context);
if (format_context)
- av_close_input_file(format_context);
+ avformat_close_input(&format_context);
// Calculate the sum of times. Note that some of these may be zero.
double sum = 0;
« no previous file with comments | « media/test/ffmpeg_tests/ffmpeg_tests.cc ('k') | media/webm/webm_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698