| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 void DoGetPhotoCapabilities( | 275 void DoGetPhotoCapabilities( |
| 276 VideoCaptureDevice::GetPhotoCapabilitiesCallback callback, | 276 VideoCaptureDevice::GetPhotoCapabilitiesCallback callback, |
| 277 VideoCaptureDevice* device); | 277 VideoCaptureDevice* device); |
| 278 void DoSetPhotoOptions( | 278 void DoSetPhotoOptions( |
| 279 VideoCaptureDevice::SetPhotoOptionsCallback callback, | 279 VideoCaptureDevice::SetPhotoOptionsCallback callback, |
| 280 media::mojom::PhotoSettingsPtr settings, | 280 media::mojom::PhotoSettingsPtr settings, |
| 281 VideoCaptureDevice* device); | 281 VideoCaptureDevice* device); |
| 282 void DoTakePhoto(VideoCaptureDevice::TakePhotoCallback callback, | 282 void DoTakePhoto(VideoCaptureDevice::TakePhotoCallback callback, |
| 283 VideoCaptureDevice* device); | 283 VideoCaptureDevice* device); |
| 284 | 284 |
| 285 #if defined(OS_MACOSX) | |
| 286 // Called on the IO thread after the device layer has been initialized on Mac. | |
| 287 // Sets |capture_device_api_initialized_| to true and then executes and_then. | |
| 288 void OnDeviceLayerInitialized(const base::Closure& and_then); | |
| 289 | |
| 290 // Returns true if the current operation needs to be preempted by a call to | |
| 291 // InitializeCaptureDeviceApiOnUIThread. | |
| 292 // Called on the IO thread. | |
| 293 bool NeedToInitializeCaptureDeviceApi(MediaStreamType stream_type); | |
| 294 | |
| 295 // Called on the IO thread to do async initialization of the capture api. | |
| 296 // Once initialization is done, and_then will be run on the IO thread. | |
| 297 void InitializeCaptureDeviceApiOnUIThread(const base::Closure& and_then); | |
| 298 | |
| 299 // Due to initialization issues with AVFoundation on Mac, we need | |
| 300 // to make sure we initialize the APIs on the UI thread before we can reliably | |
| 301 // use them. This variable is only checked and set on the IO thread. | |
| 302 bool capture_device_api_initialized_ = false; | |
| 303 #endif | |
| 304 | |
| 305 #if defined(OS_ANDROID) | 285 #if defined(OS_ANDROID) |
| 306 void ReleaseDevices(); | 286 void ReleaseDevices(); |
| 307 void ResumeDevices(); | 287 void ResumeDevices(); |
| 308 | 288 |
| 309 std::unique_ptr<base::android::ApplicationStatusListener> | 289 std::unique_ptr<base::android::ApplicationStatusListener> |
| 310 app_status_listener_; | 290 app_status_listener_; |
| 311 bool application_state_has_running_activities_; | 291 bool application_state_has_running_activities_; |
| 312 #endif | 292 #endif |
| 313 | 293 |
| 314 // The message loop of media stream device thread, where VCD's live. | 294 // The message loop of media stream device thread, where VCD's live. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 // Map used by DesktopCapture. | 333 // Map used by DesktopCapture. |
| 354 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 334 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
| 355 notification_window_ids_; | 335 notification_window_ids_; |
| 356 | 336 |
| 357 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 337 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 358 }; | 338 }; |
| 359 | 339 |
| 360 } // namespace content | 340 } // namespace content |
| 361 | 341 |
| 362 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 342 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |