[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / windowing / gbm / drm / DRMPlane.h
blobe077fc341862245f4b781394e37a54be19e0cfd3
1 /*
2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "DRMObject.h"
13 #include <map>
15 #include <drm_fourcc.h>
17 namespace KODI
19 namespace WINDOWING
21 namespace GBM
24 class CDRMPlane : public CDRMObject
26 public:
27 explicit CDRMPlane(int fd, uint32_t plane);
28 CDRMPlane(const CDRMPlane&) = delete;
29 CDRMPlane& operator=(const CDRMPlane&) = delete;
30 ~CDRMPlane() = default;
32 uint32_t GetPlaneId() const { return m_plane->plane_id; }
33 uint32_t GetPossibleCrtcs() const { return m_plane->possible_crtcs; }
35 void FindModifiers();
37 void SetFormat(const uint32_t newFormat) { m_format = newFormat; }
38 uint32_t GetFormat() const { return m_format; }
39 std::vector<uint64_t>& GetModifiersForFormat(uint32_t format) { return m_modifiers_map[format]; }
41 bool SupportsFormat(uint32_t format);
42 bool SupportsFormatAndModifier(uint32_t format, uint64_t modifier);
44 private:
45 struct DrmModePlaneDeleter
47 void operator()(drmModePlane* p) { drmModeFreePlane(p); }
50 std::unique_ptr<drmModePlane, DrmModePlaneDeleter> m_plane;
52 std::map<uint32_t, std::vector<uint64_t>> m_modifiers_map;
53 uint32_t m_format{DRM_FORMAT_XRGB8888};
56 } // namespace GBM
57 } // namespace WINDOWING
58 } // namespace KODI