| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 base::TimeDelta time_since_capture = | 356 base::TimeDelta time_since_capture = |
| 357 render_time - expected_video_frame.capture_time; | 357 render_time - expected_video_frame.capture_time; |
| 358 const base::TimeDelta upper_bound = base::TimeDelta::FromMilliseconds( | 358 const base::TimeDelta upper_bound = base::TimeDelta::FromMilliseconds( |
| 359 kDefaultRtpMaxDelayMs + kTimerErrorMs); | 359 kDefaultRtpMaxDelayMs + kTimerErrorMs); |
| 360 | 360 |
| 361 EXPECT_GE(upper_bound, time_since_capture) | 361 EXPECT_GE(upper_bound, time_since_capture) |
| 362 << "time_since_capture - upper_bound == " | 362 << "time_since_capture - upper_bound == " |
| 363 << (time_since_capture - upper_bound).InMilliseconds() << " mS"; | 363 << (time_since_capture - upper_bound).InMilliseconds() << " mS"; |
| 364 EXPECT_LE(expected_video_frame.capture_time, render_time); | 364 EXPECT_LE(expected_video_frame.capture_time, render_time); |
| 365 EXPECT_EQ(expected_video_frame.width, video_frame->coded_size().width()); | 365 EXPECT_EQ(expected_video_frame.width, video_frame->visible_rect().width()); |
| 366 EXPECT_EQ(expected_video_frame.height, video_frame->coded_size().height()); | 366 EXPECT_EQ(expected_video_frame.height, |
| 367 video_frame->visible_rect().height()); |
| 367 | 368 |
| 368 gfx::Size size(expected_video_frame.width, expected_video_frame.height); | 369 gfx::Size size(expected_video_frame.width, expected_video_frame.height); |
| 369 scoped_refptr<media::VideoFrame> expected_I420_frame = | 370 scoped_refptr<media::VideoFrame> expected_I420_frame = |
| 370 media::VideoFrame::CreateFrame( | 371 media::VideoFrame::CreateFrame( |
| 371 VideoFrame::I420, size, gfx::Rect(size), size, base::TimeDelta()); | 372 VideoFrame::I420, size, gfx::Rect(size), size, base::TimeDelta()); |
| 372 PopulateVideoFrame(expected_I420_frame, expected_video_frame.start_value); | 373 PopulateVideoFrame(expected_I420_frame, expected_video_frame.start_value); |
| 373 | 374 |
| 374 EXPECT_GE(I420PSNR(expected_I420_frame, video_frame), kVideoAcceptedPSNR); | 375 EXPECT_GE(I420PSNR(expected_I420_frame, video_frame), kVideoAcceptedPSNR); |
| 375 } | 376 } |
| 376 | 377 |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame); | 1286 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame); |
| 1286 } | 1287 } |
| 1287 | 1288 |
| 1288 // TODO(pwestin): Add repeatable packet loss test. | 1289 // TODO(pwestin): Add repeatable packet loss test. |
| 1289 // TODO(pwestin): Add test for misaligned send get calls. | 1290 // TODO(pwestin): Add test for misaligned send get calls. |
| 1290 // TODO(pwestin): Add more tests that does not resample. | 1291 // TODO(pwestin): Add more tests that does not resample. |
| 1291 // TODO(pwestin): Add test when we have starvation for our RunTask. | 1292 // TODO(pwestin): Add test when we have starvation for our RunTask. |
| 1292 | 1293 |
| 1293 } // namespace cast | 1294 } // namespace cast |
| 1294 } // namespace media | 1295 } // namespace media |
| OLD | NEW |