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

Side by Side Diff: webrtc/media/base/videocapturer_unittest.cc

Issue 1934503002: Delete unused video capture code for cropping, non-square pixels, and ARGB. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Delete test case VideoCapturerTest.ScreencastScaledSuperLarge. Created 4 years, 7 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 | « webrtc/media/base/videocapturer.cc ('k') | webrtc/media/base/videocommon.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 capturer_->AddOrUpdateSink(&renderer_, rtc::VideoSinkWants()); 314 capturer_->AddOrUpdateSink(&renderer_, rtc::VideoSinkWants());
315 EXPECT_TRUE(capturer_->CaptureFrame()); 315 EXPECT_TRUE(capturer_->CaptureFrame());
316 EXPECT_EQ(7, renderer_.num_rendered_frames()); 316 EXPECT_EQ(7, renderer_.num_rendered_frames());
317 EXPECT_EQ(1280, renderer_.width()); 317 EXPECT_EQ(1280, renderer_.width());
318 EXPECT_EQ(720, renderer_.height()); 318 EXPECT_EQ(720, renderer_.height());
319 EXPECT_EQ(4, renderer2.num_rendered_frames()); 319 EXPECT_EQ(4, renderer2.num_rendered_frames());
320 EXPECT_EQ(1280, renderer2.width()); 320 EXPECT_EQ(1280, renderer2.width());
321 EXPECT_EQ(720, renderer2.height()); 321 EXPECT_EQ(720, renderer2.height());
322 } 322 }
323 323
324 TEST_F(VideoCapturerTest, ScreencastScaledSuperLarge) {
325 InitScreencast();
326
327 const int kMaxWidth = 4096;
328 const int kMaxHeight = 3072;
329 int kWidth = kMaxWidth + 4;
330 int kHeight = kMaxHeight + 4;
331
332 std::vector<cricket::VideoFormat> formats;
333 formats.push_back(cricket::VideoFormat(kWidth, kHeight,
334 cricket::VideoFormat::FpsToInterval(5), cricket::FOURCC_ARGB));
335 capturer_->ResetSupportedFormats(formats);
336
337 EXPECT_EQ(cricket::CS_RUNNING, capturer_->Start(cricket::VideoFormat(
338 kWidth,
339 kHeight,
340 cricket::VideoFormat::FpsToInterval(30),
341 cricket::FOURCC_ARGB)));
342 EXPECT_TRUE(capturer_->IsRunning());
343 EXPECT_EQ(0, renderer_.num_rendered_frames());
344 EXPECT_TRUE(capturer_->CaptureFrame());
345 EXPECT_EQ(1, renderer_.num_rendered_frames());
346 EXPECT_EQ(kWidth / 2, renderer_.width());
347 EXPECT_EQ(kHeight / 2, renderer_.height());
348 }
349
350 TEST_F(VideoCapturerTest, TestFourccMatch) { 324 TEST_F(VideoCapturerTest, TestFourccMatch) {
351 cricket::VideoFormat desired(640, 480, 325 cricket::VideoFormat desired(640, 480,
352 cricket::VideoFormat::FpsToInterval(30), 326 cricket::VideoFormat::FpsToInterval(30),
353 cricket::FOURCC_ANY); 327 cricket::FOURCC_ANY);
354 cricket::VideoFormat best; 328 cricket::VideoFormat best;
355 EXPECT_TRUE(capturer_->GetBestCaptureFormat(desired, &best)); 329 EXPECT_TRUE(capturer_->GetBestCaptureFormat(desired, &best));
356 EXPECT_EQ(640, best.width); 330 EXPECT_EQ(640, best.width);
357 EXPECT_EQ(480, best.height); 331 EXPECT_EQ(480, best.height);
358 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(30), best.interval); 332 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(30), best.interval);
359 333
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 capturer_->set_enable_camera_list(true); 772 capturer_->set_enable_camera_list(true);
799 capturer_->ConstrainSupportedFormats(vga_format); 773 capturer_->ConstrainSupportedFormats(vga_format);
800 EXPECT_EQ(2u, capturer_->GetSupportedFormats()->size()); 774 EXPECT_EQ(2u, capturer_->GetSupportedFormats()->size());
801 // To make sure it's not just the camera list being broken, add in VGA and 775 // To make sure it's not just the camera list being broken, add in VGA and
802 // try again. This time, only the VGA format should be there. 776 // try again. This time, only the VGA format should be there.
803 supported_formats.push_back(vga_format); 777 supported_formats.push_back(vga_format);
804 capturer_->ResetSupportedFormats(supported_formats); 778 capturer_->ResetSupportedFormats(supported_formats);
805 ASSERT_EQ(1u, capturer_->GetSupportedFormats()->size()); 779 ASSERT_EQ(1u, capturer_->GetSupportedFormats()->size());
806 EXPECT_EQ(vga_format.height, capturer_->GetSupportedFormats()->at(0).height); 780 EXPECT_EQ(vga_format.height, capturer_->GetSupportedFormats()->at(0).height);
807 } 781 }
OLDNEW
« no previous file with comments | « webrtc/media/base/videocapturer.cc ('k') | webrtc/media/base/videocommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698