Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: media/cast/test/end2end_unittest.cc

Issue 1154153003: Relanding 1143663007: VideoFrame: Separate Pixel Format from Storage Type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NV12 support in CrOS Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/cast/test/utility/video_utility.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/cast/test/utility/video_utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698