| 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 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 : device_name_(name), unique_id_(id), capture_api_class_(api_type) {} | 31 : device_name_(name), unique_id_(id), capture_api_class_(api_type) {} |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 #if defined(OS_MACOSX) | 34 #if defined(OS_MACOSX) |
| 35 VideoCaptureDevice::Name::Name(const std::string& name, | 35 VideoCaptureDevice::Name::Name(const std::string& name, |
| 36 const std::string& id, | 36 const std::string& id, |
| 37 const CaptureApiType api_type) | 37 const CaptureApiType api_type) |
| 38 : device_name_(name), | 38 : device_name_(name), |
| 39 unique_id_(id), | 39 unique_id_(id), |
| 40 capture_api_class_(api_type), | 40 capture_api_class_(api_type), |
| 41 transport_type_(OTHER_TRANSPORT) {} | 41 transport_type_(OTHER_TRANSPORT), |
| 42 is_blacklisted_(false) {} |
| 42 | 43 |
| 43 VideoCaptureDevice::Name::Name(const std::string& name, | 44 VideoCaptureDevice::Name::Name(const std::string& name, |
| 44 const std::string& id, | 45 const std::string& id, |
| 45 const CaptureApiType api_type, | 46 const CaptureApiType api_type, |
| 46 const TransportType transport_type) | 47 const TransportType transport_type) |
| 47 : device_name_(name), | 48 : device_name_(name), |
| 48 unique_id_(id), | 49 unique_id_(id), |
| 49 capture_api_class_(api_type), | 50 capture_api_class_(api_type), |
| 50 transport_type_(transport_type) {} | 51 transport_type_(transport_type), |
| 52 is_blacklisted_(false) {} |
| 51 #endif | 53 #endif |
| 52 | 54 |
| 53 VideoCaptureDevice::Name::~Name() {} | 55 VideoCaptureDevice::Name::~Name() {} |
| 54 | 56 |
| 55 VideoCaptureDevice::~VideoCaptureDevice() {} | 57 VideoCaptureDevice::~VideoCaptureDevice() {} |
| 56 | 58 |
| 57 int VideoCaptureDevice::GetPowerLineFrequencyForLocation() const { | 59 int VideoCaptureDevice::GetPowerLineFrequencyForLocation() const { |
| 58 std::string current_country = base::CountryCodeForCurrentTimezone(); | 60 std::string current_country = base::CountryCodeForCurrentTimezone(); |
| 59 if (current_country.empty()) | 61 if (current_country.empty()) |
| 60 return 0; | 62 return 0; |
| 61 // Sorted out list of countries with 60Hz power line frequency, from | 63 // Sorted out list of countries with 60Hz power line frequency, from |
| 62 // http://en.wikipedia.org/wiki/Mains_electricity_by_country | 64 // http://en.wikipedia.org/wiki/Mains_electricity_by_country |
| 63 const char* countries_using_60Hz[] = { | 65 const char* countries_using_60Hz[] = { |
| 64 "AI", "AO", "AS", "AW", "AZ", "BM", "BR", "BS", "BZ", "CA", "CO", | 66 "AI", "AO", "AS", "AW", "AZ", "BM", "BR", "BS", "BZ", "CA", "CO", |
| 65 "CR", "CU", "DO", "EC", "FM", "GT", "GU", "GY", "HN", "HT", "JP", | 67 "CR", "CU", "DO", "EC", "FM", "GT", "GU", "GY", "HN", "HT", "JP", |
| 66 "KN", "KR", "KY", "MS", "MX", "NI", "PA", "PE", "PF", "PH", "PR", | 68 "KN", "KR", "KY", "MS", "MX", "NI", "PA", "PE", "PF", "PH", "PR", |
| 67 "PW", "SA", "SR", "SV", "TT", "TW", "UM", "US", "VG", "VI", "VE"}; | 69 "PW", "SA", "SR", "SV", "TT", "TW", "UM", "US", "VG", "VI", "VE"}; |
| 68 const char** countries_using_60Hz_end = | 70 const char** countries_using_60Hz_end = |
| 69 countries_using_60Hz + arraysize(countries_using_60Hz); | 71 countries_using_60Hz + arraysize(countries_using_60Hz); |
| 70 if (std::find(countries_using_60Hz, countries_using_60Hz_end, | 72 if (std::find(countries_using_60Hz, countries_using_60Hz_end, |
| 71 current_country) == countries_using_60Hz_end) { | 73 current_country) == countries_using_60Hz_end) { |
| 72 return kPowerLine50Hz; | 74 return kPowerLine50Hz; |
| 73 } | 75 } |
| 74 return kPowerLine60Hz; | 76 return kPowerLine60Hz; |
| 75 } | 77 } |
| 76 | 78 |
| 77 } // namespace media | 79 } // namespace media |
| OLD | NEW |