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 "services/video_capture/fake_video_capture_device_factory_configurator_
impl.h" |
| 8 #include "services/video_capture/video_capture_device_factory_impl.h" |
| 9 |
7 namespace video_capture { | 10 namespace video_capture { |
8 | 11 |
9 VideoCaptureService::VideoCaptureService() = default; | 12 VideoCaptureService::VideoCaptureService() { |
| 13 device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(); |
| 14 fake_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(); |
| 15 configurator_ = |
| 16 base::MakeUnique<FakeVideoCaptureDeviceFactoryConfiguratorImpl>( |
| 17 fake_device_factory_.get()); |
| 18 } |
10 | 19 |
11 VideoCaptureService::~VideoCaptureService() = default; | 20 VideoCaptureService::~VideoCaptureService() = default; |
12 | 21 |
13 bool VideoCaptureService::OnConnect(const shell::Identity& remote_identity, | 22 bool VideoCaptureService::OnConnect(const shell::Identity& remote_identity, |
14 shell::InterfaceRegistry* registry) { | 23 shell::InterfaceRegistry* registry) { |
15 registry->AddInterface<mojom::VideoCaptureDeviceFactory>(this); | 24 registry->AddInterface<mojom::VideoCaptureService>(this); |
16 return true; | 25 return true; |
17 } | 26 } |
18 | 27 |
19 void VideoCaptureService::Create( | 28 void VideoCaptureService::Create(const shell::Identity& remote_identity, |
20 const shell::Identity& remote_identity, | 29 mojom::VideoCaptureServiceRequest request) { |
| 30 bindings_.AddBinding(this, std::move(request)); |
| 31 } |
| 32 |
| 33 void VideoCaptureService::ConnectToDeviceFactory( |
21 mojom::VideoCaptureDeviceFactoryRequest request) { | 34 mojom::VideoCaptureDeviceFactoryRequest request) { |
22 bindings_.AddBinding(&device_factory_, std::move(request)); | 35 factory_bindings_.AddBinding(device_factory_.get(), std::move(request)); |
| 36 } |
| 37 |
| 38 void VideoCaptureService::ConnectToFakeDeviceFactory( |
| 39 mojom::VideoCaptureDeviceFactoryRequest request) { |
| 40 fake_factory_bindings_.AddBinding(fake_device_factory_.get(), |
| 41 std::move(request)); |
| 42 } |
| 43 |
| 44 void VideoCaptureService::ConnectToFakeDeviceFactoryConfigurator( |
| 45 mojom::FakeVideoCaptureDeviceFactoryConfiguratorRequest request) { |
| 46 configurator_bindings_.AddBinding(configurator_.get(), std::move(request)); |
23 } | 47 } |
24 | 48 |
25 } // namespace video_capture | 49 } // namespace video_capture |
OLD | NEW |