| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h" | 5 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 client_callback.Run(std::move(video_input_capabilities)); | 403 client_callback.Run(std::move(video_input_capabilities)); |
| 404 } | 404 } |
| 405 | 405 |
| 406 media::VideoCaptureFormats MediaDevicesDispatcherHost::GetVideoInputFormats( | 406 media::VideoCaptureFormats MediaDevicesDispatcherHost::GetVideoInputFormats( |
| 407 const std::string& device_id) { | 407 const std::string& device_id) { |
| 408 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 408 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 409 media::VideoCaptureFormats formats; | 409 media::VideoCaptureFormats formats; |
| 410 media_stream_manager_->video_capture_manager()->GetDeviceFormatsInUse( | 410 base::Optional<media::VideoCaptureFormat> format = |
| 411 MEDIA_DEVICE_VIDEO_CAPTURE, device_id, &formats); | 411 media_stream_manager_->video_capture_manager()->GetDeviceFormatInUse( |
| 412 if (!formats.empty()) | 412 MEDIA_DEVICE_VIDEO_CAPTURE, device_id); |
| 413 if (format.has_value()) { |
| 414 formats.push_back(format.value()); |
| 413 return formats; | 415 return formats; |
| 416 } |
| 414 | 417 |
| 415 media_stream_manager_->video_capture_manager()->GetDeviceSupportedFormats( | 418 media_stream_manager_->video_capture_manager()->GetDeviceSupportedFormats( |
| 416 device_id, &formats); | 419 device_id, &formats); |
| 417 return formats; | 420 return formats; |
| 418 } | 421 } |
| 419 | 422 |
| 420 } // namespace content | 423 } // namespace content |
| OLD | NEW |