| 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 "media/capture/video/fake_video_capture_device.h" |
| 8 #include "media/capture/video/video_capture_jpeg_decoder.h" | 8 #include "media/capture/video/video_capture_jpeg_decoder.h" |
| 9 #include "services/video_capture/video_capture_device_factory_impl.h" | 9 #include "services/video_capture/video_capture_device_factory_impl.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 } // anonymous namespace | 23 } // anonymous namespace |
| 24 | 24 |
| 25 namespace video_capture { | 25 namespace video_capture { |
| 26 | 26 |
| 27 VideoCaptureService::VideoCaptureService() = default; | 27 VideoCaptureService::VideoCaptureService() = default; |
| 28 | 28 |
| 29 VideoCaptureService::~VideoCaptureService() = default; | 29 VideoCaptureService::~VideoCaptureService() = default; |
| 30 | 30 |
| 31 bool VideoCaptureService::OnConnect(const shell::Identity& remote_identity, | 31 bool VideoCaptureService::OnConnect( |
| 32 shell::InterfaceRegistry* registry) { | 32 const service_manager::Identity& remote_identity, |
| 33 service_manager::InterfaceRegistry* registry) { |
| 33 registry->AddInterface<mojom::VideoCaptureService>(this); | 34 registry->AddInterface<mojom::VideoCaptureService>(this); |
| 34 return true; | 35 return true; |
| 35 } | 36 } |
| 36 | 37 |
| 37 void VideoCaptureService::Create(const shell::Identity& remote_identity, | 38 void VideoCaptureService::Create( |
| 38 mojom::VideoCaptureServiceRequest request) { | 39 const service_manager::Identity& remote_identity, |
| 40 mojom::VideoCaptureServiceRequest request) { |
| 39 service_bindings_.AddBinding(this, std::move(request)); | 41 service_bindings_.AddBinding(this, std::move(request)); |
| 40 } | 42 } |
| 41 | 43 |
| 42 void VideoCaptureService::ConnectToDeviceFactory( | 44 void VideoCaptureService::ConnectToDeviceFactory( |
| 43 mojom::VideoCaptureDeviceFactoryRequest request) { | 45 mojom::VideoCaptureDeviceFactoryRequest request) { |
| 44 LazyInitializeDeviceFactory(); | 46 LazyInitializeDeviceFactory(); |
| 45 factory_bindings_.AddBinding(device_factory_.get(), std::move(request)); | 47 factory_bindings_.AddBinding(device_factory_.get(), std::move(request)); |
| 46 } | 48 } |
| 47 | 49 |
| 48 void VideoCaptureService::ConnectToFakeDeviceFactory( | 50 void VideoCaptureService::ConnectToFakeDeviceFactory( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 97 } |
| 96 | 98 |
| 97 void VideoCaptureService::LazyInitializeMockDeviceFactory() { | 99 void VideoCaptureService::LazyInitializeMockDeviceFactory() { |
| 98 if (mock_device_factory_) | 100 if (mock_device_factory_) |
| 99 return; | 101 return; |
| 100 mock_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>( | 102 mock_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>( |
| 101 base::Bind(CreateJpegDecoder)); | 103 base::Bind(CreateJpegDecoder)); |
| 102 } | 104 } |
| 103 | 105 |
| 104 } // namespace video_capture | 106 } // namespace video_capture |
| OLD | NEW |