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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // The request is identified using string returned to the caller. | 131 // The request is identified using string returned to the caller. |
132 std::string OpenDevice(MediaStreamRequester* requester, | 132 std::string OpenDevice(MediaStreamRequester* requester, |
133 int render_process_id, | 133 int render_process_id, |
134 int render_view_id, | 134 int render_view_id, |
135 ResourceContext* rc, | 135 ResourceContext* rc, |
136 int page_request_id, | 136 int page_request_id, |
137 const std::string& device_id, | 137 const std::string& device_id, |
138 MediaStreamType type, | 138 MediaStreamType type, |
139 const GURL& security_origin); | 139 const GURL& security_origin); |
140 | 140 |
| 141 // Called by UI to make sure the device monitor is started so that UI receive |
| 142 // notifications about device changes. |
| 143 void EnsureDeviceMonitorStarted(); |
| 144 |
141 // Implements MediaStreamProviderListener. | 145 // Implements MediaStreamProviderListener. |
142 virtual void Opened(MediaStreamType stream_type, | 146 virtual void Opened(MediaStreamType stream_type, |
143 int capture_session_id) OVERRIDE; | 147 int capture_session_id) OVERRIDE; |
144 virtual void Closed(MediaStreamType stream_type, | 148 virtual void Closed(MediaStreamType stream_type, |
145 int capture_session_id) OVERRIDE; | 149 int capture_session_id) OVERRIDE; |
146 virtual void DevicesEnumerated(MediaStreamType stream_type, | 150 virtual void DevicesEnumerated(MediaStreamType stream_type, |
147 const StreamDeviceInfoArray& devices) OVERRIDE; | 151 const StreamDeviceInfoArray& devices) OVERRIDE; |
148 | 152 |
149 // Implements base::SystemMonitor::DevicesChangedObserver. | 153 // Implements base::SystemMonitor::DevicesChangedObserver. |
150 virtual void OnDevicesChanged( | 154 virtual void OnDevicesChanged( |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 321 |
318 bool use_fake_ui_; | 322 bool use_fake_ui_; |
319 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; | 323 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; |
320 | 324 |
321 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 325 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
322 }; | 326 }; |
323 | 327 |
324 } // namespace content | 328 } // namespace content |
325 | 329 |
326 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 330 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
OLD | NEW |