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 media capture devices (video supported | 5 // MediaStreamManager is used to open media capture devices (video supported |
6 // now). Call flow: | 6 // 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 27 matching lines...) Expand all Loading... |
38 #include "base/message_loop/message_loop.h" | 38 #include "base/message_loop/message_loop.h" |
39 #include "base/power_monitor/power_observer.h" | 39 #include "base/power_monitor/power_observer.h" |
40 #include "base/threading/thread.h" | 40 #include "base/threading/thread.h" |
41 #include "build/build_config.h" | 41 #include "build/build_config.h" |
42 #include "content/browser/renderer_host/media/media_devices_manager.h" | 42 #include "content/browser/renderer_host/media/media_devices_manager.h" |
43 #include "content/browser/renderer_host/media/media_stream_provider.h" | 43 #include "content/browser/renderer_host/media/media_stream_provider.h" |
44 #include "content/common/content_export.h" | 44 #include "content/common/content_export.h" |
45 #include "content/common/media/media_devices.h" | 45 #include "content/common/media/media_devices.h" |
46 #include "content/common/media/media_stream_options.h" | 46 #include "content/common/media/media_stream_options.h" |
47 #include "content/public/browser/media_request_state.h" | 47 #include "content/public/browser/media_request_state.h" |
| 48 #include "media/base/video_facing.h" |
48 | 49 |
49 namespace media { | 50 namespace media { |
50 class AudioManager; | 51 class AudioManager; |
51 } | 52 } |
52 | 53 |
53 namespace url { | 54 namespace url { |
54 class Origin; | 55 class Origin; |
55 } | 56 } |
56 | 57 |
57 namespace content { | 58 namespace content { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 91 |
91 // Used to access VideoCaptureManager. | 92 // Used to access VideoCaptureManager. |
92 VideoCaptureManager* video_capture_manager(); | 93 VideoCaptureManager* video_capture_manager(); |
93 | 94 |
94 // Used to access AudioInputDeviceManager. | 95 // Used to access AudioInputDeviceManager. |
95 AudioInputDeviceManager* audio_input_device_manager(); | 96 AudioInputDeviceManager* audio_input_device_manager(); |
96 | 97 |
97 // Used to access MediaDevicesManager. | 98 // Used to access MediaDevicesManager. |
98 MediaDevicesManager* media_devices_manager(); | 99 MediaDevicesManager* media_devices_manager(); |
99 | 100 |
| 101 // AddVideoCaptureObserver() and RemoveAllVideoCaptureObservers() should be |
| 102 // called after InitializeDeviceManagersOnIOThread() and before |
| 103 // WillDestroyCurrentMessageLoop(). They can be called more than once and it's |
| 104 // ok to not call at all if the client is not interested in receiving |
| 105 // media::VideoCaptureObserver callacks. |
| 106 // The methods can be called on whatever thread. The callbacks of |
| 107 // media::VideoCaptureObserver arrive on BrowserThread::IO. |
| 108 void AddVideoCaptureObserver(media::VideoCaptureObserver* capture_observer); |
| 109 void RemoveAllVideoCaptureObservers(); |
| 110 |
100 // Creates a new media access request which is identified by a unique string | 111 // Creates a new media access request which is identified by a unique string |
101 // that's returned to the caller. This will trigger the infobar and ask users | 112 // that's returned to the caller. This will trigger the infobar and ask users |
102 // for access to the device. |render_process_id| and |render_frame_id| are | 113 // for access to the device. |render_process_id| and |render_frame_id| are |
103 // used to determine where the infobar will appear to the user. |callback| is | 114 // used to determine where the infobar will appear to the user. |callback| is |
104 // used to send the selected device to the clients. An empty list of device | 115 // used to send the selected device to the clients. An empty list of device |
105 // will be returned if the users deny the access. | 116 // will be returned if the users deny the access. |
106 std::string MakeMediaAccessRequest( | 117 std::string MakeMediaAccessRequest( |
107 int render_process_id, | 118 int render_process_id, |
108 int render_frame_id, | 119 int render_frame_id, |
109 int page_request_id, | 120 int page_request_id, |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 std::map<int, base::Callback<void(const std::string&)>> log_callbacks_; | 418 std::map<int, base::Callback<void(const std::string&)>> log_callbacks_; |
408 | 419 |
409 GenerateStreamTestCallback generate_stream_test_callback_; | 420 GenerateStreamTestCallback generate_stream_test_callback_; |
410 | 421 |
411 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 422 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
412 }; | 423 }; |
413 | 424 |
414 } // namespace content | 425 } // namespace content |
415 | 426 |
416 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 427 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
OLD | NEW |