henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 2 | * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
kwiberg | d1fe281 | 2016-04-27 06:47:29 -0700 | [diff] [blame] | 11 | #include <memory> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 12 | #include <string> |
Steve Anton | 36b29d1 | 2017-10-30 09:57:42 -0700 | [diff] [blame] | 13 | #include <utility> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 14 | #include <vector> |
| 15 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "api/test/fakeconstraints.h" |
| 17 | #include "media/base/fakemediaengine.h" |
| 18 | #include "media/base/fakevideocapturer.h" |
| 19 | #include "media/base/fakevideorenderer.h" |
| 20 | #include "pc/videocapturertracksource.h" |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 21 | #include "rtc_base/arraysize.h" |
| 22 | #include "rtc_base/event.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 23 | #include "rtc_base/gunit.h" |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 24 | #include "rtc_base/task_queue.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 25 | |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 26 | using cricket::FOURCC_I420; |
| 27 | using cricket::VideoFormat; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 28 | using webrtc::FakeConstraints; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 29 | using webrtc::MediaConstraintsInterface; |
| 30 | using webrtc::MediaSourceInterface; |
| 31 | using webrtc::ObserverInterface; |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 32 | using webrtc::VideoCapturerTrackSource; |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 33 | using webrtc::VideoTrackSourceInterface; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 34 | |
| 35 | namespace { |
| 36 | |
| 37 | // Max wait time for a test. |
| 38 | const int kMaxWaitMs = 100; |
| 39 | |
| 40 | } // anonymous namespace |
| 41 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 42 | // TestVideoCapturer extends cricket::FakeVideoCapturer so it can be used for |
| 43 | // testing without known camera formats. |
| 44 | // It keeps its own lists of cricket::VideoFormats for the unit tests in this |
| 45 | // file. |
| 46 | class TestVideoCapturer : public cricket::FakeVideoCapturer { |
| 47 | public: |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 48 | explicit TestVideoCapturer(bool is_screencast) |
| 49 | : FakeVideoCapturer(is_screencast), test_without_formats_(false) { |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 50 | static const auto fps = VideoFormat::FpsToInterval(30); |
| 51 | static const VideoFormat formats[] = { |
| 52 | {1280, 720, fps, FOURCC_I420}, {640, 480, fps, FOURCC_I420}, |
| 53 | {640, 400, fps, FOURCC_I420}, {320, 240, fps, FOURCC_I420}, |
| 54 | {352, 288, fps, FOURCC_I420}, |
| 55 | }; |
| 56 | ResetSupportedFormats({&formats[0], &formats[arraysize(formats)]}); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | // This function is used for resetting the supported capture formats and |
| 60 | // simulating a cricket::VideoCapturer implementation that don't support |
| 61 | // capture format enumeration. This is used to simulate the current |
| 62 | // Chrome implementation. |
| 63 | void TestWithoutCameraFormats() { |
| 64 | test_without_formats_ = true; |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 65 | std::vector<VideoFormat> formats; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 66 | ResetSupportedFormats(formats); |
| 67 | } |
| 68 | |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 69 | virtual cricket::CaptureState Start(const VideoFormat& capture_format) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 70 | if (test_without_formats_) { |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 71 | std::vector<VideoFormat> formats; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 72 | formats.push_back(capture_format); |
| 73 | ResetSupportedFormats(formats); |
| 74 | } |
| 75 | return FakeVideoCapturer::Start(capture_format); |
| 76 | } |
| 77 | |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 78 | virtual bool GetBestCaptureFormat(const VideoFormat& desired, |
| 79 | VideoFormat* best_format) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 80 | if (test_without_formats_) { |
| 81 | *best_format = desired; |
| 82 | return true; |
| 83 | } |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 84 | return FakeVideoCapturer::GetBestCaptureFormat(desired, best_format); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | private: |
| 88 | bool test_without_formats_; |
| 89 | }; |
| 90 | |
| 91 | class StateObserver : public ObserverInterface { |
| 92 | public: |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 93 | explicit StateObserver(VideoTrackSourceInterface* source) |
| 94 | : state_(source->state()), source_(source) {} |
| 95 | virtual void OnChanged() { state_ = source_->state(); } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 96 | MediaSourceInterface::SourceState state() const { return state_; } |
| 97 | |
| 98 | private: |
| 99 | MediaSourceInterface::SourceState state_; |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 100 | rtc::scoped_refptr<VideoTrackSourceInterface> source_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 101 | }; |
| 102 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 103 | class VideoCapturerTrackSourceTest : public testing::Test { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 104 | protected: |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 105 | VideoCapturerTrackSourceTest() { InitCapturer(false); } |
Niels Möller | 60653ba | 2016-03-02 11:41:36 +0100 | [diff] [blame] | 106 | void InitCapturer(bool is_screencast) { |
deadbeef | 112b2e9 | 2017-02-10 20:13:37 -0800 | [diff] [blame] | 107 | capturer_ = new TestVideoCapturer(is_screencast); |
| 108 | capturer_cleanup_.reset(capturer_); |
Niels Möller | 60653ba | 2016-03-02 11:41:36 +0100 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | void InitScreencast() { InitCapturer(true); } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 112 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 113 | void CreateVideoCapturerSource() { CreateVideoCapturerSource(NULL); } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 114 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 115 | void CreateVideoCapturerSource( |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 116 | const webrtc::MediaConstraintsInterface* constraints) { |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 117 | source_ = VideoCapturerTrackSource::Create(rtc::Thread::Current(), |
deadbeef | 112b2e9 | 2017-02-10 20:13:37 -0800 | [diff] [blame] | 118 | std::move(capturer_cleanup_), |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 119 | constraints, false); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 120 | |
wu@webrtc.org | 967bfff | 2013-09-19 05:49:50 +0000 | [diff] [blame] | 121 | ASSERT_TRUE(source_.get() != NULL); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 122 | |
wu@webrtc.org | 967bfff | 2013-09-19 05:49:50 +0000 | [diff] [blame] | 123 | state_observer_.reset(new StateObserver(source_)); |
| 124 | source_->RegisterObserver(state_observer_.get()); |
perkj | f2880a0 | 2016-03-03 01:51:52 -0800 | [diff] [blame] | 125 | source_->AddOrUpdateSink(&renderer_, rtc::VideoSinkWants()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 126 | } |
| 127 | |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 128 | void CaptureSingleFrame() { |
| 129 | rtc::Event event(false, false); |
| 130 | task_queue_.PostTask([this, &event]() { |
| 131 | ASSERT_TRUE(capturer_->CaptureFrame()); |
| 132 | event.Set(); |
| 133 | }); |
| 134 | event.Wait(rtc::Event::kForever); |
| 135 | } |
| 136 | |
| 137 | rtc::TaskQueue task_queue_{"VideoCapturerTrackSourceTest"}; |
deadbeef | 112b2e9 | 2017-02-10 20:13:37 -0800 | [diff] [blame] | 138 | std::unique_ptr<cricket::VideoCapturer> capturer_cleanup_; |
mallinath@webrtc.org | 1112c30 | 2013-09-23 20:34:45 +0000 | [diff] [blame] | 139 | TestVideoCapturer* capturer_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 140 | cricket::FakeVideoRenderer renderer_; |
kwiberg | d1fe281 | 2016-04-27 06:47:29 -0700 | [diff] [blame] | 141 | std::unique_ptr<StateObserver> state_observer_; |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 142 | rtc::scoped_refptr<VideoTrackSourceInterface> source_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 143 | }; |
| 144 | |
wu@webrtc.org | 967bfff | 2013-09-19 05:49:50 +0000 | [diff] [blame] | 145 | // Test that a VideoSource transition to kLive state when the capture |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 146 | // device have started and kEnded if it is stopped. |
| 147 | // It also test that an output can receive video frames. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 148 | TEST_F(VideoCapturerTrackSourceTest, CapturerStartStop) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 149 | // Initialize without constraints. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 150 | CreateVideoCapturerSource(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 151 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 152 | kMaxWaitMs); |
| 153 | |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 154 | CaptureSingleFrame(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 155 | EXPECT_EQ(1, renderer_.num_rendered_frames()); |
| 156 | |
| 157 | capturer_->Stop(); |
| 158 | EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
| 159 | kMaxWaitMs); |
| 160 | } |
| 161 | |
wu@webrtc.org | 967bfff | 2013-09-19 05:49:50 +0000 | [diff] [blame] | 162 | // Test that a VideoSource transition to kEnded if the capture device |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 163 | // fails. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 164 | TEST_F(VideoCapturerTrackSourceTest, CameraFailed) { |
| 165 | CreateVideoCapturerSource(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 166 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 167 | kMaxWaitMs); |
| 168 | |
| 169 | capturer_->SignalStateChange(capturer_, cricket::CS_FAILED); |
| 170 | EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
| 171 | kMaxWaitMs); |
| 172 | } |
| 173 | |
| 174 | // Test that the capture output is CIF if we set max constraints to CIF. |
| 175 | // and the capture device support CIF. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 176 | TEST_F(VideoCapturerTrackSourceTest, MandatoryConstraintCif5Fps) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 177 | FakeConstraints constraints; |
| 178 | constraints.AddMandatory(MediaConstraintsInterface::kMaxWidth, 352); |
| 179 | constraints.AddMandatory(MediaConstraintsInterface::kMaxHeight, 288); |
| 180 | constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 5); |
| 181 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 182 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 183 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 184 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 185 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 186 | ASSERT_TRUE(format != NULL); |
| 187 | EXPECT_EQ(352, format->width); |
| 188 | EXPECT_EQ(288, format->height); |
perkj | fa10b55 | 2016-10-02 23:45:26 -0700 | [diff] [blame] | 189 | EXPECT_EQ(5, format->framerate()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | // Test that the capture output is 720P if the camera support it and the |
| 193 | // optional constraint is set to 720P. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 194 | TEST_F(VideoCapturerTrackSourceTest, MandatoryMinVgaOptional720P) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 195 | FakeConstraints constraints; |
| 196 | constraints.AddMandatory(MediaConstraintsInterface::kMinWidth, 640); |
| 197 | constraints.AddMandatory(MediaConstraintsInterface::kMinHeight, 480); |
| 198 | constraints.AddOptional(MediaConstraintsInterface::kMinWidth, 1280); |
| 199 | constraints.AddOptional(MediaConstraintsInterface::kMinAspectRatio, |
| 200 | 1280.0 / 720); |
| 201 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 202 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 203 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 204 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 205 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 206 | ASSERT_TRUE(format != NULL); |
| 207 | EXPECT_EQ(1280, format->width); |
| 208 | EXPECT_EQ(720, format->height); |
| 209 | EXPECT_EQ(30, format->framerate()); |
| 210 | } |
| 211 | |
| 212 | // Test that the capture output have aspect ratio 4:3 if a mandatory constraint |
| 213 | // require it even if an optional constraint request a higher resolution |
| 214 | // that don't have this aspect ratio. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 215 | TEST_F(VideoCapturerTrackSourceTest, MandatoryAspectRatio4To3) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 216 | FakeConstraints constraints; |
| 217 | constraints.AddMandatory(MediaConstraintsInterface::kMinWidth, 640); |
| 218 | constraints.AddMandatory(MediaConstraintsInterface::kMinHeight, 480); |
| 219 | constraints.AddMandatory(MediaConstraintsInterface::kMaxAspectRatio, |
| 220 | 640.0 / 480); |
| 221 | constraints.AddOptional(MediaConstraintsInterface::kMinWidth, 1280); |
| 222 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 223 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 224 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 225 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 226 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 227 | ASSERT_TRUE(format != NULL); |
| 228 | EXPECT_EQ(640, format->width); |
| 229 | EXPECT_EQ(480, format->height); |
| 230 | EXPECT_EQ(30, format->framerate()); |
| 231 | } |
| 232 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 233 | // Test that the source state transition to kEnded if the mandatory aspect ratio |
| 234 | // is set higher than supported. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 235 | TEST_F(VideoCapturerTrackSourceTest, MandatoryAspectRatioTooHigh) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 236 | FakeConstraints constraints; |
| 237 | constraints.AddMandatory(MediaConstraintsInterface::kMinAspectRatio, 2); |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 238 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 239 | EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
| 240 | kMaxWaitMs); |
| 241 | } |
| 242 | |
| 243 | // Test that the source ignores an optional aspect ratio that is higher than |
| 244 | // supported. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 245 | TEST_F(VideoCapturerTrackSourceTest, OptionalAspectRatioTooHigh) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 246 | FakeConstraints constraints; |
| 247 | constraints.AddOptional(MediaConstraintsInterface::kMinAspectRatio, 2); |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 248 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 249 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 250 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 251 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 252 | ASSERT_TRUE(format != NULL); |
| 253 | double aspect_ratio = static_cast<double>(format->width) / format->height; |
| 254 | EXPECT_LT(aspect_ratio, 2); |
| 255 | } |
| 256 | |
| 257 | // Test that the source starts video with the default resolution if the |
| 258 | // camera doesn't support capability enumeration and there are no constraints. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 259 | TEST_F(VideoCapturerTrackSourceTest, NoCameraCapability) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 260 | capturer_->TestWithoutCameraFormats(); |
| 261 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 262 | CreateVideoCapturerSource(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 263 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 264 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 265 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 266 | ASSERT_TRUE(format != NULL); |
| 267 | EXPECT_EQ(640, format->width); |
| 268 | EXPECT_EQ(480, format->height); |
| 269 | EXPECT_EQ(30, format->framerate()); |
| 270 | } |
| 271 | |
| 272 | // Test that the source can start the video and get the requested aspect ratio |
| 273 | // if the camera doesn't support capability enumeration and the aspect ratio is |
| 274 | // set. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 275 | TEST_F(VideoCapturerTrackSourceTest, NoCameraCapability16To9Ratio) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 276 | capturer_->TestWithoutCameraFormats(); |
| 277 | |
| 278 | FakeConstraints constraints; |
| 279 | double requested_aspect_ratio = 640.0 / 360; |
| 280 | constraints.AddMandatory(MediaConstraintsInterface::kMinWidth, 640); |
| 281 | constraints.AddMandatory(MediaConstraintsInterface::kMinAspectRatio, |
| 282 | requested_aspect_ratio); |
| 283 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 284 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 285 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 286 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 287 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 288 | double aspect_ratio = static_cast<double>(format->width) / format->height; |
| 289 | EXPECT_LE(requested_aspect_ratio, aspect_ratio); |
| 290 | } |
| 291 | |
| 292 | // Test that the source state transitions to kEnded if an unknown mandatory |
| 293 | // constraint is found. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 294 | TEST_F(VideoCapturerTrackSourceTest, InvalidMandatoryConstraint) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 295 | FakeConstraints constraints; |
| 296 | constraints.AddMandatory("weird key", 640); |
| 297 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 298 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 299 | EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
| 300 | kMaxWaitMs); |
| 301 | } |
| 302 | |
| 303 | // Test that the source ignores an unknown optional constraint. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 304 | TEST_F(VideoCapturerTrackSourceTest, InvalidOptionalConstraint) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 305 | FakeConstraints constraints; |
| 306 | constraints.AddOptional("weird key", 640); |
| 307 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 308 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 309 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 310 | kMaxWaitMs); |
| 311 | } |
| 312 | |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 313 | TEST_F(VideoCapturerTrackSourceTest, SetValidDenoisingConstraint) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 314 | FakeConstraints constraints; |
Per | c0d31e9 | 2016-03-31 17:23:39 +0200 | [diff] [blame] | 315 | constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, "false"); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 316 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 317 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 318 | |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 319 | EXPECT_EQ(false, source_->needs_denoising()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 320 | } |
| 321 | |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 322 | TEST_F(VideoCapturerTrackSourceTest, NoiseReductionConstraintNotSet) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 323 | FakeConstraints constraints; |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 324 | CreateVideoCapturerSource(&constraints); |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 325 | EXPECT_EQ(rtc::nullopt, source_->needs_denoising()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 326 | } |
| 327 | |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 328 | TEST_F(VideoCapturerTrackSourceTest, |
| 329 | MandatoryDenoisingConstraintOverridesOptional) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 330 | FakeConstraints constraints; |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 331 | constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, false); |
| 332 | constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 333 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 334 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 335 | |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 336 | EXPECT_EQ(false, source_->needs_denoising()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 337 | } |
| 338 | |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 339 | TEST_F(VideoCapturerTrackSourceTest, NoiseReductionAndInvalidKeyOptional) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 340 | FakeConstraints constraints; |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 341 | constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 342 | constraints.AddOptional("invalidKey", false); |
| 343 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 344 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 345 | |
| 346 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 347 | kMaxWaitMs); |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 348 | EXPECT_EQ(true, source_->needs_denoising()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 349 | } |
| 350 | |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 351 | TEST_F(VideoCapturerTrackSourceTest, NoiseReductionAndInvalidKeyMandatory) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 352 | FakeConstraints constraints; |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 353 | constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, false); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 354 | constraints.AddMandatory("invalidKey", false); |
| 355 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 356 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 357 | |
| 358 | EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 359 | kMaxWaitMs); |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 360 | EXPECT_EQ(rtc::nullopt, source_->needs_denoising()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 361 | } |
| 362 | |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 363 | TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueOptional) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 364 | FakeConstraints constraints; |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 365 | constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, |
| 366 | "not a boolean"); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 367 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 368 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 369 | |
| 370 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 371 | kMaxWaitMs); |
Per | c0d31e9 | 2016-03-31 17:23:39 +0200 | [diff] [blame] | 372 | |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 373 | EXPECT_EQ(rtc::nullopt, source_->needs_denoising()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 374 | } |
| 375 | |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 376 | TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueMandatory) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 377 | FakeConstraints constraints; |
| 378 | // Optional constraints should be ignored if the mandatory constraints fail. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 379 | constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, "false"); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 380 | // Values are case-sensitive and must be all lower-case. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 381 | constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, "True"); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 382 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 383 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 384 | |
| 385 | EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 386 | kMaxWaitMs); |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 387 | EXPECT_EQ(rtc::nullopt, source_->needs_denoising()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 388 | } |
| 389 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 390 | TEST_F(VideoCapturerTrackSourceTest, MixedOptionsAndConstraints) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 391 | FakeConstraints constraints; |
| 392 | constraints.AddMandatory(MediaConstraintsInterface::kMaxWidth, 352); |
| 393 | constraints.AddMandatory(MediaConstraintsInterface::kMaxHeight, 288); |
| 394 | constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 5); |
| 395 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 396 | constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, false); |
| 397 | constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 398 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 399 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 400 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 401 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 402 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 403 | ASSERT_TRUE(format != NULL); |
| 404 | EXPECT_EQ(352, format->width); |
| 405 | EXPECT_EQ(288, format->height); |
perkj | fa10b55 | 2016-10-02 23:45:26 -0700 | [diff] [blame] | 406 | EXPECT_EQ(5, format->framerate()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 407 | |
Oskar Sundbom | 36f8f3e | 2017-11-16 10:54:27 +0100 | [diff] [blame] | 408 | EXPECT_EQ(false, source_->needs_denoising()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 409 | } |
| 410 | |
| 411 | // Tests that the source starts video with the default resolution for |
| 412 | // screencast if no constraint is set. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 413 | TEST_F(VideoCapturerTrackSourceTest, ScreencastResolutionNoConstraint) { |
Niels Möller | 60653ba | 2016-03-02 11:41:36 +0100 | [diff] [blame] | 414 | InitScreencast(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 415 | capturer_->TestWithoutCameraFormats(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 416 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 417 | CreateVideoCapturerSource(); |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 418 | ASSERT_TRUE(source_->is_screencast()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 419 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 420 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 421 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 422 | ASSERT_TRUE(format != NULL); |
| 423 | EXPECT_EQ(640, format->width); |
| 424 | EXPECT_EQ(480, format->height); |
| 425 | EXPECT_EQ(30, format->framerate()); |
| 426 | } |
| 427 | |
| 428 | // Tests that the source starts video with the max width and height set by |
| 429 | // constraints for screencast. |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 430 | TEST_F(VideoCapturerTrackSourceTest, ScreencastResolutionWithConstraint) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 431 | FakeConstraints constraints; |
| 432 | constraints.AddMandatory(MediaConstraintsInterface::kMaxWidth, 480); |
| 433 | constraints.AddMandatory(MediaConstraintsInterface::kMaxHeight, 270); |
| 434 | |
Niels Möller | 60653ba | 2016-03-02 11:41:36 +0100 | [diff] [blame] | 435 | InitScreencast(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 436 | capturer_->TestWithoutCameraFormats(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 437 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 438 | CreateVideoCapturerSource(&constraints); |
perkj | 0d3eef2 | 2016-03-09 02:39:17 +0100 | [diff] [blame] | 439 | ASSERT_TRUE(source_->is_screencast()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 440 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 441 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 442 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 443 | ASSERT_TRUE(format != NULL); |
| 444 | EXPECT_EQ(480, format->width); |
| 445 | EXPECT_EQ(270, format->height); |
| 446 | EXPECT_EQ(30, format->framerate()); |
| 447 | } |
| 448 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 449 | TEST_F(VideoCapturerTrackSourceTest, MandatorySubOneFpsConstraints) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 450 | FakeConstraints constraints; |
| 451 | constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 0.5); |
| 452 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 453 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 454 | EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
| 455 | kMaxWaitMs); |
| 456 | ASSERT_TRUE(capturer_->GetCaptureFormat() == NULL); |
| 457 | } |
| 458 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 459 | TEST_F(VideoCapturerTrackSourceTest, OptionalSubOneFpsConstraints) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 460 | FakeConstraints constraints; |
| 461 | constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); |
| 462 | |
perkj | a3ede6c | 2016-03-08 01:27:48 +0100 | [diff] [blame] | 463 | CreateVideoCapturerSource(&constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 464 | EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
| 465 | kMaxWaitMs); |
Tommi | 1f432e0 | 2018-02-05 23:01:43 +0100 | [diff] [blame] | 466 | const VideoFormat* format = capturer_->GetCaptureFormat(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 467 | ASSERT_TRUE(format != NULL); |
perkj | fa10b55 | 2016-10-02 23:45:26 -0700 | [diff] [blame] | 468 | EXPECT_EQ(1, format->framerate()); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 469 | } |