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

Side by Side Diff: media/video/capture/video_capture_device.cc

Issue 29423003: Added video capture capabilities retrieval and caching to VideoCaptureManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed mechanics of Caps enumeration to be asynchronous and 2 threaded. UT adapted. Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/video/capture/video_capture_device.h" 5 #include "media/video/capture/video_capture_device.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 7
8 namespace media { 8 namespace media {
9 9
10 VideoCaptureDevice::Name::Name() {}
11
12 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id)
13 : device_name_(name), unique_id_(id) {}
14
15 VideoCaptureDevice::Name::~Name() {}
16
10 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { 17 const std::string VideoCaptureDevice::Name::GetNameAndModel() const {
11 const std::string model_id = GetModel(); 18 const std::string model_id = GetModel();
12 if (model_id.empty()) 19 if (model_id.empty())
13 return device_name_; 20 return device_name_;
14 const std::string suffix = " (" + model_id + ")"; 21 const std::string suffix = " (" + model_id + ")";
15 if (EndsWith(device_name_, suffix, true)) // |true| means case-sensitive. 22 if (EndsWith(device_name_, suffix, true)) // |true| means case-sensitive.
16 return device_name_; 23 return device_name_;
17 return device_name_ + suffix; 24 return device_name_ + suffix;
18 } 25 }
19 26
20 VideoCaptureDevice::Name* 27 VideoCaptureDevice::Name*
21 VideoCaptureDevice::Names::FindById(const std::string& id) { 28 VideoCaptureDevice::Names::FindById(const std::string& id) {
22 for (iterator it = begin(); it != end(); ++it) { 29 for (iterator it = begin(); it != end(); ++it) {
23 if (it->id() == id) 30 if (it->id() == id)
24 return &(*it); 31 return &(*it);
25 } 32 }
26 return NULL; 33 return NULL;
27 } 34 }
28 35
29 VideoCaptureDevice::~VideoCaptureDevice() {} 36 VideoCaptureDevice::~VideoCaptureDevice() {}
30 37
31 } // namespace media 38 } // namespace media
OLDNEW
« media/video/capture/video_capture_device.h ('K') | « media/video/capture/video_capture_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698