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 // MediaStreamManager is used to open/enumerate media capture devices (video | 5 // MediaStreamManager is used to open/enumerate media capture devices (video |
6 // supported now). Call flow: | 6 // supported now). Call flow: |
7 // 1. GenerateStream is called when a render process wants to use a capture | 7 // 1. GenerateStream is called when a render process wants to use a capture |
8 // device. | 8 // device. |
9 // 2. MediaStreamManager will ask MediaStreamUIController for permission to | 9 // 2. MediaStreamManager will ask MediaStreamUIController for permission to |
10 // use devices and for which device to use. | 10 // use devices and for which device to use. |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 void NotifyDevicesChanged(MediaStreamType stream_type, | 239 void NotifyDevicesChanged(MediaStreamType stream_type, |
240 const StreamDeviceInfoArray& devices); | 240 const StreamDeviceInfoArray& devices); |
241 | 241 |
242 void HandleAccessRequestResponse(const std::string& label, | 242 void HandleAccessRequestResponse(const std::string& label, |
243 const MediaStreamDevices& devices, | 243 const MediaStreamDevices& devices, |
244 content::MediaStreamRequestResult result); | 244 content::MediaStreamRequestResult result); |
245 void StopMediaStreamFromBrowser(const std::string& label); | 245 void StopMediaStreamFromBrowser(const std::string& label); |
246 | 246 |
247 void DoEnumerateDevices(const std::string& label); | 247 void DoEnumerateDevices(const std::string& label); |
248 | 248 |
| 249 // Enumerates audio output devices. No caching. |
| 250 void EnumerateAudioOutputDevices(const std::string& label); |
| 251 |
| 252 void AudioOutputDevicesEnumerated(const StreamDeviceInfoArray& devices); |
| 253 |
249 // Helpers. | 254 // Helpers. |
250 // Checks if all devices that was requested in the request identififed by | 255 // Checks if all devices that was requested in the request identififed by |
251 // |label| has been opened and set the request state accordingly. | 256 // |label| has been opened and set the request state accordingly. |
252 void HandleRequestDone(const std::string& label, | 257 void HandleRequestDone(const std::string& label, |
253 DeviceRequest* request); | 258 DeviceRequest* request); |
254 // Stop the use of the device associated with |session_id| of type |type| in | 259 // Stop the use of the device associated with |session_id| of type |type| in |
255 // all |requests_|. The device is removed from the request. If a request | 260 // all |requests_|. The device is removed from the request. If a request |
256 /// doesn't use any devices as a consequence, the request is deleted. | 261 /// doesn't use any devices as a consequence, the request is deleted. |
257 void StopDevice(MediaStreamType type, int session_id); | 262 void StopDevice(MediaStreamType type, int session_id); |
258 // Calls the correct capture manager and close the device with |session_id|. | 263 // Calls the correct capture manager and close the device with |session_id|. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // the webrtcLoggingPrivate API if requested. | 351 // the webrtcLoggingPrivate API if requested. |
347 void AddLogMessageOnUIThread(const std::set<int>& render_process_ids, | 352 void AddLogMessageOnUIThread(const std::set<int>& render_process_ids, |
348 const std::string& message); | 353 const std::string& message); |
349 | 354 |
350 // Handles the callback from MediaStreamUIProxy to receive the UI window id, | 355 // Handles the callback from MediaStreamUIProxy to receive the UI window id, |
351 // used for excluding the notification window in desktop capturing. | 356 // used for excluding the notification window in desktop capturing. |
352 void OnMediaStreamUIWindowId(MediaStreamType video_type, | 357 void OnMediaStreamUIWindowId(MediaStreamType video_type, |
353 StreamDeviceInfoArray devices, | 358 StreamDeviceInfoArray devices, |
354 gfx::NativeViewId window_id); | 359 gfx::NativeViewId window_id); |
355 | 360 |
356 // Task runner shared by VideoCaptureManager and AudioInputDeviceManager. | 361 // Task runner shared by VideoCaptureManager and AudioInputDeviceManager and |
| 362 // used for enumerating audio output devices. |
357 // Note: Enumeration tasks may take seconds to complete so must never be run | 363 // Note: Enumeration tasks may take seconds to complete so must never be run |
358 // on any of the BrowserThreads (UI, IO, etc). See http://crbug.com/256945. | 364 // on any of the BrowserThreads (UI, IO, etc). See http://crbug.com/256945. |
359 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; | 365 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
360 | 366 |
361 media::AudioManager* const audio_manager_; // not owned | 367 media::AudioManager* const audio_manager_; // not owned |
362 scoped_refptr<AudioInputDeviceManager> audio_input_device_manager_; | 368 scoped_refptr<AudioInputDeviceManager> audio_input_device_manager_; |
363 scoped_refptr<VideoCaptureManager> video_capture_manager_; | 369 scoped_refptr<VideoCaptureManager> video_capture_manager_; |
364 | 370 |
365 // Indicator of device monitoring state. | 371 // Indicator of device monitoring state. |
366 bool monitoring_started_; | 372 bool monitoring_started_; |
(...skipping 16 matching lines...) Expand all Loading... |
383 | 389 |
384 bool use_fake_ui_; | 390 bool use_fake_ui_; |
385 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; | 391 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; |
386 | 392 |
387 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 393 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
388 }; | 394 }; |
389 | 395 |
390 } // namespace content | 396 } // namespace content |
391 | 397 |
392 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 398 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
OLD | NEW |