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 #include "services/video_capture/service_configurator_impl.h" |
| 7 #include "services/video_capture/video_capture_device_factory_impl.h" |
6 | 8 |
7 namespace video_capture { | 9 namespace video_capture { |
8 | 10 |
9 VideoCaptureService::VideoCaptureService() = default; | 11 VideoCaptureService::VideoCaptureService() { |
| 12 device_factory_.reset(new VideoCaptureDeviceFactoryImpl()); |
| 13 configurator_.reset(new ServiceConfiguratorImpl(device_factory_.get())); |
| 14 } |
10 | 15 |
11 VideoCaptureService::~VideoCaptureService() = default; | 16 VideoCaptureService::~VideoCaptureService() = default; |
12 | 17 |
13 bool VideoCaptureService::OnConnect(const shell::Identity& remote_identity, | 18 bool VideoCaptureService::OnConnect(const shell::Identity& remote_identity, |
14 shell::InterfaceRegistry* registry) { | 19 shell::InterfaceRegistry* registry) { |
| 20 registry->AddInterface<mojom::ServiceConfigurator>(this); |
15 registry->AddInterface<mojom::VideoCaptureDeviceFactory>(this); | 21 registry->AddInterface<mojom::VideoCaptureDeviceFactory>(this); |
16 return true; | 22 return true; |
17 } | 23 } |
18 | 24 |
| 25 void VideoCaptureService::Create(const shell::Identity& remote_identity, |
| 26 mojom::ServiceConfiguratorRequest request) { |
| 27 configurator_bindings_.AddBinding(configurator_.get(), std::move(request)); |
| 28 } |
| 29 |
19 void VideoCaptureService::Create( | 30 void VideoCaptureService::Create( |
20 const shell::Identity& remote_identity, | 31 const shell::Identity& remote_identity, |
21 mojom::VideoCaptureDeviceFactoryRequest request) { | 32 mojom::VideoCaptureDeviceFactoryRequest request) { |
22 bindings_.AddBinding(&device_factory_, std::move(request)); | 33 factory_bindings_.AddBinding(device_factory_.get(), std::move(request)); |
23 } | 34 } |
24 | 35 |
25 } // namespace video_capture | 36 } // namespace video_capture |
OLD | NEW |