| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/media/capture/desktop_capture_device.h" | 5 #include "content/browser/media/capture/desktop_capture_device.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 DoAll(SaveArg<2>(&format), | 247 DoAll(SaveArg<2>(&format), |
| 248 InvokeWithoutArgs(&done_event, &base::WaitableEvent::Signal))); | 248 InvokeWithoutArgs(&done_event, &base::WaitableEvent::Signal))); |
| 249 | 249 |
| 250 media::VideoCaptureParams capture_params; | 250 media::VideoCaptureParams capture_params; |
| 251 capture_params.requested_format.frame_size.SetSize(kTestFrameWidth2, | 251 capture_params.requested_format.frame_size.SetSize(kTestFrameWidth2, |
| 252 kTestFrameHeight2); | 252 kTestFrameHeight2); |
| 253 capture_params.requested_format.frame_rate = kFrameRate; | 253 capture_params.requested_format.frame_rate = kFrameRate; |
| 254 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 254 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
| 255 | 255 |
| 256 capture_device_->AllocateAndStart( | 256 capture_device_->AllocateAndStart( |
| 257 capture_params, client.PassAs<media::VideoCaptureDevice::Client>()); | 257 capture_params, client.Pass()); |
| 258 | 258 |
| 259 // Capture at least three frames, to ensure that the source frame size has | 259 // Capture at least three frames, to ensure that the source frame size has |
| 260 // changed at least twice while capturing. | 260 // changed at least twice while capturing. |
| 261 EXPECT_TRUE(done_event.TimedWait(TestTimeouts::action_max_timeout())); | 261 EXPECT_TRUE(done_event.TimedWait(TestTimeouts::action_max_timeout())); |
| 262 done_event.Reset(); | 262 done_event.Reset(); |
| 263 EXPECT_TRUE(done_event.TimedWait(TestTimeouts::action_max_timeout())); | 263 EXPECT_TRUE(done_event.TimedWait(TestTimeouts::action_max_timeout())); |
| 264 done_event.Reset(); | 264 done_event.Reset(); |
| 265 EXPECT_TRUE(done_event.TimedWait(TestTimeouts::action_max_timeout())); | 265 EXPECT_TRUE(done_event.TimedWait(TestTimeouts::action_max_timeout())); |
| 266 | 266 |
| 267 capture_device_->StopAndDeAllocate(); | 267 capture_device_->StopAndDeAllocate(); |
| 268 | 268 |
| 269 EXPECT_EQ(kTestFrameWidth1, format.frame_size.width()); | 269 EXPECT_EQ(kTestFrameWidth1, format.frame_size.width()); |
| 270 EXPECT_EQ(kTestFrameHeight1, format.frame_size.height()); | 270 EXPECT_EQ(kTestFrameHeight1, format.frame_size.height()); |
| 271 EXPECT_EQ(kFrameRate, format.frame_rate); | 271 EXPECT_EQ(kFrameRate, format.frame_rate); |
| 272 EXPECT_EQ(media::PIXEL_FORMAT_ARGB, format.pixel_format); | 272 EXPECT_EQ(media::PIXEL_FORMAT_ARGB, format.pixel_format); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace content | 275 } // namespace content |
| OLD | NEW |