| 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 |
std::vector<uint8_t> GetEDID() const; |
| 43 |
|
| 44 |
private: |
| 45 |
struct DrmModeConnectorDeleter |
| 46 |
{ |
| 47 |
void operator()(drmModeConnector* p) { drmModeFreeConnector(p); } |
| 48 |
}; |
| 49 |
|
| 50 |
std::unique_ptr<drmModeConnector, DrmModeConnectorDeleter> m_connector; |
| 51 |
}; |
| 52 |
|
| 53 |
} // namespace GBM |
| 54 |
} // namespace WINDOWING |
| 55 |
} // namespace KODI |