| 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(int session_id, |
| 161 const media::VideoCaptureDevice::TakePhotoCallback& |
| 162 photo_callback) WARN_UNUSED_RESULT; |
| 163 |
| 159 private: | 164 private: |
| 160 class DeviceEntry; | 165 class DeviceEntry; |
| 161 | 166 |
| 162 ~VideoCaptureManager() override; | 167 ~VideoCaptureManager() override; |
| 163 | 168 |
| 164 // Checks to see if |entry| has no clients left on its controller. If so, | 169 // Checks to see if |entry| has no clients left on its controller. If so, |
| 165 // remove it from the list of devices, and delete it asynchronously. |entry| | 170 // remove it from the list of devices, and delete it asynchronously. |entry| |
| 166 // may be freed by this function. | 171 // may be freed by this function. |
| 167 void DestroyDeviceEntryIfNoClients(DeviceEntry* entry); | 172 void DestroyDeviceEntryIfNoClients(DeviceEntry* entry); |
| 168 | 173 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // Map used by DesktopCapture. | 327 // Map used by DesktopCapture. |
| 323 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 328 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
| 324 notification_window_ids_; | 329 notification_window_ids_; |
| 325 | 330 |
| 326 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 331 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 327 }; | 332 }; |
| 328 | 333 |
| 329 } // namespace content | 334 } // namespace content |
| 330 | 335 |
| 331 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 336 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |