Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // VideoCaptureManager is used to open/close, start/stop, enumerate available | 5 // VideoCaptureManager is used to open/close, start/stop, enumerate available |
| 6 // video capture devices, and manage VideoCaptureController's. | 6 // video capture devices, and manage VideoCaptureController's. |
| 7 // All functions are expected to be called from Browser::IO thread. Some helper | 7 // All functions are expected to be called from Browser::IO thread. Some helper |
| 8 // functions (*OnDeviceThread) will dispatch operations to the device thread. | 8 // functions (*OnDeviceThread) will dispatch operations to the device thread. |
| 9 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice. | 9 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice. |
| 10 // A device can only be opened once. | 10 // A device can only be opened once. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 const scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner) { | 149 const scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner) { |
| 150 device_task_runner_ = device_task_runner; | 150 device_task_runner_ = device_task_runner; |
| 151 } | 151 } |
| 152 #endif | 152 #endif |
| 153 | 153 |
| 154 // Returns the SingleThreadTaskRunner where devices are enumerated on and | 154 // Returns the SingleThreadTaskRunner where devices are enumerated on and |
| 155 // started. | 155 // started. |
| 156 scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner() { | 156 scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner() { |
| 157 return device_task_runner_; | 157 return device_task_runner_; |
| 158 } | 158 } |
| 159 | |
| 160 bool TakePhoto( | |
| 161 int session_id, | |
|
miu
2016/05/04 23:45:50
Following up on my comment above, can this take a
mcasas
2016/05/05 00:57:12
See above: unfortunately, |device_id| is a differe
| |
| 162 const media::VideoCaptureDevice::TakePhotoCallback& photo_callback); | |
| 163 | |
| 159 private: | 164 private: |
| 160 ~VideoCaptureManager() override; | 165 ~VideoCaptureManager() override; |
| 161 class DeviceEntry; | 166 class DeviceEntry; |
| 162 | 167 |
| 163 // Checks to see if |entry| has no clients left on its controller. If so, | 168 // Checks to see if |entry| has no clients left on its controller. If so, |
| 164 // remove it from the list of devices, and delete it asynchronously. |entry| | 169 // remove it from the list of devices, and delete it asynchronously. |entry| |
| 165 // may be freed by this function. | 170 // may be freed by this function. |
| 166 void DestroyDeviceEntryIfNoClients(DeviceEntry* entry); | 171 void DestroyDeviceEntryIfNoClients(DeviceEntry* entry); |
| 167 | 172 |
| 168 // Helpers to report an event to our Listener. | 173 // Helpers to report an event to our Listener. |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 383 // Map used by DesktopCapture. | 388 // Map used by DesktopCapture. |
| 384 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 389 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
| 385 notification_window_ids_; | 390 notification_window_ids_; |
| 386 | 391 |
| 387 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 392 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 388 }; | 393 }; |
| 389 | 394 |
| 390 } // namespace content | 395 } // namespace content |
| 391 | 396 |
| 392 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 397 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |