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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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), |
95 cricket::FOURCC_I420)); | 95 cricket::FOURCC_I420)); |
96 capturer_->ResetSupportedFormats(formats); | 96 capturer_->ResetSupportedFormats(formats); |
97 | 97 |
98 EXPECT_EQ(cricket::CS_RUNNING, | 98 EXPECT_EQ(cricket::CS_RUNNING, |
99 capturer_->Start(cricket::VideoFormat( | 99 capturer_->Start(cricket::VideoFormat( |
100 kWidth, kHeight, cricket::VideoFormat::FpsToInterval(30), | 100 kWidth, kHeight, cricket::VideoFormat::FpsToInterval(30), |
101 cricket::FOURCC_ANY))); | 101 cricket::FOURCC_I420))); |
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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 capturer_->set_enable_camera_list(true); | 778 capturer_->set_enable_camera_list(true); |
779 capturer_->ConstrainSupportedFormats(vga_format); | 779 capturer_->ConstrainSupportedFormats(vga_format); |
780 EXPECT_EQ(2u, capturer_->GetSupportedFormats()->size()); | 780 EXPECT_EQ(2u, capturer_->GetSupportedFormats()->size()); |
781 // 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 |
782 // try again. This time, only the VGA format should be there. | 782 // try again. This time, only the VGA format should be there. |
783 supported_formats.push_back(vga_format); | 783 supported_formats.push_back(vga_format); |
784 capturer_->ResetSupportedFormats(supported_formats); | 784 capturer_->ResetSupportedFormats(supported_formats); |
785 ASSERT_EQ(1u, capturer_->GetSupportedFormats()->size()); | 785 ASSERT_EQ(1u, capturer_->GetSupportedFormats()->size()); |
786 EXPECT_EQ(vga_format.height, capturer_->GetSupportedFormats()->at(0).height); | 786 EXPECT_EQ(vga_format.height, capturer_->GetSupportedFormats()->at(0).height); |
787 } | 787 } |
OLD | NEW |