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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 const DoneCB& done_cb); | 77 const DoneCB& done_cb); |
78 | 78 |
79 // Called by VideoCaptureHost to remove |client_handler|. If this is the last | 79 // Called by VideoCaptureHost to remove |client_handler|. If this is the last |
80 // client of the device, the |controller| and its VideoCaptureDevice may be | 80 // client of the device, the |controller| and its VideoCaptureDevice may be |
81 // destroyed. The client must not access |controller| after calling this | 81 // destroyed. The client must not access |controller| after calling this |
82 // function. | 82 // function. |
83 void StopCaptureForClient(VideoCaptureController* controller, | 83 void StopCaptureForClient(VideoCaptureController* controller, |
84 VideoCaptureControllerID client_id, | 84 VideoCaptureControllerID client_id, |
85 VideoCaptureControllerEventHandler* client_handler); | 85 VideoCaptureControllerEventHandler* client_handler); |
86 | 86 |
87 // Called by VideoCaptureHost to remove |client_handler| when a device error | |
88 // happened . If this is the last client of the device, the |controller| and | |
mcasas
2014/04/24 11:09:47
No blank before '.'
jiayl
2014/04/24 18:11:13
Done.
| |
89 // its VideoCaptureDevice may be destroyed. The client must not access | |
90 // |controller| after calling this function. The MediaStreamProviderListener | |
91 // will be notified. | |
92 void AbortCaptureForDeviceError( | |
93 VideoCaptureController* controller, | |
94 VideoCaptureControllerID client_id, | |
95 VideoCaptureControllerEventHandler* client_handler); | |
96 | |
87 // Retrieves all capture supported formats for a particular device. Returns | 97 // Retrieves all capture supported formats for a particular device. Returns |
88 // false if the |capture_session_id| is not found. The supported formats are | 98 // false if the |capture_session_id| is not found. The supported formats are |
89 // cached during device(s) enumeration, and depending on the underlying | 99 // cached during device(s) enumeration, and depending on the underlying |
90 // implementation, could be an empty list. | 100 // implementation, could be an empty list. |
91 bool GetDeviceSupportedFormats( | 101 bool GetDeviceSupportedFormats( |
92 media::VideoCaptureSessionId capture_session_id, | 102 media::VideoCaptureSessionId capture_session_id, |
93 media::VideoCaptureFormats* supported_formats); | 103 media::VideoCaptureFormats* supported_formats); |
94 | 104 |
95 // Retrieves the format(s) currently in use. Returns false if the | 105 // Retrieves the format(s) currently in use. Returns false if the |
96 // |capture_session_id| is not found. Returns true and |formats_in_use| | 106 // |capture_session_id| is not found. Returns true and |formats_in_use| |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 DeviceEntry* GetDeviceEntryForMediaStreamDevice( | 148 DeviceEntry* GetDeviceEntryForMediaStreamDevice( |
139 const MediaStreamDevice& device_info); | 149 const MediaStreamDevice& device_info); |
140 | 150 |
141 // Find a DeviceEntry entry for the indicated session, creating a fresh one | 151 // Find a DeviceEntry entry for the indicated session, creating a fresh one |
142 // if necessary. Returns NULL if the session id is invalid. | 152 // if necessary. Returns NULL if the session id is invalid. |
143 DeviceEntry* GetOrCreateDeviceEntry( | 153 DeviceEntry* GetOrCreateDeviceEntry( |
144 media::VideoCaptureSessionId capture_session_id); | 154 media::VideoCaptureSessionId capture_session_id); |
145 | 155 |
146 // Find the DeviceEntry that owns a particular controller pointer. | 156 // Find the DeviceEntry that owns a particular controller pointer. |
147 DeviceEntry* GetDeviceEntryForController( | 157 DeviceEntry* GetDeviceEntryForController( |
148 const VideoCaptureController* controller); | 158 const VideoCaptureController* controller) const; |
149 | 159 |
150 bool IsOnDeviceThread() const; | 160 bool IsOnDeviceThread() const; |
151 | 161 |
152 // Queries the Names of the devices in the system; the formats supported by | 162 // Queries the Names of the devices in the system; the formats supported by |
153 // the new devices are also queried, and consolidated with the copy of the | 163 // the new devices are also queried, and consolidated with the copy of the |
154 // local device info cache passed. The consolidated list of devices and | 164 // local device info cache passed. The consolidated list of devices and |
155 // supported formats is returned. | 165 // supported formats is returned. |
156 DeviceInfos GetAvailableDevicesInfoOnDeviceThread( | 166 DeviceInfos GetAvailableDevicesInfoOnDeviceThread( |
157 MediaStreamType stream_type, | 167 MediaStreamType stream_type, |
158 const DeviceInfos& old_device_info_cache); | 168 const DeviceInfos& old_device_info_cache); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 // Accessed on the device thread only. | 252 // Accessed on the device thread only. |
243 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 253 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
244 notification_window_ids_; | 254 notification_window_ids_; |
245 | 255 |
246 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 256 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
247 }; | 257 }; |
248 | 258 |
249 } // namespace content | 259 } // namespace content |
250 | 260 |
251 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 261 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
OLD | NEW |