OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This test generate synthetic data. For audio it's a sinusoid waveform with | 5 // This test generate synthetic data. For audio it's a sinusoid waveform with |
6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern | 6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern |
7 // that is shifting by one pixel per frame, each pixels neighbors right and down | 7 // that is shifting by one pixel per frame, each pixels neighbors right and down |
8 // is this pixels value +1, since the pixel value is 8 bit it will wrap | 8 // is this pixels value +1, since the pixel value is 8 bit it will wrap |
9 // frequently within the image. Visually this will create diagonally color bands | 9 // frequently within the image. Visually this will create diagonally color bands |
10 // that moves across the screen | 10 // that moves across the screen |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 task_runner_->RunTasks(); | 649 task_runner_->RunTasks(); |
650 } | 650 } |
651 | 651 |
652 void SendVideoFrame(int start_value, const base::TimeTicks& reference_time) { | 652 void SendVideoFrame(int start_value, const base::TimeTicks& reference_time) { |
653 if (start_time_.is_null()) | 653 if (start_time_.is_null()) |
654 start_time_ = reference_time; | 654 start_time_ = reference_time; |
655 // TODO(miu): Consider using a slightly skewed clock for the media timestamp | 655 // TODO(miu): Consider using a slightly skewed clock for the media timestamp |
656 // since the video clock may not be the same as the reference clock. | 656 // since the video clock may not be the same as the reference clock. |
657 const base::TimeDelta time_diff = reference_time - start_time_; | 657 const base::TimeDelta time_diff = reference_time - start_time_; |
658 const gfx::Size size(kVideoHdWidth, kVideoHdHeight); | 658 const gfx::Size size(kVideoHdWidth, kVideoHdHeight); |
659 EXPECT_TRUE(VideoFrame::IsValidConfig( | 659 EXPECT_TRUE(VideoFrame::IsValidConfig(VideoFrame::I420, |
660 VideoFrame::I420, size, gfx::Rect(size), size)); | 660 VideoFrame::STORAGE_UNKNOWN, size, |
| 661 gfx::Rect(size), size)); |
661 scoped_refptr<media::VideoFrame> video_frame = | 662 scoped_refptr<media::VideoFrame> video_frame = |
662 media::VideoFrame::CreateFrame( | 663 media::VideoFrame::CreateFrame( |
663 VideoFrame::I420, size, gfx::Rect(size), size, | 664 VideoFrame::I420, size, gfx::Rect(size), size, |
664 time_diff); | 665 time_diff); |
665 PopulateVideoFrame(video_frame.get(), start_value); | 666 PopulateVideoFrame(video_frame.get(), start_value); |
666 video_frame_input_->InsertRawVideoFrame(video_frame, reference_time); | 667 video_frame_input_->InsertRawVideoFrame(video_frame, reference_time); |
667 } | 668 } |
668 | 669 |
669 void SendFakeVideoFrame(const base::TimeTicks& reference_time) { | 670 void SendFakeVideoFrame(const base::TimeTicks& reference_time) { |
670 if (start_time_.is_null()) | 671 if (start_time_.is_null()) |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 EXPECT_LT(jump, 220u); | 1513 EXPECT_LT(jump, 220u); |
1513 } | 1514 } |
1514 | 1515 |
1515 // TODO(pwestin): Add repeatable packet loss test. | 1516 // TODO(pwestin): Add repeatable packet loss test. |
1516 // TODO(pwestin): Add test for misaligned send get calls. | 1517 // TODO(pwestin): Add test for misaligned send get calls. |
1517 // TODO(pwestin): Add more tests that does not resample. | 1518 // TODO(pwestin): Add more tests that does not resample. |
1518 // TODO(pwestin): Add test when we have starvation for our RunTask. | 1519 // TODO(pwestin): Add test when we have starvation for our RunTask. |
1519 | 1520 |
1520 } // namespace cast | 1521 } // namespace cast |
1521 } // namespace media | 1522 } // namespace media |
OLD | NEW |