Index: content/browser/renderer_host/media/media_stream_manager.cc |
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc |
index 0da58a4dc1a807af796a83d476c08bf21425803a..0f1824fb7f7478cf79cecbdd91bd6a467075e63e 100644 |
--- a/content/browser/renderer_host/media/media_stream_manager.cc |
+++ b/content/browser/renderer_host/media/media_stream_manager.cc |
@@ -207,17 +207,6 @@ MediaDeviceType ConvertToMediaDeviceType(MediaStreamType stream_type) { |
return NUM_MEDIA_DEVICE_TYPES; |
} |
-MediaStreamDevices ConvertToMediaStreamDevices( |
- MediaStreamType stream_type, |
- const MediaDeviceInfoArray& device_infos) { |
- MediaStreamDevices devices; |
- for (const auto& info : device_infos) { |
- devices.emplace_back(stream_type, info.device_id, info.label); |
- } |
- |
- return devices; |
-} |
- |
} // namespace |
@@ -945,13 +934,12 @@ void MediaStreamManager::PostRequestToUI( |
if (!fake_ui_) |
fake_ui_.reset(new FakeMediaStreamUIProxy()); |
- MediaStreamDevices devices; |
- for (const auto& info : enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT]) { |
- devices.emplace_back(audio_type, info.device_id, info.label); |
- } |
- for (const auto& info : enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT]) { |
- devices.emplace_back(video_type, info.device_id, info.label); |
- } |
+ MediaStreamDevices devices = ConvertToMediaStreamDevices( |
+ request->audio_type(), enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT]); |
+ MediaStreamDevices video_devices = ConvertToMediaStreamDevices( |
+ request->video_type(), enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT]); |
+ devices.reserve(devices.size() + video_devices.size()); |
+ devices.insert(devices.end(), video_devices.begin(), video_devices.end()); |
fake_ui_->SetAvailableDevices(devices); |
@@ -1749,4 +1737,22 @@ void MediaStreamManager::FlushVideoCaptureThreadForTesting() { |
} |
#endif |
+MediaStreamDevices MediaStreamManager::ConvertToMediaStreamDevices( |
+ MediaStreamType stream_type, |
+ const MediaDeviceInfoArray& device_infos) { |
+ MediaStreamDevices devices; |
+ for (const auto& info : device_infos) { |
+ devices.emplace_back(stream_type, info.device_id, info.label); |
+ } |
mcasas
2017/01/05 01:09:32
No {} for one-line bodies.
aleksandar.stojiljkovic
2017/01/09 18:47:00
Done.
|
+ |
+ if (stream_type == MEDIA_DEVICE_VIDEO_CAPTURE) { |
mcasas
2017/01/05 01:09:32
if (stream_type != MEDIA_DEVICE_VIDEO_CAPTURE)
r
aleksandar.stojiljkovic
2017/01/09 18:47:01
Done.
|
+ for (auto& device : devices) { |
+ video_capture_manager()->GetCameraCalibration(device.id, |
+ &device.camera_calibration); |
+ } |
+ } |
+ |
+ return devices; |
+} |
+ |
} // namespace content |