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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 : av_format_context_(NULL), | 84 : av_format_context_(NULL), |
85 audio_stream_index_(-1), | 85 audio_stream_index_(-1), |
86 video_stream_index_(-1), | 86 video_stream_index_(-1), |
87 decoded_audio_time_(AV_NOPTS_VALUE), | 87 decoded_audio_time_(AV_NOPTS_VALUE), |
88 decoded_audio_duration_(AV_NOPTS_VALUE), | 88 decoded_audio_duration_(AV_NOPTS_VALUE), |
89 decoded_video_time_(AV_NOPTS_VALUE), | 89 decoded_video_time_(AV_NOPTS_VALUE), |
90 decoded_video_duration_(AV_NOPTS_VALUE), | 90 decoded_video_duration_(AV_NOPTS_VALUE), |
91 duration_(AV_NOPTS_VALUE) { | 91 duration_(AV_NOPTS_VALUE) { |
92 InitializeFFmpeg(); | 92 InitializeFFmpeg(); |
93 | 93 |
94 audio_buffer_.reset(avcodec_alloc_frame()); | 94 audio_buffer_.reset(av_frame_alloc()); |
95 video_buffer_.reset(avcodec_alloc_frame()); | 95 video_buffer_.reset(av_frame_alloc()); |
96 } | 96 } |
97 | 97 |
98 virtual ~FFmpegTest() { | 98 virtual ~FFmpegTest() { |
99 } | 99 } |
100 | 100 |
101 void OpenAndReadFile(const std::string& name) { | 101 void OpenAndReadFile(const std::string& name) { |
102 OpenFile(name); | 102 OpenFile(name); |
103 OpenCodecs(); | 103 OpenCodecs(); |
104 ReadRemainingFile(); | 104 ReadRemainingFile(); |
105 } | 105 } |
(...skipping 474 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 |