| 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 #include <cstdio> | |
| 6 | |
| 7 #include "base/file_path.h" | 5 #include "base/file_path.h" |
| 8 #include "base/test/test_suite.h" | 6 #include "base/test/test_suite.h" |
| 9 #include "media/base/media.h" | 7 #include "media/base/media.h" |
| 10 #include "media/ffmpeg/ffmpeg_common.h" | 8 #include "media/ffmpeg/ffmpeg_common.h" |
| 11 #include "media/ffmpeg/file_protocol.h" | 9 #include "media/ffmpeg/file_protocol.h" |
| 12 | 10 |
| 13 static bool InitFFmpeg() { | 11 static bool InitFFmpeg() { |
| 14 if (!media::InitializeMediaLibrary(FilePath())) | 12 if (!media::InitializeMediaLibrary(FilePath())) |
| 15 return false; | 13 return false; |
| 16 avcodec_init(); | 14 avcodec_init(); |
| 17 av_register_all(); | 15 av_register_all(); |
| 18 av_register_protocol2(&kFFmpegFileProtocol, sizeof(kFFmpegFileProtocol)); | 16 av_register_protocol2(&kFFmpegFileProtocol, sizeof(kFFmpegFileProtocol)); |
| 19 return true; | 17 return true; |
| 20 } | 18 } |
| 21 | 19 |
| 22 int main(int argc, char** argv) { | 20 int main(int argc, char** argv) { |
| 23 if (!InitFFmpeg()) { | 21 if (!InitFFmpeg()) { |
| 24 fprintf(stderr, "Failed to init ffmpeg\n"); | 22 fprintf(stderr, "Failed to init ffmpeg\n"); |
| 25 return -1; | 23 return -1; |
| 26 } | 24 } |
| 27 return TestSuite(argc, argv).Run(); | 25 return TestSuite(argc, argv).Run(); |
| 28 } | 26 } |
| OLD | NEW |