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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 const MediaStreamDevices& devices); | 360 const MediaStreamDevices& devices); |
361 void HandleCheckMediaAccessResponse(const std::string& label, | 361 void HandleCheckMediaAccessResponse(const std::string& label, |
362 bool have_access); | 362 bool have_access); |
363 | 363 |
364 // Picks a device ID from a list of required and alternate device IDs, | 364 // Picks a device ID from a list of required and alternate device IDs, |
365 // presented as part of a TrackControls structure. | 365 // presented as part of a TrackControls structure. |
366 // Either the required device ID is picked (if present), or the first | 366 // Either the required device ID is picked (if present), or the first |
367 // valid alternate device ID. | 367 // valid alternate device ID. |
368 // Returns false if the required device ID is present and invalid. | 368 // Returns false if the required device ID is present and invalid. |
369 // Otherwise, if no valid device is found, device_id is unchanged. | 369 // Otherwise, if no valid device is found, device_id is unchanged. |
370 bool PickDeviceId(const std::string& salt, | 370 bool PickDeviceId(MediaStreamType type, |
| 371 const std::string& salt, |
371 const url::Origin& security_origin, | 372 const url::Origin& security_origin, |
372 const TrackControls& controls, | 373 const TrackControls& controls, |
373 const MediaDeviceInfoArray& devices, | 374 const MediaDeviceInfoArray& devices, |
374 std::string* device_id) const; | 375 std::string* device_id) const; |
375 | 376 |
376 // Finds the requested device id from request. The requested device type | 377 // Finds the requested device id from request. The requested device type |
377 // must be MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE. | 378 // must be MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE. |
378 bool GetRequestedDeviceCaptureId(const DeviceRequest* request, | 379 bool GetRequestedDeviceCaptureId(const DeviceRequest* request, |
379 MediaStreamType type, | 380 MediaStreamType type, |
380 const MediaDeviceInfoArray& devices, | 381 const MediaDeviceInfoArray& devices, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 std::map<int, base::Callback<void(const std::string&)>> log_callbacks_; | 427 std::map<int, base::Callback<void(const std::string&)>> log_callbacks_; |
427 | 428 |
428 GenerateStreamTestCallback generate_stream_test_callback_; | 429 GenerateStreamTestCallback generate_stream_test_callback_; |
429 | 430 |
430 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 431 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
431 }; | 432 }; |
432 | 433 |
433 } // namespace content | 434 } // namespace content |
434 | 435 |
435 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 436 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
OLD | NEW |