OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // ffmpeg_unittests verify that the parts of the FFmpeg API that Chromium uses | 5 // ffmpeg_unittests verify that the parts of the FFmpeg API that Chromium uses |
6 // function as advertised for each media format that Chromium supports. This | 6 // function as advertised for each media format that Chromium supports. This |
7 // mostly includes stuff like reporting proper timestamps, seeking to | 7 // mostly includes stuff like reporting proper timestamps, seeking to |
8 // keyframes, and supporting certain features like reordered_opaque. | 8 // keyframes, and supporting certain features like reordered_opaque. |
9 // | 9 // |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 | 106 |
107 void OpenFile(const std::string& name) { | 107 void OpenFile(const std::string& name) { |
108 base::FilePath path; | 108 base::FilePath path; |
109 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 109 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
110 path = path.AppendASCII("media") | 110 path = path.AppendASCII("media") |
111 .AppendASCII("test") | 111 .AppendASCII("test") |
112 .AppendASCII("data") | 112 .AppendASCII("data") |
113 .AppendASCII("content") | 113 .AppendASCII("content") |
114 .AppendASCII(name.c_str()); | 114 .AppendASCII(name.c_str()); |
115 EXPECT_TRUE(file_util::PathExists(path)); | 115 EXPECT_TRUE(base::PathExists(path)); |
116 | 116 |
117 CHECK(file_data_.Initialize(path)); | 117 CHECK(file_data_.Initialize(path)); |
118 protocol_.reset(new InMemoryUrlProtocol( | 118 protocol_.reset(new InMemoryUrlProtocol( |
119 file_data_.data(), file_data_.length(), false)); | 119 file_data_.data(), file_data_.length(), false)); |
120 glue_.reset(new FFmpegGlue(protocol_.get())); | 120 glue_.reset(new FFmpegGlue(protocol_.get())); |
121 | 121 |
122 ASSERT_TRUE(glue_->OpenContext()) << "Could not open " << path.value(); | 122 ASSERT_TRUE(glue_->OpenContext()) << "Could not open " << path.value(); |
123 av_format_context_ = glue_->format_context(); | 123 av_format_context_ = glue_->format_context(); |
124 ASSERT_LE(0, avformat_find_stream_info(av_format_context_, NULL)) | 124 ASSERT_LE(0, avformat_find_stream_info(av_format_context_, NULL)) |
125 << "Could not find stream information for " << path.value(); | 125 << "Could not find stream information for " << path.value(); |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 EXPECT_TRUE(StepDecodeVideo()); | 580 EXPECT_TRUE(StepDecodeVideo()); |
581 VLOG(1) << decoded_video_time(); | 581 VLOG(1) << decoded_video_time(); |
582 | 582 |
583 SeekTo(0.4); | 583 SeekTo(0.4); |
584 ReadRemainingFile(); | 584 ReadRemainingFile(); |
585 EXPECT_TRUE(StepDecodeVideo()); | 585 EXPECT_TRUE(StepDecodeVideo()); |
586 VLOG(1) << decoded_video_time(); | 586 VLOG(1) << decoded_video_time(); |
587 } | 587 } |
588 | 588 |
589 } // namespace media | 589 } // namespace media |
OLD | NEW |