OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 VideoCaptureCapability resulting_capability; | 267 VideoCaptureCapability resulting_capability; |
268 EXPECT_EQ(0, capture_module->CaptureSettings(resulting_capability)); | 268 EXPECT_EQ(0, capture_module->CaptureSettings(resulting_capability)); |
269 EXPECT_EQ(capability.width, resulting_capability.width); | 269 EXPECT_EQ(capability.width, resulting_capability.width); |
270 EXPECT_EQ(capability.height, resulting_capability.height); | 270 EXPECT_EQ(capability.height, resulting_capability.height); |
271 } | 271 } |
272 | 272 |
273 scoped_ptr<VideoCaptureModule::DeviceInfo> device_info_; | 273 scoped_ptr<VideoCaptureModule::DeviceInfo> device_info_; |
274 unsigned int number_of_devices_; | 274 unsigned int number_of_devices_; |
275 }; | 275 }; |
276 | 276 |
277 TEST_F(VideoCaptureTest, CreateDelete) { | 277 #ifdef WEBRTC_MAC |
278 // Currently fails on Mac 64-bit, see | |
279 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5406 | |
280 #define MAYBE_CreateDelete DISABLED_CreateDelete | |
281 #else | |
282 #define MAYBE_CreateDelete CreateDelete | |
283 #endif | |
284 TEST_F(VideoCaptureTest, MAYBE_CreateDelete) { | |
278 for (int i = 0; i < 5; ++i) { | 285 for (int i = 0; i < 5; ++i) { |
279 int64_t start_time = TickTime::MillisecondTimestamp(); | 286 int64_t start_time = TickTime::MillisecondTimestamp(); |
280 TestVideoCaptureCallback capture_observer; | 287 TestVideoCaptureCallback capture_observer; |
281 rtc::scoped_refptr<VideoCaptureModule> module( | 288 rtc::scoped_refptr<VideoCaptureModule> module( |
282 OpenVideoCaptureDevice(0, &capture_observer)); | 289 OpenVideoCaptureDevice(0, &capture_observer)); |
283 ASSERT_TRUE(module.get() != NULL); | 290 ASSERT_TRUE(module.get() != NULL); |
284 | 291 |
285 VideoCaptureCapability capability; | 292 VideoCaptureCapability capability; |
286 #ifndef WEBRTC_MAC | 293 #ifndef WEBRTC_MAC |
287 device_info_->GetCapability(module->CurrentDeviceName(), 0, capability); | 294 device_info_->GetCapability(module->CurrentDeviceName(), 0, capability); |
(...skipping 16 matching lines...) Expand all Loading... | |
304 | 311 |
305 int64_t stop_time = TickTime::MillisecondTimestamp(); | 312 int64_t stop_time = TickTime::MillisecondTimestamp(); |
306 EXPECT_EQ(0, module->StopCapture()); | 313 EXPECT_EQ(0, module->StopCapture()); |
307 EXPECT_FALSE(module->CaptureStarted()); | 314 EXPECT_FALSE(module->CaptureStarted()); |
308 | 315 |
309 // Less than 3s to stop the camera. | 316 // Less than 3s to stop the camera. |
310 EXPECT_LE(TickTime::MillisecondTimestamp() - stop_time, 3000); | 317 EXPECT_LE(TickTime::MillisecondTimestamp() - stop_time, 3000); |
311 } | 318 } |
312 } | 319 } |
313 | 320 |
314 TEST_F(VideoCaptureTest, Capabilities) { | 321 #ifdef WEBRTC_MAC |
322 // Currently fails on Mac 64-bit, see | |
323 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5406 | |
324 #define MAYBE_Capabilities DISABLED_Capabilities | |
325 #else | |
326 #define MAYBE_Capabilities Capabilities | |
327 #endif | |
328 TEST_F(VideoCaptureTest, MAYBE_Capabilities) { | |
315 #ifdef WEBRTC_MAC | 329 #ifdef WEBRTC_MAC |
316 printf("Video capture capabilities are not supported on Mac.\n"); | 330 printf("Video capture capabilities are not supported on Mac.\n"); |
kjellander_webrtc
2016/01/06 13:18:51
I know this looks odd. But now I just want to get
| |
317 return; | 331 return; |
318 #endif | 332 #endif |
319 | 333 |
320 TestVideoCaptureCallback capture_observer; | 334 TestVideoCaptureCallback capture_observer; |
321 | 335 |
322 rtc::scoped_refptr<VideoCaptureModule> module( | 336 rtc::scoped_refptr<VideoCaptureModule> module( |
323 OpenVideoCaptureDevice(0, &capture_observer)); | 337 OpenVideoCaptureDevice(0, &capture_observer)); |
324 ASSERT_TRUE(module.get() != NULL); | 338 ASSERT_TRUE(module.get() != NULL); |
325 | 339 |
326 int number_of_capabilities = device_info_->NumberOfCapabilities( | 340 int number_of_capabilities = device_info_->NumberOfCapabilities( |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 length, capture_callback_.capability(), 0)); | 549 length, capture_callback_.capability(), 0)); |
536 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); | 550 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); |
537 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); | 551 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); |
538 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 552 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
539 length, capture_callback_.capability(), 0)); | 553 length, capture_callback_.capability(), 0)); |
540 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); | 554 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); |
541 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); | 555 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); |
542 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 556 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
543 length, capture_callback_.capability(), 0)); | 557 length, capture_callback_.capability(), 0)); |
544 } | 558 } |
OLD | NEW |