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

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: 5c04e7a7 DCHECK fix. 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame); 1285 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame);
1285 } 1286 }
1286 1287
1287 // TODO(pwestin): Add repeatable packet loss test. 1288 // TODO(pwestin): Add repeatable packet loss test.
1288 // TODO(pwestin): Add test for misaligned send get calls. 1289 // TODO(pwestin): Add test for misaligned send get calls.
1289 // TODO(pwestin): Add more tests that does not resample. 1290 // TODO(pwestin): Add more tests that does not resample.
1290 // TODO(pwestin): Add test when we have starvation for our RunTask. 1291 // TODO(pwestin): Add test when we have starvation for our RunTask.
1291 1292
1292 } // namespace cast 1293 } // namespace cast
1293 } // namespace media 1294 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698