blob: a320c36fdeddc528aca38d8969f788bc79a1d395 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
leozwang@webrtc.org1745e932012-03-01 16:30:40 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_DEVICE_INFO_LINUX_H_
12#define MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_DEVICE_INFO_LINUX_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
Yves Gerey3e707812018-11-28 16:47:49 +010014#include <stdint.h>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "modules/video_capture/device_info_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000017
Yves Gerey665174f2018-06-19 15:03:05 +020018namespace webrtc {
19namespace videocapturemodule {
20class DeviceInfoLinux : public DeviceInfoImpl {
21 public:
22 DeviceInfoLinux();
Mirko Bonadei5aec1f62018-08-29 13:27:15 +020023 ~DeviceInfoLinux() override;
24 uint32_t NumberOfDevices() override;
25 int32_t GetDeviceName(uint32_t deviceNumber,
26 char* deviceNameUTF8,
27 uint32_t deviceNameLength,
28 char* deviceUniqueIdUTF8,
29 uint32_t deviceUniqueIdUTF8Length,
30 char* productUniqueIdUTF8 = 0,
31 uint32_t productUniqueIdUTF8Length = 0) override;
Yves Gerey665174f2018-06-19 15:03:05 +020032 /*
33 * Fills the membervariable _captureCapabilities with capabilites for the
34 * given device name.
35 */
Mirko Bonadei5aec1f62018-08-29 13:27:15 +020036 int32_t CreateCapabilityMap(const char* deviceUniqueIdUTF8) override;
37 int32_t DisplayCaptureSettingsDialogBox(const char* /*deviceUniqueIdUTF8*/,
38 const char* /*dialogTitleUTF8*/,
39 void* /*parentWindow*/,
40 uint32_t /*positionX*/,
41 uint32_t /*positionY*/) override;
Yves Gerey665174f2018-06-19 15:03:05 +020042 int32_t FillCapabilities(int fd);
Mirko Bonadei5aec1f62018-08-29 13:27:15 +020043 int32_t Init() override;
niklase@google.com470e71d2011-07-07 08:21:25 +000044
Yves Gerey665174f2018-06-19 15:03:05 +020045 private:
46 bool IsDeviceNameMatches(const char* name, const char* deviceUniqueIdUTF8);
niklase@google.com470e71d2011-07-07 08:21:25 +000047};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000048} // namespace videocapturemodule
49} // namespace webrtc
Yves Gerey665174f2018-06-19 15:03:05 +020050#endif // MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_DEVICE_INFO_LINUX_H_