| 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 "base/basictypes.h" | 30 #include "base/basictypes.h" |
| 31 #include "base/memory/ref_counted.h" | 31 #include "base/memory/ref_counted.h" |
| 32 #include "base/memory/scoped_ptr.h" | 32 #include "base/memory/scoped_ptr.h" |
| 33 #include "base/message_loop/message_loop.h" | 33 #include "base/message_loop/message_loop.h" |
| 34 #include "base/system_monitor/system_monitor.h" | 34 #include "base/system_monitor/system_monitor.h" |
| 35 #include "content/browser/renderer_host/media/media_stream_provider.h" | 35 #include "content/browser/renderer_host/media/media_stream_provider.h" |
| 36 #include "content/common/content_export.h" | 36 #include "content/common/content_export.h" |
| 37 #include "content/common/media/media_stream_options.h" | 37 #include "content/common/media/media_stream_options.h" |
| 38 #include "content/public/browser/media_request_state.h" | 38 #include "content/public/browser/media_request_state.h" |
| 39 | 39 |
| 40 namespace base { | |
| 41 class Thread; | |
| 42 } | |
| 43 | |
| 44 namespace media { | 40 namespace media { |
| 45 class AudioManager; | 41 class AudioManager; |
| 46 } | 42 } |
| 47 | 43 |
| 48 namespace content { | 44 namespace content { |
| 49 | 45 |
| 50 class AudioInputDeviceManager; | 46 class AudioInputDeviceManager; |
| 51 class FakeMediaStreamUIProxy; | 47 class FakeMediaStreamUIProxy; |
| 52 class MediaStreamDeviceSettings; | 48 class MediaStreamDeviceSettings; |
| 53 class MediaStreamRequester; | 49 class MediaStreamRequester; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 // Finds and returns the device id corresponding to the given | 325 // Finds and returns the device id corresponding to the given |
| 330 // |source_id|. Returns true if there was a raw device id that matched the | 326 // |source_id|. Returns true if there was a raw device id that matched the |
| 331 // given |source_id|, false if nothing matched it. | 327 // given |source_id|, false if nothing matched it. |
| 332 bool TranslateSourceIdToDeviceId( | 328 bool TranslateSourceIdToDeviceId( |
| 333 MediaStreamType stream_type, | 329 MediaStreamType stream_type, |
| 334 ResourceContext* rc, | 330 ResourceContext* rc, |
| 335 const GURL& security_origin, | 331 const GURL& security_origin, |
| 336 const std::string& source_id, | 332 const std::string& source_id, |
| 337 std::string* device_id) const; | 333 std::string* device_id) const; |
| 338 | 334 |
| 339 // Device thread shared by VideoCaptureManager and AudioInputDeviceManager. | 335 // Task runner shared by VideoCaptureManager and AudioInputDeviceManager. |
| 340 scoped_ptr<base::Thread> device_thread_; | 336 // Note: Enumeration tasks may take seconds to complete so must never be run |
| 337 // on any of the BrowserThreads (UI, IO, etc). See http://crbug.com/256945. |
| 338 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
| 341 | 339 |
| 342 media::AudioManager* const audio_manager_; // not owned | 340 media::AudioManager* const audio_manager_; // not owned |
| 343 scoped_refptr<AudioInputDeviceManager> audio_input_device_manager_; | 341 scoped_refptr<AudioInputDeviceManager> audio_input_device_manager_; |
| 344 scoped_refptr<VideoCaptureManager> video_capture_manager_; | 342 scoped_refptr<VideoCaptureManager> video_capture_manager_; |
| 345 | 343 |
| 346 // Indicator of device monitoring state. | 344 // Indicator of device monitoring state. |
| 347 bool monitoring_started_; | 345 bool monitoring_started_; |
| 348 | 346 |
| 349 // Stores most recently enumerated device lists. The cache is cleared when | 347 // Stores most recently enumerated device lists. The cache is cleared when |
| 350 // monitoring is stopped or there is no request for that type of device. | 348 // monitoring is stopped or there is no request for that type of device. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 364 | 362 |
| 365 bool use_fake_ui_; | 363 bool use_fake_ui_; |
| 366 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; | 364 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; |
| 367 | 365 |
| 368 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 366 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
| 369 }; | 367 }; |
| 370 | 368 |
| 371 } // namespace content | 369 } // namespace content |
| 372 | 370 |
| 373 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 371 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
| OLD | NEW |