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 19 matching lines...) Expand all Loading... |
30 #include <set> | 30 #include <set> |
31 #include <string> | 31 #include <string> |
32 #include <utility> | 32 #include <utility> |
33 | 33 |
34 #include "base/basictypes.h" | 34 #include "base/basictypes.h" |
35 #include "base/memory/ref_counted.h" | 35 #include "base/memory/ref_counted.h" |
36 #include "base/memory/scoped_ptr.h" | 36 #include "base/memory/scoped_ptr.h" |
37 #include "base/message_loop/message_loop.h" | 37 #include "base/message_loop/message_loop.h" |
38 #include "base/power_monitor/power_observer.h" | 38 #include "base/power_monitor/power_observer.h" |
39 #include "base/system_monitor/system_monitor.h" | 39 #include "base/system_monitor/system_monitor.h" |
| 40 #include "base/threading/thread.h" |
40 #include "content/browser/renderer_host/media/media_stream_provider.h" | 41 #include "content/browser/renderer_host/media/media_stream_provider.h" |
41 #include "content/common/content_export.h" | 42 #include "content/common/content_export.h" |
42 #include "content/common/media/media_stream_options.h" | 43 #include "content/common/media/media_stream_options.h" |
43 #include "content/public/browser/media_request_state.h" | 44 #include "content/public/browser/media_request_state.h" |
44 #include "content/public/browser/resource_context.h" | 45 #include "content/public/browser/resource_context.h" |
45 | 46 |
46 namespace media { | 47 namespace media { |
47 class AudioManager; | 48 class AudioManager; |
48 } | 49 } |
49 | 50 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 376 |
376 // Task runner shared by VideoCaptureManager and AudioInputDeviceManager and | 377 // Task runner shared by VideoCaptureManager and AudioInputDeviceManager and |
377 // used for enumerating audio output devices. | 378 // used for enumerating audio output devices. |
378 // Note: Enumeration tasks may take seconds to complete so must never be run | 379 // Note: Enumeration tasks may take seconds to complete so must never be run |
379 // on any of the BrowserThreads (UI, IO, etc). See http://crbug.com/256945. | 380 // on any of the BrowserThreads (UI, IO, etc). See http://crbug.com/256945. |
380 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; | 381 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
381 | 382 |
382 media::AudioManager* const audio_manager_; // not owned | 383 media::AudioManager* const audio_manager_; // not owned |
383 scoped_refptr<AudioInputDeviceManager> audio_input_device_manager_; | 384 scoped_refptr<AudioInputDeviceManager> audio_input_device_manager_; |
384 scoped_refptr<VideoCaptureManager> video_capture_manager_; | 385 scoped_refptr<VideoCaptureManager> video_capture_manager_; |
| 386 #if defined(OS_WIN) |
| 387 base::Thread video_capture_thread_; |
| 388 #endif |
385 | 389 |
386 // Indicator of device monitoring state. | 390 // Indicator of device monitoring state. |
387 bool monitoring_started_; | 391 bool monitoring_started_; |
388 | 392 |
389 #if defined(OS_CHROMEOS) | 393 #if defined(OS_CHROMEOS) |
390 // Flag that's set when we have checked if the system has a keyboard mic. We | 394 // Flag that's set when we have checked if the system has a keyboard mic. We |
391 // only need to check it once, and not when constructing since that will | 395 // only need to check it once, and not when constructing since that will |
392 // affect startup time. | 396 // affect startup time. |
393 // Must be accessed on the IO thread; | 397 // Must be accessed on the IO thread; |
394 bool has_checked_keyboard_mic_; | 398 bool has_checked_keyboard_mic_; |
(...skipping 17 matching lines...) Expand all Loading... |
412 | 416 |
413 bool use_fake_ui_; | 417 bool use_fake_ui_; |
414 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; | 418 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; |
415 | 419 |
416 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 420 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
417 }; | 421 }; |
418 | 422 |
419 } // namespace content | 423 } // namespace content |
420 | 424 |
421 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 425 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
OLD | NEW |