summaryrefslogtreecommitdiffstats
path: root/xbmc/windowing/gbm/drm/DRMEncoder.cpp
blob: e4289c6b680bbb6c3b7d003179df23b997dcd33d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 *  Copyright (C) 2005-2020 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#include "DRMEncoder.h"

#include <cstring>
#include <errno.h>
#include <stdexcept>
#include <string>

using namespace KODI::WINDOWING::GBM;

CDRMEncoder::CDRMEncoder(int fd, uint32_t encoder)
  : CDRMObject(fd), m_encoder(drmModeGetEncoder(m_fd, encoder))
{
  if (!m_encoder)
    throw std::runtime_error("drmModeGetEncoder failed: " + std::string{strerror(errno)});
}