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 MediaStreamDeviceSettings for permission to | 9 // 2. MediaStreamManager will ask MediaStreamDeviceSettings for permission to |
10 // use devices and for which device to use. | 10 // use devices and for which device to use. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // of real ones. This should NOT be used in production versions of Chrome. | 171 // of real ones. This should NOT be used in production versions of Chrome. |
172 static void AlwaysUseFakeDevice(); | 172 static void AlwaysUseFakeDevice(); |
173 | 173 |
174 // This object gets deleted on the UI thread after the IO thread has been | 174 // This object gets deleted on the UI thread after the IO thread has been |
175 // destroyed. So we need to know when IO thread is being destroyed so that | 175 // destroyed. So we need to know when IO thread is being destroyed so that |
176 // we can delete VideoCaptureManager and AudioInputDeviceManager. | 176 // we can delete VideoCaptureManager and AudioInputDeviceManager. |
177 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; | 177 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; |
178 | 178 |
179 private: | 179 private: |
180 // Contains all data needed to keep track of requests. | 180 // Contains all data needed to keep track of requests. |
181 struct DeviceRequest; | 181 class DeviceRequest; |
182 | 182 |
183 // Cache enumerated device list. | 183 // Cache enumerated device list. |
184 struct EnumerationCache { | 184 struct EnumerationCache { |
185 EnumerationCache(); | 185 EnumerationCache(); |
186 ~EnumerationCache(); | 186 ~EnumerationCache(); |
187 | 187 |
188 bool valid; | 188 bool valid; |
189 StreamDeviceInfoArray devices; | 189 StreamDeviceInfoArray devices; |
190 }; | 190 }; |
191 | 191 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 // Static members. | 253 // Static members. |
254 static bool always_use_fake_devices_; | 254 static bool always_use_fake_devices_; |
255 | 255 |
256 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 256 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
257 }; | 257 }; |
258 | 258 |
259 } // namespace media_stream | 259 } // namespace media_stream |
260 | 260 |
261 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 261 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
OLD | NEW |