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

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

Issue 2262443003: Delete VideoFrameFactory, CapturedFrame, and related code. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update apply_rotation_ comment. Created 4 years, 3 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/videoframefactory.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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 TEST_F(VideoCapturerTest, ScreencastScaledOddWidth) { 86 TEST_F(VideoCapturerTest, ScreencastScaledOddWidth) {
87 InitScreencast(); 87 InitScreencast();
88 88
89 int kWidth = 1281; 89 int kWidth = 1281;
90 int kHeight = 720; 90 int kHeight = 720;
91 91
92 std::vector<cricket::VideoFormat> formats; 92 std::vector<cricket::VideoFormat> formats;
93 formats.push_back(cricket::VideoFormat(kWidth, kHeight, 93 formats.push_back(cricket::VideoFormat(kWidth, kHeight,
94 cricket::VideoFormat::FpsToInterval(5), cricket::FOURCC_ARGB)); 94 cricket::VideoFormat::FpsToInterval(5),
95 cricket::FOURCC_I420));
95 capturer_->ResetSupportedFormats(formats); 96 capturer_->ResetSupportedFormats(formats);
96 97
97 EXPECT_EQ(cricket::CS_RUNNING, capturer_->Start(cricket::VideoFormat( 98 EXPECT_EQ(cricket::CS_RUNNING,
98 kWidth, 99 capturer_->Start(cricket::VideoFormat(
99 kHeight, 100 kWidth, kHeight, cricket::VideoFormat::FpsToInterval(30),
100 cricket::VideoFormat::FpsToInterval(30), 101 cricket::FOURCC_ANY)));
101 cricket::FOURCC_ARGB)));
102 EXPECT_TRUE(capturer_->IsRunning()); 102 EXPECT_TRUE(capturer_->IsRunning());
103 EXPECT_EQ(0, renderer_.num_rendered_frames()); 103 EXPECT_EQ(0, renderer_.num_rendered_frames());
104 EXPECT_TRUE(capturer_->CaptureFrame()); 104 EXPECT_TRUE(capturer_->CaptureFrame());
105 EXPECT_EQ(1, renderer_.num_rendered_frames()); 105 EXPECT_EQ(1, renderer_.num_rendered_frames());
106 EXPECT_EQ(kWidth, renderer_.width()); 106 EXPECT_EQ(kWidth, renderer_.width());
107 EXPECT_EQ(kHeight, renderer_.height()); 107 EXPECT_EQ(kHeight, renderer_.height());
108 } 108 }
109 109
110 TEST_F(VideoCapturerTest, TestRotationAppliedBySource) { 110 TEST_F(VideoCapturerTest, TestRotationAppliedBySource) {
111 int kWidth = 800; 111 int kWidth = 800;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 wants.rotation_applied = true; 238 wants.rotation_applied = true;
239 capturer_->AddOrUpdateSink(&renderer2, wants); 239 capturer_->AddOrUpdateSink(&renderer2, wants);
240 240
241 EXPECT_TRUE(capturer_->CaptureFrame()); 241 EXPECT_TRUE(capturer_->CaptureFrame());
242 EXPECT_EQ(++frame_count, renderer_.num_rendered_frames()); 242 EXPECT_EQ(++frame_count, renderer_.num_rendered_frames());
243 EXPECT_EQ(1, renderer2.num_rendered_frames()); 243 EXPECT_EQ(1, renderer2.num_rendered_frames());
244 EXPECT_EQ(webrtc::kVideoRotation_0, renderer_.rotation()); 244 EXPECT_EQ(webrtc::kVideoRotation_0, renderer_.rotation());
245 EXPECT_EQ(webrtc::kVideoRotation_0, renderer2.rotation()); 245 EXPECT_EQ(webrtc::kVideoRotation_0, renderer2.rotation());
246 } 246 }
247 247
248 // TODO(nisse): This test doesn't quite fit here. It tests two things:
249 // Aggregation of VideoSinkWants, which is the responsibility of
250 // VideoBroadcaster, and translation of VideoSinkWants to actual
251 // resolution, which is the responsibility of the VideoAdapter.
248 TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) { 252 TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) {
249 EXPECT_EQ(cricket::CS_RUNNING, 253 EXPECT_EQ(cricket::CS_RUNNING,
250 capturer_->Start(cricket::VideoFormat( 254 capturer_->Start(cricket::VideoFormat(
251 1280, 720, cricket::VideoFormat::FpsToInterval(30), 255 1280, 720, cricket::VideoFormat::FpsToInterval(30),
252 cricket::FOURCC_I420))); 256 cricket::FOURCC_I420)));
253 EXPECT_TRUE(capturer_->IsRunning()); 257 EXPECT_TRUE(capturer_->IsRunning());
254 258
255 EXPECT_EQ(0, renderer_.num_rendered_frames()); 259 EXPECT_EQ(0, renderer_.num_rendered_frames());
256 EXPECT_TRUE(capturer_->CaptureFrame()); 260 EXPECT_TRUE(capturer_->CaptureFrame());
257 EXPECT_EQ(1, renderer_.num_rendered_frames()); 261 EXPECT_EQ(1, renderer_.num_rendered_frames());
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 capturer_->set_enable_camera_list(true); 778 capturer_->set_enable_camera_list(true);
775 capturer_->ConstrainSupportedFormats(vga_format); 779 capturer_->ConstrainSupportedFormats(vga_format);
776 EXPECT_EQ(2u, capturer_->GetSupportedFormats()->size()); 780 EXPECT_EQ(2u, capturer_->GetSupportedFormats()->size());
777 // To make sure it's not just the camera list being broken, add in VGA and 781 // To make sure it's not just the camera list being broken, add in VGA and
778 // try again. This time, only the VGA format should be there. 782 // try again. This time, only the VGA format should be there.
779 supported_formats.push_back(vga_format); 783 supported_formats.push_back(vga_format);
780 capturer_->ResetSupportedFormats(supported_formats); 784 capturer_->ResetSupportedFormats(supported_formats);
781 ASSERT_EQ(1u, capturer_->GetSupportedFormats()->size()); 785 ASSERT_EQ(1u, capturer_->GetSupportedFormats()->size());
782 EXPECT_EQ(vga_format.height, capturer_->GetSupportedFormats()->at(0).height); 786 EXPECT_EQ(vga_format.height, capturer_->GetSupportedFormats()->at(0).height);
783 } 787 }
OLDNEW
« no previous file with comments | « webrtc/media/base/videocapturer.cc ('k') | webrtc/media/base/videoframefactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698