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

Unified Diff: webrtc/media/devices/macdeviceinfo.cc

Issue 1587193006: Move talk/media to webrtc/media (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Disable sign-compare warning on Win Clang Created 4 years, 11 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
Index: webrtc/media/devices/macdeviceinfo.cc
diff --git a/webrtc/media/devices/macdeviceinfo.cc b/webrtc/media/devices/macdeviceinfo.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b7f9af92b47e2c07bbcc8f773b8b40360c0aff51
--- /dev/null
+++ b/webrtc/media/devices/macdeviceinfo.cc
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2012 The WebRTC Project Authors. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/media/devices/deviceinfo.h"
+
+namespace cricket {
+
+bool GetUsbId(const Device& device, std::string* usb_id) {
+ // Both PID and VID are 4 characters.
+ const int id_size = 4;
+ if (device.id.size() < 2 * id_size) {
+ return false;
+ }
+
+ // The last characters of device id is a concatenation of VID and then PID.
+ const size_t vid_location = device.id.size() - 2 * id_size;
+ std::string id_vendor = device.id.substr(vid_location, id_size);
+ const size_t pid_location = device.id.size() - id_size;
+ std::string id_product = device.id.substr(pid_location, id_size);
+
+ usb_id->clear();
+ usb_id->append(id_vendor);
+ usb_id->append(":");
+ usb_id->append(id_product);
+ return true;
+}
+
+bool GetUsbVersion(const Device& device, std::string* usb_version) {
+ return false;
+}
+
+} // namespace cricket

Powered by Google App Engine
This is Rietveld 408576698