| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // To avoid multiple unnecessary start/stop commands to the OS, each start | 234 // To avoid multiple unnecessary start/stop commands to the OS, each start |
| 235 // request is queued in |device_start_queue_|. | 235 // request is queued in |device_start_queue_|. |
| 236 // QueueStartDevice creates a new entry in |device_start_queue_| and posts a | 236 // QueueStartDevice creates a new entry in |device_start_queue_| and posts a |
| 237 // request to start the device on the device thread unless there is | 237 // request to start the device on the device thread unless there is |
| 238 // another request pending start. | 238 // another request pending start. |
| 239 void QueueStartDevice(media::VideoCaptureSessionId session_id, | 239 void QueueStartDevice(media::VideoCaptureSessionId session_id, |
| 240 DeviceEntry* entry, | 240 DeviceEntry* entry, |
| 241 const media::VideoCaptureParams& params); | 241 const media::VideoCaptureParams& params); |
| 242 void OnDeviceStarted( | 242 void OnDeviceStarted( |
| 243 int serial_id, | 243 int serial_id, |
| 244 std::unique_ptr<media::FrameBufferPool> frame_buffer_pool, | |
| 245 std::unique_ptr<VideoCaptureDevice> device); | 244 std::unique_ptr<VideoCaptureDevice> device); |
| 246 void DoStopDevice(DeviceEntry* entry); | 245 void DoStopDevice(DeviceEntry* entry); |
| 247 void HandleQueuedStartRequest(); | 246 void HandleQueuedStartRequest(); |
| 248 | 247 |
| 249 // Creates and Starts a new VideoCaptureDevice. The resulting | 248 // Creates and Starts a new VideoCaptureDevice. The resulting |
| 250 // VideoCaptureDevice is returned to the IO-thread and stored in | 249 // VideoCaptureDevice is returned to the IO-thread and stored in |
| 251 // a DeviceEntry in |devices_|. Ownership of |client| passes to | 250 // a DeviceEntry in |devices_|. Ownership of |client| passes to |
| 252 // the device. | 251 // the device. |
| 253 std::unique_ptr<VideoCaptureDevice> DoStartDeviceCaptureOnDeviceThread( | 252 std::unique_ptr<VideoCaptureDevice> DoStartDeviceCaptureOnDeviceThread( |
| 254 const VideoCaptureDeviceDescriptor& descriptor, | 253 const VideoCaptureDeviceDescriptor& descriptor, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // Map used by DesktopCapture. | 334 // Map used by DesktopCapture. |
| 336 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 335 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
| 337 notification_window_ids_; | 336 notification_window_ids_; |
| 338 | 337 |
| 339 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 338 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 340 }; | 339 }; |
| 341 | 340 |
| 342 } // namespace content | 341 } // namespace content |
| 343 | 342 |
| 344 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 343 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |