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

Side by Side Diff: content/browser/renderer_host/media/media_devices_manager.cc

Issue 2650153003: Add constructors and operators to MediaDeviceInfo. (Closed)
Patch Set: Created 3 years, 10 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/common/media/media_devices.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_manager.h" 5 #include "content/browser/renderer_host/media/media_devices_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 is_input), 378 is_input),
379 base::Bind(&MediaDevicesManager::DevicesEnumerated, 379 base::Bind(&MediaDevicesManager::DevicesEnumerated,
380 weak_factory_.GetWeakPtr(), type)); 380 weak_factory_.GetWeakPtr(), type));
381 } 381 }
382 382
383 void MediaDevicesManager::VideoInputDevicesEnumerated( 383 void MediaDevicesManager::VideoInputDevicesEnumerated(
384 const media::VideoCaptureDeviceDescriptors& descriptors) { 384 const media::VideoCaptureDeviceDescriptors& descriptors) {
385 DCHECK_CURRENTLY_ON(BrowserThread::IO); 385 DCHECK_CURRENTLY_ON(BrowserThread::IO);
386 MediaDeviceInfoArray snapshot; 386 MediaDeviceInfoArray snapshot;
387 for (const auto& descriptor : descriptors) { 387 for (const auto& descriptor : descriptors) {
388 snapshot.emplace_back(descriptor.device_id, descriptor.GetNameAndModel(), 388 snapshot.emplace_back(descriptor);
389 std::string());
390 } 389 }
391 DevicesEnumerated(MEDIA_DEVICE_TYPE_VIDEO_INPUT, snapshot); 390 DevicesEnumerated(MEDIA_DEVICE_TYPE_VIDEO_INPUT, snapshot);
392 } 391 }
393 392
394 void MediaDevicesManager::DevicesEnumerated( 393 void MediaDevicesManager::DevicesEnumerated(
395 MediaDeviceType type, 394 MediaDeviceType type,
396 const MediaDeviceInfoArray& snapshot) { 395 const MediaDeviceInfoArray& snapshot) {
397 DCHECK_CURRENTLY_ON(BrowserThread::IO); 396 DCHECK_CURRENTLY_ON(BrowserThread::IO);
398 DCHECK(IsValidMediaDeviceType(type)); 397 DCHECK(IsValidMediaDeviceType(type));
399 UpdateSnapshot(type, snapshot); 398 UpdateSnapshot(type, snapshot);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 const MediaDeviceInfoArray& snapshot) { 519 const MediaDeviceInfoArray& snapshot) {
521 DCHECK_CURRENTLY_ON(BrowserThread::IO); 520 DCHECK_CURRENTLY_ON(BrowserThread::IO);
522 DCHECK(IsValidMediaDeviceType(type)); 521 DCHECK(IsValidMediaDeviceType(type));
523 522
524 for (const auto& subscriber : device_change_subscribers_[type]) { 523 for (const auto& subscriber : device_change_subscribers_[type]) {
525 subscriber->OnDevicesChanged(type, snapshot); 524 subscriber->OnDevicesChanged(type, snapshot);
526 } 525 }
527 } 526 }
528 527
529 } // namespace content 528 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/media/media_devices.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698