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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« 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