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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 media::VideoCaptureSessionId capture_session_id); | 233 media::VideoCaptureSessionId capture_session_id); |
234 void OnDevicesInfoEnumerated(base::ElapsedTimer* timer, | 234 void OnDevicesInfoEnumerated(base::ElapsedTimer* timer, |
235 const EnumerationCallback& client_callback, | 235 const EnumerationCallback& client_callback, |
236 const DeviceInfos& new_devices_info_cache); | 236 const DeviceInfos& new_devices_info_cache); |
237 | 237 |
238 // Consolidates the cached devices list with the list of currently connected | 238 // Consolidates the cached devices list with the list of currently connected |
239 // devices in the system |names_snapshot|. Retrieves the supported formats of | 239 // devices in the system |names_snapshot|. Retrieves the supported formats of |
240 // the new devices and sends the new cache to OnDevicesInfoEnumerated(). | 240 // the new devices and sends the new cache to OnDevicesInfoEnumerated(). |
241 void ConsolidateDevicesInfoOnDeviceThread( | 241 void ConsolidateDevicesInfoOnDeviceThread( |
242 base::Callback<void(const DeviceInfos&)> on_devices_enumerated_callback, | 242 base::Callback<void(const DeviceInfos&)> on_devices_enumerated_callback, |
243 const DeviceInfos& old_device_info_cache, | 243 const DeviceInfos& old_device_info_cache); |
244 std::unique_ptr<VideoCaptureDeviceDescriptors> descriptors_snapshot); | |
245 | 244 |
246 // Checks to see if |controller| has no clients left. If so, remove it from | 245 // Checks to see if |controller| has no clients left. If so, remove it from |
247 // the list of controllers, and delete it asynchronously. |controller| may be | 246 // the list of controllers, and delete it asynchronously. |controller| may be |
248 // freed by this function. | 247 // freed by this function. |
249 void DestroyControllerIfNoClients(VideoCaptureController* controller); | 248 void DestroyControllerIfNoClients(VideoCaptureController* controller); |
250 | 249 |
251 // Finds a VideoCaptureController in different ways: by |session_id|, by its | 250 // Finds a VideoCaptureController in different ways: by |session_id|, by its |
252 // |device_id| and |type| (if it is already opened), by its |controller| or by | 251 // |device_id| and |type| (if it is already opened), by its |controller| or by |
253 // its |serial_id|. In all cases, if not found, nullptr is returned. | 252 // its |serial_id|. In all cases, if not found, nullptr is returned. |
254 VideoCaptureController* LookupControllerBySessionId(int session_id); | 253 VideoCaptureController* LookupControllerBySessionId(int session_id); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 // Map used by DesktopCapture. | 336 // Map used by DesktopCapture. |
338 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 337 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
339 notification_window_ids_; | 338 notification_window_ids_; |
340 | 339 |
341 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 340 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
342 }; | 341 }; |
343 | 342 |
344 } // namespace content | 343 } // namespace content |
345 | 344 |
346 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 345 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
OLD | NEW |