| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/capture/video/video_capture_device.h" | 5 #include "media/capture/video/video_capture_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 EXPECT_TRUE(device == NULL); | 287 EXPECT_TRUE(device == NULL); |
| 288 } else { | 288 } else { |
| 289 // The presence of the actual device is only checked on AllocateAndStart() | 289 // The presence of the actual device is only checked on AllocateAndStart() |
| 290 // and not on creation for QTKit API in Mac OS X platform. | 290 // and not on creation for QTKit API in Mac OS X platform. |
| 291 EXPECT_CALL(*client_, OnError(_, _)).Times(1); | 291 EXPECT_CALL(*client_, OnError(_, _)).Times(1); |
| 292 | 292 |
| 293 VideoCaptureParams capture_params; | 293 VideoCaptureParams capture_params; |
| 294 capture_params.requested_format.frame_size.SetSize(640, 480); | 294 capture_params.requested_format.frame_size.SetSize(640, 480); |
| 295 capture_params.requested_format.frame_rate = 30; | 295 capture_params.requested_format.frame_rate = 30; |
| 296 capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; | 296 capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; |
| 297 device->AllocateAndStart(capture_params, client_.Pass()); | 297 device->AllocateAndStart(capture_params, std::move(client_)); |
| 298 device->StopAndDeAllocate(); | 298 device->StopAndDeAllocate(); |
| 299 } | 299 } |
| 300 #endif | 300 #endif |
| 301 } | 301 } |
| 302 | 302 |
| 303 TEST_P(VideoCaptureDeviceTest, CaptureWithSize) { | 303 TEST_P(VideoCaptureDeviceTest, CaptureWithSize) { |
| 304 names_ = EnumerateDevices(); | 304 names_ = EnumerateDevices(); |
| 305 if (names_->empty()) { | 305 if (names_->empty()) { |
| 306 VLOG(1) << "No camera available. Exiting test."; | 306 VLOG(1) << "No camera available. Exiting test."; |
| 307 return; | 307 return; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // GetDeviceSupportedFormats(). | 478 // GetDeviceSupportedFormats(). |
| 479 scoped_ptr<VideoCaptureDevice::Name> name = | 479 scoped_ptr<VideoCaptureDevice::Name> name = |
| 480 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); | 480 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); |
| 481 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else | 481 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else |
| 482 // to test here | 482 // to test here |
| 483 // since we cannot forecast the hardware capabilities. | 483 // since we cannot forecast the hardware capabilities. |
| 484 ASSERT_FALSE(name); | 484 ASSERT_FALSE(name); |
| 485 } | 485 } |
| 486 | 486 |
| 487 }; // namespace media | 487 }; // namespace media |
| OLD | NEW |