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