OLD | NEW |
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 Loading... |
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), | 94 cricket::VideoFormat::FpsToInterval(5), cricket::FOURCC_ARGB)); |
95 cricket::FOURCC_I420)); | |
96 capturer_->ResetSupportedFormats(formats); | 95 capturer_->ResetSupportedFormats(formats); |
97 | 96 |
98 EXPECT_EQ(cricket::CS_RUNNING, | 97 EXPECT_EQ(cricket::CS_RUNNING, capturer_->Start(cricket::VideoFormat( |
99 capturer_->Start(cricket::VideoFormat( | 98 kWidth, |
100 kWidth, kHeight, cricket::VideoFormat::FpsToInterval(30), | 99 kHeight, |
101 cricket::FOURCC_ANY))); | 100 cricket::VideoFormat::FpsToInterval(30), |
| 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 Loading... |
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. | |
252 TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) { | 248 TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) { |
253 EXPECT_EQ(cricket::CS_RUNNING, | 249 EXPECT_EQ(cricket::CS_RUNNING, |
254 capturer_->Start(cricket::VideoFormat( | 250 capturer_->Start(cricket::VideoFormat( |
255 1280, 720, cricket::VideoFormat::FpsToInterval(30), | 251 1280, 720, cricket::VideoFormat::FpsToInterval(30), |
256 cricket::FOURCC_I420))); | 252 cricket::FOURCC_I420))); |
257 EXPECT_TRUE(capturer_->IsRunning()); | 253 EXPECT_TRUE(capturer_->IsRunning()); |
258 | 254 |
259 EXPECT_EQ(0, renderer_.num_rendered_frames()); | 255 EXPECT_EQ(0, renderer_.num_rendered_frames()); |
260 EXPECT_TRUE(capturer_->CaptureFrame()); | 256 EXPECT_TRUE(capturer_->CaptureFrame()); |
261 EXPECT_EQ(1, renderer_.num_rendered_frames()); | 257 EXPECT_EQ(1, renderer_.num_rendered_frames()); |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 capturer_->set_enable_camera_list(true); | 774 capturer_->set_enable_camera_list(true); |
779 capturer_->ConstrainSupportedFormats(vga_format); | 775 capturer_->ConstrainSupportedFormats(vga_format); |
780 EXPECT_EQ(2u, capturer_->GetSupportedFormats()->size()); | 776 EXPECT_EQ(2u, capturer_->GetSupportedFormats()->size()); |
781 // To make sure it's not just the camera list being broken, add in VGA and | 777 // To make sure it's not just the camera list being broken, add in VGA and |
782 // try again. This time, only the VGA format should be there. | 778 // try again. This time, only the VGA format should be there. |
783 supported_formats.push_back(vga_format); | 779 supported_formats.push_back(vga_format); |
784 capturer_->ResetSupportedFormats(supported_formats); | 780 capturer_->ResetSupportedFormats(supported_formats); |
785 ASSERT_EQ(1u, capturer_->GetSupportedFormats()->size()); | 781 ASSERT_EQ(1u, capturer_->GetSupportedFormats()->size()); |
786 EXPECT_EQ(vga_format.height, capturer_->GetSupportedFormats()->at(0).height); | 782 EXPECT_EQ(vga_format.height, capturer_->GetSupportedFormats()->at(0).height); |
787 } | 783 } |
OLD | NEW |