OLD | NEW |
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 | 6 |
7 #include "base/i18n/timezone.h" | 7 #include "base/i18n/timezone.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
12 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { | 12 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { |
13 const std::string model_id = GetModel(); | 13 const std::string model_id = GetModel(); |
14 if (model_id.empty()) | 14 if (model_id.empty()) |
15 return device_name_; | 15 return device_name_; |
16 const std::string suffix = " (" + model_id + ")"; | 16 const std::string suffix = " (" + model_id + ")"; |
17 if (EndsWith(device_name_, suffix, true)) // |true| means case-sensitive. | 17 if (base::EndsWith(device_name_, suffix, true /* case sensitive */)) |
18 return device_name_; | 18 return device_name_; |
19 return device_name_ + suffix; | 19 return device_name_ + suffix; |
20 } | 20 } |
21 | 21 |
22 VideoCaptureDevice::Name::Name() {} | 22 VideoCaptureDevice::Name::Name() {} |
23 | 23 |
24 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id) | 24 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id) |
25 : device_name_(name), unique_id_(id) {} | 25 : device_name_(name), unique_id_(id) {} |
26 | 26 |
27 #if defined(OS_LINUX) | 27 #if defined(OS_LINUX) |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 const char** countries_using_60Hz_end = | 146 const char** countries_using_60Hz_end = |
147 countries_using_60Hz + arraysize(countries_using_60Hz); | 147 countries_using_60Hz + arraysize(countries_using_60Hz); |
148 if (std::find(countries_using_60Hz, countries_using_60Hz_end, | 148 if (std::find(countries_using_60Hz, countries_using_60Hz_end, |
149 current_country) == countries_using_60Hz_end) { | 149 current_country) == countries_using_60Hz_end) { |
150 return kPowerLine50Hz; | 150 return kPowerLine50Hz; |
151 } | 151 } |
152 return kPowerLine60Hz; | 152 return kPowerLine60Hz; |
153 } | 153 } |
154 | 154 |
155 } // namespace media | 155 } // namespace media |
OLD | NEW |