2 * Copyright (C) 2005-2018 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.
11 #include "VideoLayerBridge.h"
12 #include "drm/DRMUtils.h"
13 #include "threads/CriticalSection.h"
14 #include "threads/SystemClock.h"
15 #include "windowing/WinSystem.h"
17 #include "platform/linux/input/LibInputHandler.h"
36 class CWinSystemGbm
: public CWinSystemBase
40 ~CWinSystemGbm() override
;
42 const std::string
GetName() override
{ return "gbm"; }
44 bool InitWindowSystem() override
;
45 bool DestroyWindowSystem() override
;
47 bool ResizeWindow(int newWidth
, int newHeight
, int newLeft
, int newTop
) override
;
48 bool SetFullScreen(bool fullScreen
, RESOLUTION_INFO
& res
, bool blankOtherDisplays
) override
;
49 bool DisplayHardwareScalingEnabled() override
;
50 void UpdateDisplayHardwareScaling(const RESOLUTION_INFO
& resInfo
) override
;
52 void FlipPage(bool rendered
, bool videoLayer
, bool async
);
54 bool CanDoWindowed() override
{ return false; }
55 void UpdateResolutions() override
;
57 bool UseLimitedColor() override
;
60 bool Show(bool raise
= true) override
;
61 void Register(IDispResource
* resource
) override
;
62 void Unregister(IDispResource
* resource
) override
;
64 bool SetHDR(const VideoPicture
* videoPicture
) override
;
65 bool IsHDRDisplay() override
;
66 CHDRCapabilities
GetDisplayHDRCapabilities() const override
;
68 std::shared_ptr
<CVideoLayerBridge
> GetVideoLayerBridge() const { return m_videoLayerBridge
; }
69 void RegisterVideoLayerBridge(std::shared_ptr
<CVideoLayerBridge
> bridge
)
71 m_videoLayerBridge
= std::move(bridge
);
74 CGBMUtils::CGBMDevice
& GetGBMDevice() const { return m_GBM
->GetDevice(); }
75 std::shared_ptr
<CDRMUtils
> GetDrm() const { return m_DRM
; }
77 std::vector
<std::string
> GetConnectedOutputs() override
;
82 std::unique_ptr
<CVideoSync
> GetVideoSync(CVideoReferenceClock
* clock
) override
;
84 std::shared_ptr
<CDRMUtils
> m_DRM
;
85 std::unique_ptr
<CGBMUtils
> m_GBM
;
86 std::shared_ptr
<CVideoLayerBridge
> m_videoLayerBridge
;
88 CCriticalSection m_resourceSection
;
89 std::vector
<IDispResource
*> m_resources
;
91 bool m_dispReset
= false;
92 XbmcThreads::EndTime
<> m_dispResetTimer
;
93 std::unique_ptr
<CLibInputHandler
> m_libinput
;
96 uint32_t m_hdr_blob_id
= 0;
98 std::unique_ptr
<UTILS::CDisplayInfo
> m_info
;