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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_capture_device.cc
diff --git a/media/capture/video/video_capture_device.cc b/media/capture/video/video_capture_device.cc
index 4b771e564ee9c05c0641bd14b5174cd4d005f6b6..01816c220618c697327e4d707e934da1bb810f1e 100644
--- a/media/capture/video/video_capture_device.cc
+++ b/media/capture/video/video_capture_device.cc
@@ -4,17 +4,24 @@
#include "media/capture/video/video_capture_device.h"
+#include "base/command_line.h"
#include "base/i18n/timezone.h"
#include "base/strings/string_util.h"
+#include "media/base/media_switches.h"
namespace media {
+// TODO(msu.koo): http://crbug.com/532272, remove checking the switch in favour
+// of deferring GetModel() call to the actual VideoCaptureDevice object.
const std::string VideoCaptureDevice::Name::GetNameAndModel() const {
const std::string model_id = GetModel();
if (model_id.empty())
return device_name_;
const std::string suffix = " (" + model_id + ")";
- if (base::EndsWith(device_name_, suffix, base::CompareCase::SENSITIVE))
+ if (base::EndsWith(device_name_, suffix, base::CompareCase::SENSITIVE) ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseFakeDeviceForMediaStream))
+ // Ignore |model_id| if |kUseFakeDeviceForMediaStream| flag is present.
return device_name_;
return device_name_ + suffix;
}
« 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