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