OLD | NEW |
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 #include "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "media/base/media.h" | 8 #include "media/base/media.h" |
9 #include "media/ffmpeg/ffmpeg_common.h" | 9 #include "media/ffmpeg/ffmpeg_common.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 AVStream stream_; | 36 AVStream stream_; |
37 | 37 |
38 DISALLOW_COPY_AND_ASSIGN(FFmpegCommonTest); | 38 DISALLOW_COPY_AND_ASSIGN(FFmpegCommonTest); |
39 }; | 39 }; |
40 | 40 |
41 static bool InitFFmpeg() { | 41 static bool InitFFmpeg() { |
42 static bool initialized = false; | 42 static bool initialized = false; |
43 if (initialized) { | 43 if (initialized) { |
44 return true; | 44 return true; |
45 } | 45 } |
46 FilePath path; | 46 base::FilePath path; |
47 PathService::Get(base::DIR_MODULE, &path); | 47 PathService::Get(base::DIR_MODULE, &path); |
48 return media::InitializeMediaLibrary(path); | 48 return media::InitializeMediaLibrary(path); |
49 } | 49 } |
50 | 50 |
51 FFmpegCommonTest::FFmpegCommonTest() { | 51 FFmpegCommonTest::FFmpegCommonTest() { |
52 CHECK(InitFFmpeg()); | 52 CHECK(InitFFmpeg()); |
53 stream_.time_base = kTimeBase; | 53 stream_.time_base = kTimeBase; |
54 stream_.index_entries = kIndexEntries; | 54 stream_.index_entries = kIndexEntries; |
55 stream_.index_entries_allocated_size = sizeof(kIndexEntries); | 55 stream_.index_entries_allocated_size = sizeof(kIndexEntries); |
56 stream_.nb_index_entries = arraysize(kIndexEntries); | 56 stream_.nb_index_entries = arraysize(kIndexEntries); |
(...skipping 16 matching lines...) Expand all Loading... |
73 time_base.den = static_cast<int>(test_data[i][1]); | 73 time_base.den = static_cast<int>(test_data[i][1]); |
74 | 74 |
75 TimeDelta time_delta = ConvertFromTimeBase(time_base, test_data[i][2]); | 75 TimeDelta time_delta = ConvertFromTimeBase(time_base, test_data[i][2]); |
76 | 76 |
77 EXPECT_EQ(time_delta.InMicroseconds(), test_data[i][3]); | 77 EXPECT_EQ(time_delta.InMicroseconds(), test_data[i][3]); |
78 EXPECT_EQ(ConvertToTimeBase(time_base, time_delta), test_data[i][4]); | 78 EXPECT_EQ(ConvertToTimeBase(time_base, time_delta), test_data[i][4]); |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 } // namespace media | 82 } // namespace media |
OLD | NEW |