| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 case TANGO: | 121 case TANGO: |
| 122 return "Tango API"; | 122 return "Tango API"; |
| 123 case API_TYPE_UNKNOWN: | 123 case API_TYPE_UNKNOWN: |
| 124 default: | 124 default: |
| 125 NOTREACHED() << "Unknown Video Capture API type!"; | 125 NOTREACHED() << "Unknown Video Capture API type!"; |
| 126 return "Unknown API"; | 126 return "Unknown API"; |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 #endif | 129 #endif |
| 130 | 130 |
| 131 VideoCaptureDevice::Client::Buffer::~Buffer() {} | |
| 132 | |
| 133 VideoCaptureDevice::~VideoCaptureDevice() {} | 131 VideoCaptureDevice::~VideoCaptureDevice() {} |
| 134 | 132 |
| 135 int VideoCaptureDevice::GetPowerLineFrequencyForLocation() const { | 133 int VideoCaptureDevice::GetPowerLineFrequencyForLocation() const { |
| 136 std::string current_country = base::CountryCodeForCurrentTimezone(); | 134 std::string current_country = base::CountryCodeForCurrentTimezone(); |
| 137 if (current_country.empty()) | 135 if (current_country.empty()) |
| 138 return 0; | 136 return 0; |
| 139 // Sorted out list of countries with 60Hz power line frequency, from | 137 // Sorted out list of countries with 60Hz power line frequency, from |
| 140 // http://en.wikipedia.org/wiki/Mains_electricity_by_country | 138 // http://en.wikipedia.org/wiki/Mains_electricity_by_country |
| 141 const char* countries_using_60Hz[] = { | 139 const char* countries_using_60Hz[] = { |
| 142 "AI", "AO", "AS", "AW", "AZ", "BM", "BR", "BS", "BZ", "CA", "CO", | 140 "AI", "AO", "AS", "AW", "AZ", "BM", "BR", "BS", "BZ", "CA", "CO", |
| 143 "CR", "CU", "DO", "EC", "FM", "GT", "GU", "GY", "HN", "HT", "JP", | 141 "CR", "CU", "DO", "EC", "FM", "GT", "GU", "GY", "HN", "HT", "JP", |
| 144 "KN", "KR", "KY", "MS", "MX", "NI", "PA", "PE", "PF", "PH", "PR", | 142 "KN", "KR", "KY", "MS", "MX", "NI", "PA", "PE", "PF", "PH", "PR", |
| 145 "PW", "SA", "SR", "SV", "TT", "TW", "UM", "US", "VG", "VI", "VE"}; | 143 "PW", "SA", "SR", "SV", "TT", "TW", "UM", "US", "VG", "VI", "VE"}; |
| 146 const char** countries_using_60Hz_end = | 144 const char** countries_using_60Hz_end = |
| 147 countries_using_60Hz + arraysize(countries_using_60Hz); | 145 countries_using_60Hz + arraysize(countries_using_60Hz); |
| 148 if (std::find(countries_using_60Hz, countries_using_60Hz_end, | 146 if (std::find(countries_using_60Hz, countries_using_60Hz_end, |
| 149 current_country) == countries_using_60Hz_end) { | 147 current_country) == countries_using_60Hz_end) { |
| 150 return kPowerLine50Hz; | 148 return kPowerLine50Hz; |
| 151 } | 149 } |
| 152 return kPowerLine60Hz; | 150 return kPowerLine60Hz; |
| 153 } | 151 } |
| 154 | 152 |
| 155 } // namespace media | 153 } // namespace media |
| OLD | NEW |