Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: content/browser/renderer_host/media/media_devices_dispatcher_host.cc

Issue 2810723002: Refactor VideoCaptureManager::GetDeviceFormatsInUse() (Closed)
Patch Set: Addressed review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/media_devices_dispatcher_host.cc
diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host.cc b/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
index 2a28c625bb7c09e59f102e847de7f169efe66827..1c9487400bda64d5de29d1e8a749d65ef32fd642 100644
--- a/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
+++ b/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
@@ -407,10 +407,13 @@ media::VideoCaptureFormats MediaDevicesDispatcherHost::GetVideoInputFormats(
const std::string& device_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
media::VideoCaptureFormats formats;
- media_stream_manager_->video_capture_manager()->GetDeviceFormatsInUse(
- MEDIA_DEVICE_VIDEO_CAPTURE, device_id, &formats);
- if (!formats.empty())
+ base::Optional<media::VideoCaptureFormat> format =
+ media_stream_manager_->video_capture_manager()->GetDeviceFormatInUse(
+ MEDIA_DEVICE_VIDEO_CAPTURE, device_id);
+ if (format.has_value()) {
+ formats.push_back(format.value());
return formats;
+ }
media_stream_manager_->video_capture_manager()->GetDeviceSupportedFormats(
device_id, &formats);
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698