summaryrefslogtreecommitdiffstats
path: root/xbmc/windowing/gbm/drm/DRMEncoder.h
blob: aceb276a89bad9aec064a4bc48c7ce90ab7a210c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 *  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.
 */

#pragma once

#include "DRMObject.h"

namespace KODI
{
namespace WINDOWING
{
namespace GBM
{

class CDRMEncoder : public CDRMObject
{
public:
  explicit CDRMEncoder(int fd, uint32_t encoder);
  CDRMEncoder(const CDRMEncoder&) = delete;
  CDRMEncoder& operator=(const CDRMEncoder&) = delete;
  ~CDRMEncoder() = default;

  uint32_t GetEncoderId() const { return m_encoder->encoder_id; }
  uint32_t GetCrtcId() const { return m_encoder->crtc_id; }
  uint32_t GetPossibleCrtcs() const { return m_encoder->possible_crtcs; }

private:
  struct DrmModeEncoderDeleter
  {
    void operator()(drmModeEncoder* p) { drmModeFreeEncoder(p); }
  };

  std::unique_ptr<drmModeEncoder, DrmModeEncoderDeleter> m_encoder;
};

} // namespace GBM
} // namespace WINDOWING
} // namespace KODI