Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: media/capture/video/video_capture_device.cc

Issue 1326663002: Fixed not to append the model id when fake video device is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
14 // TODO(msu.koo): http://crbug.com/532272, remove checking the switch in favour
15 // of deferring GetModel() call to the actual VideoCaptureDevice object.
12 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { 16 const std::string VideoCaptureDevice::Name::GetNameAndModel() const {
13 const std::string model_id = GetModel(); 17 const std::string model_id = GetModel();
14 if (model_id.empty()) 18 if (model_id.empty())
15 return device_name_; 19 return device_name_;
16 const std::string suffix = " (" + model_id + ")"; 20 const std::string suffix = " (" + model_id + ")";
17 if (base::EndsWith(device_name_, suffix, base::CompareCase::SENSITIVE)) 21 if (base::EndsWith(device_name_, suffix, base::CompareCase::SENSITIVE) ||
22 base::CommandLine::ForCurrentProcess()->HasSwitch(
23 switches::kUseFakeDeviceForMediaStream))
24 // Ignore |model_id| if |kUseFakeDeviceForMediaStream| flag is present.
18 return device_name_; 25 return device_name_;
19 return device_name_ + suffix; 26 return device_name_ + suffix;
20 } 27 }
21 28
22 VideoCaptureDevice::Name::Name() { 29 VideoCaptureDevice::Name::Name() {
23 } 30 }
24 31
25 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id) 32 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id)
26 : device_name_(name), unique_id_(id) { 33 : device_name_(name), unique_id_(id) {
27 } 34 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 switch (params.power_line_frequency) { 170 switch (params.power_line_frequency) {
164 case media::PowerLineFrequency::FREQUENCY_50HZ: // fall through 171 case media::PowerLineFrequency::FREQUENCY_50HZ: // fall through
165 case media::PowerLineFrequency::FREQUENCY_60HZ: 172 case media::PowerLineFrequency::FREQUENCY_60HZ:
166 return static_cast<int>(params.power_line_frequency); 173 return static_cast<int>(params.power_line_frequency);
167 default: 174 default:
168 return GetPowerLineFrequencyForLocation(); 175 return GetPowerLineFrequencyForLocation();
169 } 176 }
170 } 177 }
171 178
172 } // namespace media 179 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698