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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 } | 357 } |
358 | 358 |
359 bool has_audio() { return audio_stream_index_ >= 0; } | 359 bool has_audio() { return audio_stream_index_ >= 0; } |
360 bool has_video() { return video_stream_index_ >= 0; } | 360 bool has_video() { return video_stream_index_ >= 0; } |
361 int64 decoded_audio_time() { return decoded_audio_time_; } | 361 int64 decoded_audio_time() { return decoded_audio_time_; } |
362 int64 decoded_audio_duration() { return decoded_audio_duration_; } | 362 int64 decoded_audio_duration() { return decoded_audio_duration_; } |
363 int64 decoded_video_time() { return decoded_video_time_; } | 363 int64 decoded_video_time() { return decoded_video_time_; } |
364 int64 decoded_video_duration() { return decoded_video_duration_; } | 364 int64 decoded_video_duration() { return decoded_video_duration_; } |
365 int64 duration() { return duration_; } | 365 int64 duration() { return duration_; } |
366 | 366 |
367 AVFormatContext* av_format_context() { | |
368 return av_format_context_; | |
369 } | |
370 AVStream* av_audio_stream() { | 367 AVStream* av_audio_stream() { |
371 return av_format_context_->streams[audio_stream_index_]; | 368 return av_format_context_->streams[audio_stream_index_]; |
372 } | 369 } |
373 AVStream* av_video_stream() { | 370 AVStream* av_video_stream() { |
374 return av_format_context_->streams[video_stream_index_]; | 371 return av_format_context_->streams[video_stream_index_]; |
375 } | 372 } |
376 AVCodecContext* av_audio_context() { | 373 AVCodecContext* av_audio_context() { |
377 return av_audio_stream()->codec; | 374 return av_audio_stream()->codec; |
378 } | 375 } |
379 AVCodecContext* av_video_context() { | 376 AVCodecContext* av_video_context() { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 SeekTo(0.4); | 627 SeekTo(0.4); |
631 ReadRemainingFile(); | 628 ReadRemainingFile(); |
632 EXPECT_TRUE(StepDecodeVideo()); | 629 EXPECT_TRUE(StepDecodeVideo()); |
633 VLOG(1) << decoded_video_time(); | 630 VLOG(1) << decoded_video_time(); |
634 | 631 |
635 CloseCodecs(); | 632 CloseCodecs(); |
636 CloseFile(); | 633 CloseFile(); |
637 } | 634 } |
638 | 635 |
639 } // namespace media | 636 } // namespace media |
OLD | NEW |