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(MediaStreamType type, | 370 bool PickDeviceId(const std::string& salt, |
371 const std::string& salt, | |
372 const url::Origin& security_origin, | 371 const url::Origin& security_origin, |
373 const TrackControls& controls, | 372 const TrackControls& controls, |
374 const MediaDeviceInfoArray& devices, | 373 const MediaDeviceInfoArray& devices, |
375 std::string* device_id) const; | 374 std::string* device_id) const; |
376 | 375 |
377 // Finds the requested device id from request. The requested device type | 376 // Finds the requested device id from request. The requested device type |
378 // must be MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE. | 377 // must be MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE. |
379 bool GetRequestedDeviceCaptureId(const DeviceRequest* request, | 378 bool GetRequestedDeviceCaptureId(const DeviceRequest* request, |
380 MediaStreamType type, | 379 MediaStreamType type, |
381 const MediaDeviceInfoArray& devices, | 380 const MediaDeviceInfoArray& devices, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 std::map<int, base::Callback<void(const std::string&)>> log_callbacks_; | 426 std::map<int, base::Callback<void(const std::string&)>> log_callbacks_; |
428 | 427 |
429 GenerateStreamTestCallback generate_stream_test_callback_; | 428 GenerateStreamTestCallback generate_stream_test_callback_; |
430 | 429 |
431 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 430 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
432 }; | 431 }; |
433 | 432 |
434 } // namespace content | 433 } // namespace content |
435 | 434 |
436 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 435 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
OLD | NEW |