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

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

Issue 178133005: Audit/fix use of media::VideoFrame::coded_size() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2121885f Rebase. Created 6 years, 9 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 | Annotate | Revision Log
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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 362
363 base::TimeDelta time_since_capture = 363 base::TimeDelta time_since_capture =
364 render_time - expected_video_frame.capture_time; 364 render_time - expected_video_frame.capture_time;
365 const base::TimeDelta upper_bound = base::TimeDelta::FromMilliseconds( 365 const base::TimeDelta upper_bound = base::TimeDelta::FromMilliseconds(
366 kDefaultRtpMaxDelayMs + kTimerErrorMs); 366 kDefaultRtpMaxDelayMs + kTimerErrorMs);
367 367
368 EXPECT_GE(upper_bound, time_since_capture) 368 EXPECT_GE(upper_bound, time_since_capture)
369 << "time_since_capture - upper_bound == " 369 << "time_since_capture - upper_bound == "
370 << (time_since_capture - upper_bound).InMilliseconds() << " mS"; 370 << (time_since_capture - upper_bound).InMilliseconds() << " mS";
371 EXPECT_LE(expected_video_frame.capture_time, render_time); 371 EXPECT_LE(expected_video_frame.capture_time, render_time);
372 EXPECT_EQ(expected_video_frame.width, video_frame->coded_size().width()); 372 EXPECT_EQ(expected_video_frame.width, video_frame->visible_rect().width());
373 EXPECT_EQ(expected_video_frame.height, video_frame->coded_size().height()); 373 EXPECT_EQ(expected_video_frame.height,
374 video_frame->visible_rect().height());
374 375
375 gfx::Size size(expected_video_frame.width, expected_video_frame.height); 376 gfx::Size size(expected_video_frame.width, expected_video_frame.height);
376 scoped_refptr<media::VideoFrame> expected_I420_frame = 377 scoped_refptr<media::VideoFrame> expected_I420_frame =
377 media::VideoFrame::CreateFrame( 378 media::VideoFrame::CreateFrame(
378 VideoFrame::I420, size, gfx::Rect(size), size, base::TimeDelta()); 379 VideoFrame::I420, size, gfx::Rect(size), size, base::TimeDelta());
379 PopulateVideoFrame(expected_I420_frame, expected_video_frame.start_value); 380 PopulateVideoFrame(expected_I420_frame, expected_video_frame.start_value);
380 381
381 EXPECT_GE(I420PSNR(expected_I420_frame, video_frame), kVideoAcceptedPSNR); 382 EXPECT_GE(I420PSNR(expected_I420_frame, video_frame), kVideoAcceptedPSNR);
382 } 383 }
383 384
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame); 1321 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame);
1321 } 1322 }
1322 1323
1323 // TODO(pwestin): Add repeatable packet loss test. 1324 // TODO(pwestin): Add repeatable packet loss test.
1324 // TODO(pwestin): Add test for misaligned send get calls. 1325 // TODO(pwestin): Add test for misaligned send get calls.
1325 // TODO(pwestin): Add more tests that does not resample. 1326 // TODO(pwestin): Add more tests that does not resample.
1326 // TODO(pwestin): Add test when we have starvation for our RunTask. 1327 // TODO(pwestin): Add test when we have starvation for our RunTask.
1327 1328
1328 } // namespace cast 1329 } // namespace cast
1329 } // namespace media 1330 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698