Chromium Code Reviews| 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/capture/video/video_capture_device.h" | 5 #include "media/capture/video/video_capture_device.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/i18n/timezone.h" | 8 #include "base/i18n/timezone.h" |
| 9 #include "base/logging.h" | |
| 9 #include "base/macros.h" | 10 #include "base/macros.h" |
| 10 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 12 #include "media/base/media_switches.h" | 13 #include "media/base/media_switches.h" |
| 13 | 14 |
| 14 namespace media { | 15 namespace media { |
| 15 | 16 |
| 16 // TODO(msu.koo): http://crbug.com/532272, remove checking the switch in favour | 17 // TODO(msu.koo): http://crbug.com/532272, remove checking the switch in favour |
| 17 // of deferring GetModel() call to the actual VideoCaptureDevice object. | 18 // of deferring GetModel() call to the actual VideoCaptureDevice object. |
| 18 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { | 19 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 } | 139 } |
| 139 } | 140 } |
| 140 #endif | 141 #endif |
| 141 | 142 |
| 142 VideoCaptureDevice::Client::Buffer::~Buffer() { | 143 VideoCaptureDevice::Client::Buffer::~Buffer() { |
| 143 } | 144 } |
| 144 | 145 |
| 145 VideoCaptureDevice::~VideoCaptureDevice() { | 146 VideoCaptureDevice::~VideoCaptureDevice() { |
| 146 } | 147 } |
| 147 | 148 |
| 149 void VideoCaptureDevice::RequestRefreshFrame() { | |
| 150 DVLOG(2) << "Ignoring request for refresh frame (no implementation)."; | |
|
emircan
2016/03/25 22:44:24
|NOTIMPLEMENTED();| ?
miu
2016/03/25 23:13:48
This wouldn't be appropriate for normal webcams.
| |
| 151 } | |
| 152 | |
| 148 PowerLineFrequency VideoCaptureDevice::GetPowerLineFrequencyForLocation() | 153 PowerLineFrequency VideoCaptureDevice::GetPowerLineFrequencyForLocation() |
| 149 const { | 154 const { |
| 150 const std::string current_country = base::CountryCodeForCurrentTimezone(); | 155 const std::string current_country = base::CountryCodeForCurrentTimezone(); |
| 151 if (current_country.empty()) | 156 if (current_country.empty()) |
| 152 return PowerLineFrequency::FREQUENCY_DEFAULT; | 157 return PowerLineFrequency::FREQUENCY_DEFAULT; |
| 153 // Sorted out list of countries with 60Hz power line frequency, from | 158 // Sorted out list of countries with 60Hz power line frequency, from |
| 154 // http://en.wikipedia.org/wiki/Mains_electricity_by_country | 159 // http://en.wikipedia.org/wiki/Mains_electricity_by_country |
| 155 const char* countries_using_60Hz[] = { | 160 const char* countries_using_60Hz[] = { |
| 156 "AI", "AO", "AS", "AW", "AZ", "BM", "BR", "BS", "BZ", "CA", "CO", | 161 "AI", "AO", "AS", "AW", "AZ", "BM", "BR", "BS", "BZ", "CA", "CO", |
| 157 "CR", "CU", "DO", "EC", "FM", "GT", "GU", "GY", "HN", "HT", "JP", | 162 "CR", "CU", "DO", "EC", "FM", "GT", "GU", "GY", "HN", "HT", "JP", |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 171 switch (params.power_line_frequency) { | 176 switch (params.power_line_frequency) { |
| 172 case media::PowerLineFrequency::FREQUENCY_50HZ: // fall through | 177 case media::PowerLineFrequency::FREQUENCY_50HZ: // fall through |
| 173 case media::PowerLineFrequency::FREQUENCY_60HZ: | 178 case media::PowerLineFrequency::FREQUENCY_60HZ: |
| 174 return params.power_line_frequency; | 179 return params.power_line_frequency; |
| 175 default: | 180 default: |
| 176 return GetPowerLineFrequencyForLocation(); | 181 return GetPowerLineFrequencyForLocation(); |
| 177 } | 182 } |
| 178 } | 183 } |
| 179 | 184 |
| 180 } // namespace media | 185 } // namespace media |
| OLD | NEW |