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

Side by Side Diff: webrtc/media/devices/mobiledevicemanager.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/macdevicemanagermm.mm ('k') | webrtc/media/devices/win32deviceinfo.cc » ('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) 2013 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 <memory>
12
13 #include "webrtc/base/arraysize.h"
14 #include "webrtc/media/devices/devicemanager.h"
15 #include "webrtc/modules/video_capture/video_capture_factory.h"
16
17 namespace cricket {
18
19 class MobileDeviceManager : public DeviceManager {
20 public:
21 MobileDeviceManager();
22 virtual ~MobileDeviceManager();
23 virtual bool GetVideoCaptureDevices(std::vector<Device>* devs);
24 };
25
26 MobileDeviceManager::MobileDeviceManager() {
27 // We don't expect available devices to change on Android/iOS, so use a
28 // do-nothing watcher.
29 set_watcher(new DeviceWatcher(this));
30 }
31
32 MobileDeviceManager::~MobileDeviceManager() {}
33
34 bool MobileDeviceManager::GetVideoCaptureDevices(std::vector<Device>* devs) {
35 devs->clear();
36 std::unique_ptr<webrtc::VideoCaptureModule::DeviceInfo> info(
37 webrtc::VideoCaptureFactory::CreateDeviceInfo(0));
38 if (!info)
39 return false;
40
41 uint32_t num_cams = info->NumberOfDevices();
42 char id[256];
43 char name[256];
44 for (uint32_t i = 0; i < num_cams; ++i) {
45 if (info->GetDeviceName(i, name, arraysize(name), id, arraysize(id)))
46 continue;
47 devs->push_back(Device(name, id));
48 }
49 return true;
50 }
51
52 DeviceManagerInterface* DeviceManagerFactory::Create() {
53 return new MobileDeviceManager();
54 }
55
56 bool GetUsbId(const Device& device, std::string* usb_id) { return false; }
57
58 bool GetUsbVersion(const Device& device, std::string* usb_version) {
59 return false;
60 }
61
62 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/devices/macdevicemanagermm.mm ('k') | webrtc/media/devices/win32deviceinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698