| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // To avoid multiple unnecessary start/stop commands to the OS, each start | 252 // To avoid multiple unnecessary start/stop commands to the OS, each start |
| 253 // request is queued in |device_start_queue_|. | 253 // request is queued in |device_start_queue_|. |
| 254 // QueueStartDevice creates a new entry in |device_start_queue_| and posts a | 254 // QueueStartDevice creates a new entry in |device_start_queue_| and posts a |
| 255 // request to start the device on the device thread unless there is | 255 // request to start the device on the device thread unless there is |
| 256 // another request pending start. | 256 // another request pending start. |
| 257 void QueueStartDevice(media::VideoCaptureSessionId session_id, | 257 void QueueStartDevice(media::VideoCaptureSessionId session_id, |
| 258 DeviceEntry* entry, | 258 DeviceEntry* entry, |
| 259 const media::VideoCaptureParams& params); | 259 const media::VideoCaptureParams& params); |
| 260 void OnDeviceStarted( | 260 void OnDeviceStarted( |
| 261 int serial_id, | 261 int serial_id, |
| 262 std::unique_ptr<media::FrameBufferPool> frame_buffer_pool, | |
| 263 std::unique_ptr<VideoCaptureDevice> device); | 262 std::unique_ptr<VideoCaptureDevice> device); |
| 264 void DoStopDevice(DeviceEntry* entry); | 263 void DoStopDevice(DeviceEntry* entry); |
| 265 void HandleQueuedStartRequest(); | 264 void HandleQueuedStartRequest(); |
| 266 | 265 |
| 267 // Creates and Starts a new VideoCaptureDevice. The resulting | 266 // Creates and Starts a new VideoCaptureDevice. The resulting |
| 268 // VideoCaptureDevice is returned to the IO-thread and stored in | 267 // VideoCaptureDevice is returned to the IO-thread and stored in |
| 269 // a DeviceEntry in |devices_|. Ownership of |client| passes to | 268 // a DeviceEntry in |devices_|. Ownership of |client| passes to |
| 270 // the device. | 269 // the device. |
| 271 std::unique_ptr<VideoCaptureDevice> DoStartDeviceCaptureOnDeviceThread( | 270 std::unique_ptr<VideoCaptureDevice> DoStartDeviceCaptureOnDeviceThread( |
| 272 const VideoCaptureDeviceDescriptor& descriptor, | 271 const VideoCaptureDeviceDescriptor& descriptor, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 // Map used by DesktopCapture. | 352 // Map used by DesktopCapture. |
| 354 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 353 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
| 355 notification_window_ids_; | 354 notification_window_ids_; |
| 356 | 355 |
| 357 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 356 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 358 }; | 357 }; |
| 359 | 358 |
| 360 } // namespace content | 359 } // namespace content |
| 361 | 360 |
| 362 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 361 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |