OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "content/browser/renderer_host/media/service_video_capture_device_launc
her.h" | 5 #include "content/browser/renderer_host/media/service_video_capture_device_launc
her.h" |
6 | 6 |
7 #include "content/browser/renderer_host/media/service_launched_video_capture_dev
ice.h" | 7 #include "content/browser/renderer_host/media/service_launched_video_capture_dev
ice.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "media/capture/video/video_frame_receiver_on_task_runner.h" | 9 #include "media/capture/video/video_frame_receiver_on_task_runner.h" |
10 #include "mojo/public/cpp/bindings/strong_binding.h" | 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 if (!device_factory_->is_bound()) { | 83 if (!device_factory_->is_bound()) { |
84 // This can happen when the ServiceVideoCaptureProvider owning | 84 // This can happen when the ServiceVideoCaptureProvider owning |
85 // |device_factory_| loses connection to the service process and resets | 85 // |device_factory_| loses connection to the service process and resets |
86 // |device_factory_|. | 86 // |device_factory_|. |
87 ConcludeLaunchDeviceWithFailure(false, callbacks, std::move(done_cb)); | 87 ConcludeLaunchDeviceWithFailure(false, callbacks, std::move(done_cb)); |
88 return; | 88 return; |
89 } | 89 } |
90 video_capture::mojom::DevicePtr device; | 90 video_capture::mojom::DevicePtr device; |
| 91 auto device_request = mojo::MakeRequest(&device); |
91 (*device_factory_) | 92 (*device_factory_) |
92 ->CreateDevice( | 93 ->CreateDevice( |
93 device_id, mojo::MakeRequest(&device), | 94 device_id, std::move(device_request), |
94 base::Bind( | 95 base::Bind( |
95 // Use of Unretained |this| is safe, because |done_cb| guarantees | 96 // Use of Unretained |this| is safe, because |done_cb| guarantees |
96 // that |this| stays alive. | 97 // that |this| stays alive. |
97 &ServiceVideoCaptureDeviceLauncher::OnCreateDeviceCallback, | 98 &ServiceVideoCaptureDeviceLauncher::OnCreateDeviceCallback, |
98 base::Unretained(this), params, base::Passed(&device), | 99 base::Unretained(this), params, base::Passed(&device), |
99 std::move(receiver), callbacks, base::Passed(&done_cb))); | 100 std::move(receiver), callbacks, base::Passed(&done_cb))); |
100 state_ = State::DEVICE_START_IN_PROGRESS; | 101 state_ = State::DEVICE_START_IN_PROGRESS; |
101 } | 102 } |
102 | 103 |
103 void ServiceVideoCaptureDeviceLauncher::AbortLaunch() { | 104 void ServiceVideoCaptureDeviceLauncher::AbortLaunch() { |
(...skipping 20 matching lines...) Expand all Loading... |
124 return; | 125 return; |
125 case video_capture::mojom::DeviceAccessResultCode::ERROR_DEVICE_NOT_FOUND: | 126 case video_capture::mojom::DeviceAccessResultCode::ERROR_DEVICE_NOT_FOUND: |
126 case video_capture::mojom::DeviceAccessResultCode::NOT_INITIALIZED: | 127 case video_capture::mojom::DeviceAccessResultCode::NOT_INITIALIZED: |
127 ConcludeLaunchDeviceWithFailure(abort_requested, callbacks, | 128 ConcludeLaunchDeviceWithFailure(abort_requested, callbacks, |
128 std::move(done_cb)); | 129 std::move(done_cb)); |
129 return; | 130 return; |
130 } | 131 } |
131 } | 132 } |
132 | 133 |
133 } // namespace content | 134 } // namespace content |
OLD | NEW |