| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 const media::VideoCaptureParams& params); | 201 const media::VideoCaptureParams& params); |
| 202 void OnDeviceStarted(int serial_id, | 202 void OnDeviceStarted(int serial_id, |
| 203 scoped_ptr<media::VideoCaptureDevice> device); | 203 scoped_ptr<media::VideoCaptureDevice> device); |
| 204 void DoStopDevice(DeviceEntry* entry); | 204 void DoStopDevice(DeviceEntry* entry); |
| 205 void HandleQueuedStartRequest(); | 205 void HandleQueuedStartRequest(); |
| 206 | 206 |
| 207 // Creates and Starts a new VideoCaptureDevice. The resulting | 207 // Creates and Starts a new VideoCaptureDevice. The resulting |
| 208 // VideoCaptureDevice is returned to the IO-thread and stored in | 208 // VideoCaptureDevice is returned to the IO-thread and stored in |
| 209 // a DeviceEntry in |devices_|. Ownership of |client| passes to | 209 // a DeviceEntry in |devices_|. Ownership of |client| passes to |
| 210 // the device. | 210 // the device. |
| 211 scoped_ptr<media::VideoCaptureDevice> DoStartDeviceOnDeviceThread( | 211 scoped_ptr<media::VideoCaptureDevice> DoStartDeviceCaptureOnDeviceThread( |
| 212 media::VideoCaptureSessionId session_id, | 212 const media::VideoCaptureDevice::Name& name, |
| 213 const std::string& device_id, | |
| 214 MediaStreamType stream_type, | |
| 215 const media::VideoCaptureParams& params, | 213 const media::VideoCaptureParams& params, |
| 216 scoped_ptr<media::VideoCaptureDevice::Client> client); | 214 scoped_ptr<media::VideoCaptureDevice::Client> client); |
| 217 | 215 |
| 216 scoped_ptr<media::VideoCaptureDevice> DoStartTabCaptureOnDeviceThread( |
| 217 const std::string& device_id, |
| 218 const media::VideoCaptureParams& params, |
| 219 scoped_ptr<media::VideoCaptureDevice::Client> client); |
| 220 |
| 221 scoped_ptr<media::VideoCaptureDevice> DoStartDesktopCaptureOnDeviceThread( |
| 222 const std::string& device_id, |
| 223 const media::VideoCaptureParams& params, |
| 224 scoped_ptr<media::VideoCaptureDevice::Client> client); |
| 225 |
| 218 // Stops and destroys the VideoCaptureDevice held in | 226 // Stops and destroys the VideoCaptureDevice held in |
| 219 // |device|. | 227 // |device|. |
| 220 void DoStopDeviceOnDeviceThread(scoped_ptr<media::VideoCaptureDevice> device); | 228 void DoStopDeviceOnDeviceThread(scoped_ptr<media::VideoCaptureDevice> device); |
| 221 | 229 |
| 222 media::VideoCaptureDeviceInfo* FindDeviceInfoById( | 230 media::VideoCaptureDeviceInfo* FindDeviceInfoById( |
| 223 const std::string& id, | 231 const std::string& id, |
| 224 media::VideoCaptureDeviceInfos& device_vector); | 232 media::VideoCaptureDeviceInfos& device_vector); |
| 225 | 233 |
| 226 void MaybePostDesktopCaptureWindowId(media::VideoCaptureSessionId session_id); | 234 void MaybePostDesktopCaptureWindowId(media::VideoCaptureSessionId session_id); |
| 227 void SetDesktopCaptureWindowIdOnDeviceThread( | 235 void SetDesktopCaptureWindowIdOnDeviceThread( |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 // Map used by DesktopCapture. | 332 // Map used by DesktopCapture. |
| 325 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 333 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
| 326 notification_window_ids_; | 334 notification_window_ids_; |
| 327 | 335 |
| 328 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 336 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 329 }; | 337 }; |
| 330 | 338 |
| 331 } // namespace content | 339 } // namespace content |
| 332 | 340 |
| 333 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 341 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |