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/i18n/timezone.h" | 8 #include "base/i18n/timezone.h" |
8 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "media/base/media_switches.h" | |
9 | 11 |
10 namespace media { | 12 namespace media { |
11 | 13 |
12 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { | 14 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { |
13 const std::string model_id = GetModel(); | 15 const std::string model_id = GetModel(); |
14 if (model_id.empty()) | 16 if (model_id.empty()) |
15 return device_name_; | 17 return device_name_; |
16 const std::string suffix = " (" + model_id + ")"; | 18 const std::string suffix = " (" + model_id + ")"; |
17 if (base::EndsWith(device_name_, suffix, base::CompareCase::SENSITIVE)) | 19 if (base::EndsWith(device_name_, suffix, base::CompareCase::SENSITIVE) || |
20 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
21 switches::kUseFakeDeviceForMediaStream)) | |
22 // Ignore |model_id| if |kUseFakeDeviceForMediaStream| flag is present. | |
mcasas
2015/09/04 02:24:50
Hmm it's not that simple :)
Command line flags, s
msu.koo
2015/09/05 07:58:11
Thank you for your comment :)
A little bit hard to
mcasas
2015/09/08 17:50:15
Yeah, so command line flags are supposed to be
li
msu.koo
2015/09/11 07:08:50
I fully agree with you that should minimize using
mcasas
2015/09/15 17:11:49
Hmm is true that changing the whole infra might pr
| |
18 return device_name_; | 23 return device_name_; |
19 return device_name_ + suffix; | 24 return device_name_ + suffix; |
20 } | 25 } |
21 | 26 |
22 VideoCaptureDevice::Name::Name() { | 27 VideoCaptureDevice::Name::Name() { |
23 } | 28 } |
24 | 29 |
25 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id) | 30 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id) |
26 : device_name_(name), unique_id_(id) { | 31 : device_name_(name), unique_id_(id) { |
27 } | 32 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 switch (params.power_line_frequency) { | 168 switch (params.power_line_frequency) { |
164 case media::PowerLineFrequency::FREQUENCY_50HZ: // fall through | 169 case media::PowerLineFrequency::FREQUENCY_50HZ: // fall through |
165 case media::PowerLineFrequency::FREQUENCY_60HZ: | 170 case media::PowerLineFrequency::FREQUENCY_60HZ: |
166 return static_cast<int>(params.power_line_frequency); | 171 return static_cast<int>(params.power_line_frequency); |
167 default: | 172 default: |
168 return GetPowerLineFrequencyForLocation(); | 173 return GetPowerLineFrequencyForLocation(); |
169 } | 174 } |
170 } | 175 } |
171 | 176 |
172 } // namespace media | 177 } // namespace media |
OLD | NEW |