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

Side by Side Diff: webrtc/media/devices/win32deviceinfo.cc

Issue 1715883002: Remove DeviceManager and DeviceInfo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 9 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 | « webrtc/media/devices/mobiledevicemanager.cc ('k') | webrtc/media/devices/win32devicemanager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "webrtc/media/devices/deviceinfo.h"
12
13 namespace cricket {
14
15 bool GetUsbId(const Device& device, std::string* usb_id) {
16 // Both PID and VID are 4 characters.
17 const int id_size = 4;
18 const char vid[] = "vid_"; // Also contains '\0'.
19 const size_t vid_location = device.id.find(vid);
20 if (vid_location == std::string::npos ||
21 vid_location + sizeof(vid) - 1 + id_size > device.id.size()) {
22 return false;
23 }
24 const char pid[] = "pid_";
25 const size_t pid_location = device.id.find(pid);
26 if (pid_location == std::string::npos ||
27 pid_location + sizeof(pid) - 1 + id_size > device.id.size()) {
28 return false;
29 }
30 std::string id_vendor = device.id.substr(vid_location + sizeof(vid) - 1,
31 id_size);
32 std::string id_product = device.id.substr(pid_location + sizeof(pid) -1,
33 id_size);
34 usb_id->clear();
35 usb_id->append(id_vendor);
36 usb_id->append(":");
37 usb_id->append(id_product);
38 return true;
39 }
40
41 bool GetUsbVersion(const Device& device, std::string* usb_version) {
42 return false;
43 }
44
45 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/devices/mobiledevicemanager.cc ('k') | webrtc/media/devices/win32devicemanager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698