OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "media/base/media_util.h" | 23 #include "media/base/media_util.h" |
24 #include "media/cast/common/rtp_time.h" | 24 #include "media/cast/common/rtp_time.h" |
25 #include "media/cast/constants.h" | 25 #include "media/cast/constants.h" |
26 #include "media/cast/sender/h264_vt_encoder.h" | 26 #include "media/cast/sender/h264_vt_encoder.h" |
27 #include "media/cast/sender/video_frame_factory.h" | 27 #include "media/cast/sender/video_frame_factory.h" |
28 #include "media/cast/test/utility/default_config.h" | 28 #include "media/cast/test/utility/default_config.h" |
29 #include "media/cast/test/utility/video_utility.h" | 29 #include "media/cast/test/utility/video_utility.h" |
30 #include "media/ffmpeg/ffmpeg_common.h" | 30 #include "media/ffmpeg/ffmpeg_common.h" |
31 #include "media/filters/ffmpeg_glue.h" | 31 #include "media/filters/ffmpeg_glue.h" |
32 #include "media/filters/ffmpeg_video_decoder.h" | 32 #include "media/filters/ffmpeg_video_decoder.h" |
33 #include "media/media_features.h" | |
34 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
35 | 34 |
36 namespace { | 35 namespace { |
37 | 36 |
38 const int kVideoWidth = 1280; | 37 const int kVideoWidth = 1280; |
39 const int kVideoHeight = 720; | 38 const int kVideoHeight = 720; |
40 | 39 |
41 class MediaTestSuite : public base::TestSuite { | 40 class MediaTestSuite : public base::TestSuite { |
42 public: | 41 public: |
43 MediaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} | 42 MediaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 clock_->NowTicks()); | 292 clock_->NowTicks()); |
294 EXPECT_TRUE(encoder_->EncodeVideoFrame(frame_, clock_->NowTicks(), cb)); | 293 EXPECT_TRUE(encoder_->EncodeVideoFrame(frame_, clock_->NowTicks(), cb)); |
295 } | 294 } |
296 | 295 |
297 encoder_.reset(); | 296 encoder_.reset(); |
298 base::RunLoop().RunUntilIdle(); | 297 base::RunLoop().RunUntilIdle(); |
299 | 298 |
300 EXPECT_EQ(10, metadata_recorder->count_frames_delivered()); | 299 EXPECT_EQ(10, metadata_recorder->count_frames_delivered()); |
301 } | 300 } |
302 | 301 |
303 #if BUILDFLAG(USE_PROPRIETARY_CODECS) | 302 #if defined(USE_PROPRIETARY_CODECS) |
304 // Failed on mac_chromium_rel_ng trybot. http://crbug.com/627260 | 303 // Failed on mac_chromium_rel_ng trybot. http://crbug.com/627260 |
305 TEST_F(H264VideoToolboxEncoderTest, DISABLED_CheckFramesAreDecodable) { | 304 TEST_F(H264VideoToolboxEncoderTest, DISABLED_CheckFramesAreDecodable) { |
306 VideoDecoderConfig config(kCodecH264, H264PROFILE_MAIN, frame_->format(), | 305 VideoDecoderConfig config(kCodecH264, H264PROFILE_MAIN, frame_->format(), |
307 COLOR_SPACE_UNSPECIFIED, frame_->coded_size(), | 306 COLOR_SPACE_UNSPECIFIED, frame_->coded_size(), |
308 frame_->visible_rect(), frame_->natural_size(), | 307 frame_->visible_rect(), frame_->natural_size(), |
309 EmptyExtraData(), Unencrypted()); | 308 EmptyExtraData(), Unencrypted()); |
310 scoped_refptr<EndToEndFrameChecker> checker(new EndToEndFrameChecker(config)); | 309 scoped_refptr<EndToEndFrameChecker> checker(new EndToEndFrameChecker(config)); |
311 | 310 |
312 VideoEncoder::FrameEncodedCallback cb = | 311 VideoEncoder::FrameEncodedCallback cb = |
313 base::Bind(&EndToEndFrameChecker::EncodeDone, checker.get()); | 312 base::Bind(&EndToEndFrameChecker::EncodeDone, checker.get()); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); | 403 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); |
405 | 404 |
406 // After a power resume event, the factory should produce frames right away | 405 // After a power resume event, the factory should produce frames right away |
407 // because the encoder re-initializes on its own. | 406 // because the encoder re-initializes on its own. |
408 power_source_->GenerateResumeEvent(); | 407 power_source_->GenerateResumeEvent(); |
409 CreateFrameAndMemsetPlane(video_frame_factory.get()); | 408 CreateFrameAndMemsetPlane(video_frame_factory.get()); |
410 } | 409 } |
411 | 410 |
412 } // namespace cast | 411 } // namespace cast |
413 } // namespace media | 412 } // namespace media |
OLD | NEW |