device_info_linux.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #ifndef MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_DEVICE_INFO_LINUX_H_
  11. #define MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_DEVICE_INFO_LINUX_H_
  12. #include <stdint.h>
  13. #include "modules/video_capture/device_info_impl.h"
  14. namespace webrtc {
  15. namespace videocapturemodule {
  16. class DeviceInfoLinux : public DeviceInfoImpl {
  17. public:
  18. DeviceInfoLinux();
  19. ~DeviceInfoLinux() override;
  20. uint32_t NumberOfDevices() override;
  21. int32_t GetDeviceName(uint32_t deviceNumber,
  22. char* deviceNameUTF8,
  23. uint32_t deviceNameLength,
  24. char* deviceUniqueIdUTF8,
  25. uint32_t deviceUniqueIdUTF8Length,
  26. char* productUniqueIdUTF8 = 0,
  27. uint32_t productUniqueIdUTF8Length = 0) override;
  28. /*
  29. * Fills the membervariable _captureCapabilities with capabilites for the
  30. * given device name.
  31. */
  32. int32_t CreateCapabilityMap(const char* deviceUniqueIdUTF8) override;
  33. int32_t DisplayCaptureSettingsDialogBox(const char* /*deviceUniqueIdUTF8*/,
  34. const char* /*dialogTitleUTF8*/,
  35. void* /*parentWindow*/,
  36. uint32_t /*positionX*/,
  37. uint32_t /*positionY*/) override;
  38. int32_t FillCapabilities(int fd);
  39. int32_t Init() override;
  40. private:
  41. bool IsDeviceNameMatches(const char* name, const char* deviceUniqueIdUTF8);
  42. };
  43. } // namespace videocapturemodule
  44. } // namespace webrtc
  45. #endif // MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_DEVICE_INFO_LINUX_H_