xbmc
DRMConnector.h
1 /*
2  * Copyright (C) 2005-2020 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "DRMObject.h"
12 
13 #include <string>
14 
15 namespace KODI
16 {
17 namespace WINDOWING
18 {
19 namespace GBM
20 {
21 
22 class CDRMConnector : public CDRMObject
23 {
24 public:
25  explicit CDRMConnector(int fd, uint32_t connector);
26  CDRMConnector(const CDRMConnector&) = delete;
27  CDRMConnector& operator=(const CDRMConnector&) = delete;
28  ~CDRMConnector() = default;
29 
30  std::string GetType();
31  std::string GetStatus();
32  std::string GetName();
33 
34  uint32_t GetEncoderId() const { return m_connector->encoder_id; }
35  uint32_t* GetConnectorId() const { return &m_connector->connector_id; }
36  int GetModesCount() const { return m_connector->count_modes; }
37  drmModeModeInfoPtr GetModeForIndex(int index) const { return &m_connector->modes[index]; }
38 
39  bool IsConnected() { return m_connector->connection == DRM_MODE_CONNECTED; }
40  bool CheckConnector();
41 
42 private:
43  struct DrmModeConnectorDeleter
44  {
45  void operator()(drmModeConnector* p) { drmModeFreeConnector(p); }
46  };
47 
48  std::unique_ptr<drmModeConnector, DrmModeConnectorDeleter> m_connector;
49 };
50 
51 } // namespace GBM
52 } // namespace WINDOWING
53 } // namespace KODI
Definition: DRMObject.h:25
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: DRMConnector.h:22