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 // 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 // Known failures as of r54591: | 10 // Known failures as of r54591: |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 AVCodecContext* av_codec_context = av_stream->codec; | 166 AVCodecContext* av_codec_context = av_stream->codec; |
167 AVCodec* av_codec = avcodec_find_decoder(av_codec_context->codec_id); | 167 AVCodec* av_codec = avcodec_find_decoder(av_codec_context->codec_id); |
168 | 168 |
169 EXPECT_TRUE(av_codec) | 169 EXPECT_TRUE(av_codec) |
170 << "Could not find AVCodec with CodecID " | 170 << "Could not find AVCodec with CodecID " |
171 << av_codec_context->codec_id; | 171 << av_codec_context->codec_id; |
172 EXPECT_EQ(0, avcodec_open(av_codec_context, av_codec)) | 172 EXPECT_EQ(0, avcodec_open(av_codec_context, av_codec)) |
173 << "Could not open AVCodecContext with CodecID " | 173 << "Could not open AVCodecContext with CodecID " |
174 << av_codec_context->codec_id; | 174 << av_codec_context->codec_id; |
175 | 175 |
176 if (av_codec->type == CODEC_TYPE_AUDIO) { | 176 if (av_codec->type == AVMEDIA_TYPE_AUDIO) { |
177 EXPECT_EQ(-1, audio_stream_index_) << "Found multiple audio streams."; | 177 EXPECT_EQ(-1, audio_stream_index_) << "Found multiple audio streams."; |
178 audio_stream_index_ = static_cast<int>(i); | 178 audio_stream_index_ = static_cast<int>(i); |
179 } else if (av_codec->type == CODEC_TYPE_VIDEO) { | 179 } else if (av_codec->type == AVMEDIA_TYPE_VIDEO) { |
180 EXPECT_EQ(-1, video_stream_index_) << "Found multiple video streams."; | 180 EXPECT_EQ(-1, video_stream_index_) << "Found multiple video streams."; |
181 video_stream_index_ = static_cast<int>(i); | 181 video_stream_index_ = static_cast<int>(i); |
182 } else { | 182 } else { |
183 ADD_FAILURE() << "Found unknown stream type."; | 183 ADD_FAILURE() << "Found unknown stream type."; |
184 } | 184 } |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 void CloseCodecs() { | 188 void CloseCodecs() { |
189 for (unsigned int i = 0; i < av_format_context_->nb_streams; ++i) { | 189 for (unsigned int i = 0; i < av_format_context_->nb_streams; ++i) { |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 SeekTo(0.4); | 646 SeekTo(0.4); |
647 ReadRemainingFile(); | 647 ReadRemainingFile(); |
648 EXPECT_TRUE(StepDecodeVideo()); | 648 EXPECT_TRUE(StepDecodeVideo()); |
649 VLOG(1) << decoded_video_time(); | 649 VLOG(1) << decoded_video_time(); |
650 | 650 |
651 CloseCodecs(); | 651 CloseCodecs(); |
652 CloseFile(); | 652 CloseFile(); |
653 } | 653 } |
654 | 654 |
655 } // namespace media | 655 } // namespace media |
OLD | NEW |