OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/video_capture/video_capture_service.h" | 5 #include "services/video_capture/video_capture_service.h" |
6 | 6 |
| 7 #include "media/capture/video/fake_video_capture_device.h" |
7 #include "services/video_capture/video_capture_device_factory_impl.h" | 8 #include "services/video_capture/video_capture_device_factory_impl.h" |
8 | 9 |
9 namespace { | 10 namespace { |
10 static const char kFakeDeviceDisplayName[] = "Fake Video Capture Device"; | 11 static const char kFakeDeviceDisplayName[] = "Fake Video Capture Device"; |
11 static const char kFakeDeviceId[] = "FakeDeviceId"; | 12 static const char kFakeDeviceId[] = "FakeDeviceId"; |
12 static const char kFakeModelId[] = "FakeModelId"; | 13 static const char kFakeModelId[] = "FakeModelId"; |
| 14 static const float kFakeCaptureDefaultFrameRate = 20.0f; |
13 } | 15 } |
14 | 16 |
15 namespace video_capture { | 17 namespace video_capture { |
16 | 18 |
17 VideoCaptureService::VideoCaptureService() = default; | 19 VideoCaptureService::VideoCaptureService() = default; |
18 | 20 |
19 VideoCaptureService::~VideoCaptureService() = default; | 21 VideoCaptureService::~VideoCaptureService() = default; |
20 | 22 |
21 bool VideoCaptureService::OnConnect(const shell::Identity& remote_identity, | 23 bool VideoCaptureService::OnConnect(const shell::Identity& remote_identity, |
22 shell::InterfaceRegistry* registry) { | 24 shell::InterfaceRegistry* registry) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 fake_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(); | 56 fake_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(); |
55 auto fake_device_descriptor = mojom::VideoCaptureDeviceDescriptor::New(); | 57 auto fake_device_descriptor = mojom::VideoCaptureDeviceDescriptor::New(); |
56 fake_device_descriptor->display_name = kFakeDeviceDisplayName; | 58 fake_device_descriptor->display_name = kFakeDeviceDisplayName; |
57 fake_device_descriptor->device_id = kFakeDeviceId; | 59 fake_device_descriptor->device_id = kFakeDeviceId; |
58 fake_device_descriptor->model_id = kFakeModelId; | 60 fake_device_descriptor->model_id = kFakeModelId; |
59 fake_device_descriptor->capture_api = mojom::VideoCaptureApi::UNKNOWN; | 61 fake_device_descriptor->capture_api = mojom::VideoCaptureApi::UNKNOWN; |
60 fake_device_descriptor->transport_type = | 62 fake_device_descriptor->transport_type = |
61 mojom::VideoCaptureTransportType::OTHER_TRANSPORT; | 63 mojom::VideoCaptureTransportType::OTHER_TRANSPORT; |
62 fake_device_factory_->AddDevice( | 64 fake_device_factory_->AddDevice( |
63 std::move(fake_device_descriptor), | 65 std::move(fake_device_descriptor), |
64 base::MakeUnique<VideoCaptureDeviceProxyImpl>()); | 66 base::MakeUnique<VideoCaptureDeviceProxyImpl>( |
| 67 base::MakeUnique<media::FakeVideoCaptureDevice>( |
| 68 media::FakeVideoCaptureDevice::BufferOwnership::OWN_BUFFERS, |
| 69 kFakeCaptureDefaultFrameRate))); |
65 } | 70 } |
66 | 71 |
67 } // namespace video_capture | 72 } // namespace video_capture |
OLD | NEW |