| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 // Returns true if the current operation needs to be preempted by a call to | 246 // Returns true if the current operation needs to be preempted by a call to |
| 247 // InitializeCaptureDeviceApiOnUIThread. | 247 // InitializeCaptureDeviceApiOnUIThread. |
| 248 // Called on the IO thread. | 248 // Called on the IO thread. |
| 249 bool NeedToInitializeCaptureDeviceApi(MediaStreamType stream_type); | 249 bool NeedToInitializeCaptureDeviceApi(MediaStreamType stream_type); |
| 250 | 250 |
| 251 // Called on the IO thread to do async initialization of the capture api. | 251 // Called on the IO thread to do async initialization of the capture api. |
| 252 // Once initialization is done, and_then will be run on the IO thread. | 252 // Once initialization is done, and_then will be run on the IO thread. |
| 253 void InitializeCaptureDeviceApiOnUIThread(const base::Closure& and_then); | 253 void InitializeCaptureDeviceApiOnUIThread(const base::Closure& and_then); |
| 254 | 254 |
| 255 // Due to initialization issues with AVFoundation and QTKit on Mac, we need | 255 // Due to initialization issues with AVFoundation on Mac, we need |
| 256 // to make sure we initialize the APIs on the UI thread before we can reliably | 256 // to make sure we initialize the APIs on the UI thread before we can reliably |
| 257 // use them. This variable is only checked and set on the IO thread. | 257 // use them. This variable is only checked and set on the IO thread. |
| 258 bool capture_device_api_initialized_ = false; | 258 bool capture_device_api_initialized_ = false; |
| 259 #endif | 259 #endif |
| 260 | 260 |
| 261 // The message loop of media stream device thread, where VCD's live. | 261 // The message loop of media stream device thread, where VCD's live. |
| 262 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; | 262 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
| 263 | 263 |
| 264 // Only accessed on Browser::IO thread. | 264 // Only accessed on Browser::IO thread. |
| 265 MediaStreamProviderListener* listener_; | 265 MediaStreamProviderListener* listener_; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 // Map used by DesktopCapture. | 354 // Map used by DesktopCapture. |
| 355 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 355 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
| 356 notification_window_ids_; | 356 notification_window_ids_; |
| 357 | 357 |
| 358 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 358 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 359 }; | 359 }; |
| 360 | 360 |
| 361 } // namespace content | 361 } // namespace content |
| 362 | 362 |
| 363 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 363 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |