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> |
(...skipping 14 matching lines...) Expand all Loading... |
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" | |
36 #include "media/capture/video/mac/video_capture_device_factory_mac.h" | 35 #include "media/capture/video/mac/video_capture_device_factory_mac.h" |
37 #endif | 36 #endif |
38 | 37 |
39 #if defined(OS_ANDROID) | 38 #if defined(OS_ANDROID) |
40 #include "base/android/build_info.h" | 39 #include "base/android/build_info.h" |
41 #include "base/android/jni_android.h" | 40 #include "base/android/jni_android.h" |
42 #include "media/capture/video/android/video_capture_device_android.h" | 41 #include "media/capture/video/android/video_capture_device_android.h" |
43 #include "media/capture/video/android/video_capture_device_factory_android.h" | 42 #include "media/capture/video/android/video_capture_device_factory_android.h" |
44 #endif | 43 #endif |
45 | 44 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 231 |
233 void SetUp() override { | 232 void SetUp() override { |
234 #if defined(OS_ANDROID) | 233 #if defined(OS_ANDROID) |
235 VideoCaptureDeviceAndroid::RegisterVideoCaptureDevice( | 234 VideoCaptureDeviceAndroid::RegisterVideoCaptureDevice( |
236 base::android::AttachCurrentThread()); | 235 base::android::AttachCurrentThread()); |
237 | 236 |
238 static_cast<VideoCaptureDeviceFactoryAndroid*>( | 237 static_cast<VideoCaptureDeviceFactoryAndroid*>( |
239 video_capture_device_factory_.get()) | 238 video_capture_device_factory_.get()) |
240 ->ConfigureForTesting(); | 239 ->ConfigureForTesting(); |
241 #endif | 240 #endif |
242 #if defined(OS_MACOSX) | |
243 AVFoundationGlue::InitializeAVFoundation(); | |
244 #endif | |
245 EXPECT_CALL(*video_capture_client_, DoReserveOutputBuffer()).Times(0); | 241 EXPECT_CALL(*video_capture_client_, DoReserveOutputBuffer()).Times(0); |
246 EXPECT_CALL(*video_capture_client_, DoOnIncomingCapturedBuffer()).Times(0); | 242 EXPECT_CALL(*video_capture_client_, DoOnIncomingCapturedBuffer()).Times(0); |
247 EXPECT_CALL(*video_capture_client_, DoOnIncomingCapturedVideoFrame()) | 243 EXPECT_CALL(*video_capture_client_, DoOnIncomingCapturedVideoFrame()) |
248 .Times(0); | 244 .Times(0); |
249 } | 245 } |
250 | 246 |
251 void ResetWithNewClient() { | 247 void ResetWithNewClient() { |
252 video_capture_client_.reset(new MockVideoCaptureClient(base::Bind( | 248 video_capture_client_.reset(new MockVideoCaptureClient(base::Bind( |
253 &VideoCaptureDeviceTest::OnFrameCaptured, base::Unretained(this)))); | 249 &VideoCaptureDeviceTest::OnFrameCaptured, base::Unretained(this)))); |
254 } | 250 } |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 | 625 |
630 device->GetPhotoCapabilities(std::move(scoped_get_callback)); | 626 device->GetPhotoCapabilities(std::move(scoped_get_callback)); |
631 run_loop.Run(); | 627 run_loop.Run(); |
632 | 628 |
633 ASSERT_TRUE(image_capture_client_->capabilities()); | 629 ASSERT_TRUE(image_capture_client_->capabilities()); |
634 | 630 |
635 device->StopAndDeAllocate(); | 631 device->StopAndDeAllocate(); |
636 } | 632 } |
637 | 633 |
638 }; // namespace media | 634 }; // namespace media |
OLD | NEW |