OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 constraints.AddMandatory(MediaConstraintsInterface::kMaxHeight, 288); | 177 constraints.AddMandatory(MediaConstraintsInterface::kMaxHeight, 288); |
178 constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 5); | 178 constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 5); |
179 | 179 |
180 CreateVideoCapturerSource(&constraints); | 180 CreateVideoCapturerSource(&constraints); |
181 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), | 181 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
182 kMaxWaitMs); | 182 kMaxWaitMs); |
183 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); | 183 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); |
184 ASSERT_TRUE(format != NULL); | 184 ASSERT_TRUE(format != NULL); |
185 EXPECT_EQ(352, format->width); | 185 EXPECT_EQ(352, format->width); |
186 EXPECT_EQ(288, format->height); | 186 EXPECT_EQ(288, format->height); |
187 EXPECT_EQ(30, format->framerate()); | 187 EXPECT_EQ(5, format->framerate()); |
188 } | 188 } |
189 | 189 |
190 // Test that the capture output is 720P if the camera support it and the | 190 // Test that the capture output is 720P if the camera support it and the |
191 // optional constraint is set to 720P. | 191 // optional constraint is set to 720P. |
192 TEST_F(VideoCapturerTrackSourceTest, MandatoryMinVgaOptional720P) { | 192 TEST_F(VideoCapturerTrackSourceTest, MandatoryMinVgaOptional720P) { |
193 FakeConstraints constraints; | 193 FakeConstraints constraints; |
194 constraints.AddMandatory(MediaConstraintsInterface::kMinWidth, 640); | 194 constraints.AddMandatory(MediaConstraintsInterface::kMinWidth, 640); |
195 constraints.AddMandatory(MediaConstraintsInterface::kMinHeight, 480); | 195 constraints.AddMandatory(MediaConstraintsInterface::kMinHeight, 480); |
196 constraints.AddOptional(MediaConstraintsInterface::kMinWidth, 1280); | 196 constraints.AddOptional(MediaConstraintsInterface::kMinWidth, 1280); |
197 constraints.AddOptional(MediaConstraintsInterface::kMinAspectRatio, | 197 constraints.AddOptional(MediaConstraintsInterface::kMinAspectRatio, |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, false); | 394 constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, false); |
395 constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true); | 395 constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true); |
396 | 396 |
397 CreateVideoCapturerSource(&constraints); | 397 CreateVideoCapturerSource(&constraints); |
398 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), | 398 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
399 kMaxWaitMs); | 399 kMaxWaitMs); |
400 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); | 400 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); |
401 ASSERT_TRUE(format != NULL); | 401 ASSERT_TRUE(format != NULL); |
402 EXPECT_EQ(352, format->width); | 402 EXPECT_EQ(352, format->width); |
403 EXPECT_EQ(288, format->height); | 403 EXPECT_EQ(288, format->height); |
404 EXPECT_EQ(30, format->framerate()); | 404 EXPECT_EQ(5, format->framerate()); |
405 | 405 |
406 EXPECT_EQ(rtc::Optional<bool>(false), source_->needs_denoising()); | 406 EXPECT_EQ(rtc::Optional<bool>(false), source_->needs_denoising()); |
407 } | 407 } |
408 | 408 |
409 // Tests that the source starts video with the default resolution for | 409 // Tests that the source starts video with the default resolution for |
410 // screencast if no constraint is set. | 410 // screencast if no constraint is set. |
411 TEST_F(VideoCapturerTrackSourceTest, ScreencastResolutionNoConstraint) { | 411 TEST_F(VideoCapturerTrackSourceTest, ScreencastResolutionNoConstraint) { |
412 InitScreencast(); | 412 InitScreencast(); |
413 capturer_->TestWithoutCameraFormats(); | 413 capturer_->TestWithoutCameraFormats(); |
414 | 414 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 485 |
486 TEST_F(VideoCapturerTrackSourceTest, OptionalSubOneFpsConstraints) { | 486 TEST_F(VideoCapturerTrackSourceTest, OptionalSubOneFpsConstraints) { |
487 FakeConstraints constraints; | 487 FakeConstraints constraints; |
488 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); | 488 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); |
489 | 489 |
490 CreateVideoCapturerSource(&constraints); | 490 CreateVideoCapturerSource(&constraints); |
491 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), | 491 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
492 kMaxWaitMs); | 492 kMaxWaitMs); |
493 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); | 493 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); |
494 ASSERT_TRUE(format != NULL); | 494 ASSERT_TRUE(format != NULL); |
495 EXPECT_EQ(30, format->framerate()); | 495 EXPECT_EQ(1, format->framerate()); |
496 } | 496 } |
OLD | NEW |