| 1 |
/* |
| 2 |
* Copyright (C) 2005-2018 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 |
#pragma once |
| 10 |
|
| 11 |
#include "WinSystemGbm.h" |
| 12 |
#include "utils/EGLFence.h" |
| 13 |
#include "utils/EGLUtils.h" |
| 14 |
#include "windowing/linux/WinSystemEGL.h" |
| 15 |
|
| 16 |
#include <memory> |
| 17 |
|
| 18 |
namespace KODI |
| 19 |
{ |
| 20 |
namespace WINDOWING |
| 21 |
{ |
| 22 |
namespace GBM |
| 23 |
{ |
| 24 |
|
| 25 |
class CVaapiProxy; |
| 26 |
|
| 27 |
class CWinSystemGbmEGLContext : public KODI::WINDOWING::LINUX::CWinSystemEGL, public CWinSystemGbm |
| 28 |
{ |
| 29 |
public: |
| 30 |
~CWinSystemGbmEGLContext() override = default; |
| 31 |
|
| 32 |
bool DestroyWindowSystem() override; |
| 33 |
bool CreateNewWindow(const std::string& name, |
| 34 |
bool fullScreen, |
| 35 |
RESOLUTION_INFO& res) override; |
| 36 |
bool DestroyWindow() override; |
| 37 |
|
| 38 |
protected: |
| 39 |
CWinSystemGbmEGLContext(EGLenum platform, std::string const& platformExtension) |
| 40 |
: CWinSystemEGL{platform, platformExtension} |
| 41 |
{} |
| 42 |
|
| 43 |
/** |
| 44 |
* Inheriting classes should override InitWindowSystem() without parameters |
| 45 |
* and call this function there with appropriate parameters |
| 46 |
*/ |
| 47 |
bool InitWindowSystemEGL(EGLint renderableType, EGLint apiType); |
| 48 |
virtual bool CreateContext() = 0; |
| 49 |
|
| 50 |
std::unique_ptr<KODI::UTILS::EGL::CEGLFence> m_eglFence; |
| 51 |
|
| 52 |
struct delete_CVaapiProxy |
| 53 |
{ |
| 54 |
void operator()(CVaapiProxy *p) const; |
| 55 |
}; |
| 56 |
std::unique_ptr<CVaapiProxy, delete_CVaapiProxy> m_vaapiProxy; |
| 57 |
}; |
| 58 |
|
| 59 |
} |
| 60 |
} |
| 61 |
} |