| 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 |
#include "DRMEncoder.h" |
| 10 |
|
| 11 |
#include <cstring> |
| 12 |
#include <errno.h> |
| 13 |
#include <stdexcept> |
| 14 |
#include <string> |
| 15 |
|
| 16 |
using namespace KODI::WINDOWING::GBM; |
| 17 |
|
| 18 |
CDRMEncoder::CDRMEncoder(int fd, uint32_t encoder) |
| 19 |
: CDRMObject(fd), m_encoder(drmModeGetEncoder(m_fd, encoder)) |
| 20 |
{ |
| 21 |
if (!m_encoder) |
| 22 |
throw std::runtime_error("drmModeGetEncoder failed: " + std::string{strerror(errno)}); |
| 23 |
} |