| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 const MediaDeviceInfoArray& devices); | 242 const MediaDeviceInfoArray& devices); |
| 243 | 243 |
| 244 // This method is called when an audio or video device is removed. It makes | 244 // This method is called when an audio or video device is removed. It makes |
| 245 // sure all MediaStreams that use a removed device are stopped and that the | 245 // sure all MediaStreams that use a removed device are stopped and that the |
| 246 // render process is notified. | 246 // render process is notified. |
| 247 void StopRemovedDevice(MediaDeviceType type, const MediaDeviceInfo& device); | 247 void StopRemovedDevice(MediaDeviceType type, const MediaDeviceInfo& device); |
| 248 | 248 |
| 249 void SetGenerateStreamCallbackForTesting( | 249 void SetGenerateStreamCallbackForTesting( |
| 250 GenerateStreamTestCallback test_callback); | 250 GenerateStreamTestCallback test_callback); |
| 251 | 251 |
| 252 #if defined(OS_WIN) |
| 253 void FlushVideoCaptureThreadForTesting(); |
| 254 #endif |
| 255 |
| 252 private: | 256 private: |
| 253 // Contains all data needed to keep track of requests. | 257 // Contains all data needed to keep track of requests. |
| 254 class DeviceRequest; | 258 class DeviceRequest; |
| 255 | 259 |
| 256 // |DeviceRequests| is a list to ensure requests are processed in the order | 260 // |DeviceRequests| is a list to ensure requests are processed in the order |
| 257 // they arrive. The first member of the pair is the label of the | 261 // they arrive. The first member of the pair is the label of the |
| 258 // |DeviceRequest|. | 262 // |DeviceRequest|. |
| 259 using LabeledDeviceRequest = std::pair<std::string, DeviceRequest*>; | 263 using LabeledDeviceRequest = std::pair<std::string, DeviceRequest*>; |
| 260 using DeviceRequests = std::list<LabeledDeviceRequest>; | 264 using DeviceRequests = std::list<LabeledDeviceRequest>; |
| 261 | 265 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 std::map<int, base::Callback<void(const std::string&)>> log_callbacks_; | 407 std::map<int, base::Callback<void(const std::string&)>> log_callbacks_; |
| 404 | 408 |
| 405 GenerateStreamTestCallback generate_stream_test_callback_; | 409 GenerateStreamTestCallback generate_stream_test_callback_; |
| 406 | 410 |
| 407 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 411 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
| 408 }; | 412 }; |
| 409 | 413 |
| 410 } // namespace content | 414 } // namespace content |
| 411 | 415 |
| 412 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 416 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
| OLD | NEW |