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