| 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 "device/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 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 18 #include "base/test/test_timeouts.h" | 18 #include "base/test/test_timeouts.h" |
| 19 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "device/capture/video/video_capture_device_factory.h" |
| 22 #include "media/base/bind_to_current_loop.h" | 23 #include "media/base/bind_to_current_loop.h" |
| 23 #include "media/base/video_capture_types.h" | 24 #include "media/base/video_capture_types.h" |
| 24 #include "media/capture/video/video_capture_device_factory.h" | |
| 25 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 27 |
| 28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 29 #include "base/win/scoped_com_initializer.h" | 29 #include "base/win/scoped_com_initializer.h" |
| 30 #include "base/win/windows_version.h" // For fine-grained suppression. | 30 #include "base/win/windows_version.h" // For fine-grained suppression. |
| 31 #include "media/capture/video/win/video_capture_device_factory_win.h" | 31 #include "device/capture/video/win/video_capture_device_factory_win.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 #if defined(OS_MACOSX) | 34 #if defined(OS_MACOSX) |
| 35 #include "device/capture/video/mac/video_capture_device_factory_mac.h" |
| 35 #include "media/base/mac/avfoundation_glue.h" | 36 #include "media/base/mac/avfoundation_glue.h" |
| 36 #include "media/capture/video/mac/video_capture_device_factory_mac.h" | |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
| 40 #include "base/android/jni_android.h" | 40 #include "base/android/jni_android.h" |
| 41 #include "media/capture/video/android/video_capture_device_android.h" | 41 #include "device/capture/video/android/video_capture_device_android.h" |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 #if defined(OS_MACOSX) | 44 #if defined(OS_MACOSX) |
| 45 // Mac will always give you the size you ask for and this case will fail. | 45 // Mac will always give you the size you ask for and this case will fail. |
| 46 #define MAYBE_AllocateBadSize DISABLED_AllocateBadSize | 46 #define MAYBE_AllocateBadSize DISABLED_AllocateBadSize |
| 47 // We will always get YUYV from the Mac AVFoundation implementations. | 47 // We will always get YUYV from the Mac AVFoundation implementations. |
| 48 #define MAYBE_CaptureMjpeg DISABLED_CaptureMjpeg | 48 #define MAYBE_CaptureMjpeg DISABLED_CaptureMjpeg |
| 49 #define MAYBE_TakePhoto TakePhoto | 49 #define MAYBE_TakePhoto TakePhoto |
| 50 #elif defined(OS_WIN) | 50 #elif defined(OS_WIN) |
| 51 #define MAYBE_AllocateBadSize AllocateBadSize | 51 #define MAYBE_AllocateBadSize AllocateBadSize |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 &MockImageCaptureClient::OnTakePhotoFailure, image_capture_client_))); | 546 &MockImageCaptureClient::OnTakePhotoFailure, image_capture_client_))); |
| 547 | 547 |
| 548 EXPECT_CALL(*image_capture_client_.get(), OnCorrectPhotoTaken()).Times(1); | 548 EXPECT_CALL(*image_capture_client_.get(), OnCorrectPhotoTaken()).Times(1); |
| 549 device->TakePhoto(std::move(scoped_callback)); | 549 device->TakePhoto(std::move(scoped_callback)); |
| 550 WaitForCapturedFrame(); | 550 WaitForCapturedFrame(); |
| 551 | 551 |
| 552 device->StopAndDeAllocate(); | 552 device->StopAndDeAllocate(); |
| 553 } | 553 } |
| 554 | 554 |
| 555 }; // namespace media | 555 }; // namespace media |
| OLD | NEW |