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 | 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 "media/base/bind_to_current_loop.h" | 22 #include "media/base/bind_to_current_loop.h" |
23 #include "media/base/video_capture_types.h" | |
24 #include "media/capture/video/video_capture_device_factory.h" | 23 #include "media/capture/video/video_capture_device_factory.h" |
| 24 #include "media/capture/video_capture_types.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 "media/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 "media/base/mac/avfoundation_glue.h" | 35 #include "media/base/mac/avfoundation_glue.h" |
36 #include "media/capture/video/mac/video_capture_device_factory_mac.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/build_info.h" |
40 #include "base/android/jni_android.h" | 41 #include "base/android/jni_android.h" |
41 #include "base/android/build_info.h" | |
42 #include "media/capture/video/android/video_capture_device_android.h" | 42 #include "media/capture/video/android/video_capture_device_android.h" |
43 #include "media/capture/video/android/video_capture_device_factory_android.h" | 43 #include "media/capture/video/android/video_capture_device_factory_android.h" |
44 #endif | 44 #endif |
45 | 45 |
46 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
47 // Mac will always give you the size you ask for and this case will fail. | 47 // Mac will always give you the size you ask for and this case will fail. |
48 #define MAYBE_AllocateBadSize DISABLED_AllocateBadSize | 48 #define MAYBE_AllocateBadSize DISABLED_AllocateBadSize |
49 // We will always get YUYV from the Mac AVFoundation implementations. | 49 // We will always get YUYV from the Mac AVFoundation implementations. |
50 #define MAYBE_CaptureMjpeg DISABLED_CaptureMjpeg | 50 #define MAYBE_CaptureMjpeg DISABLED_CaptureMjpeg |
51 #define MAYBE_TakePhoto TakePhoto | 51 #define MAYBE_TakePhoto TakePhoto |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 630 |
631 device->GetPhotoCapabilities(std::move(scoped_get_callback)); | 631 device->GetPhotoCapabilities(std::move(scoped_get_callback)); |
632 run_loop.Run(); | 632 run_loop.Run(); |
633 | 633 |
634 ASSERT_TRUE(image_capture_client_->capabilities()); | 634 ASSERT_TRUE(image_capture_client_->capabilities()); |
635 | 635 |
636 device->StopAndDeAllocate(); | 636 device->StopAndDeAllocate(); |
637 } | 637 } |
638 | 638 |
639 }; // namespace media | 639 }; // namespace media |
OLD | NEW |