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.
9 #include "OptionalsReg.h"
11 //-----------------------------------------------------------------------------
13 //-----------------------------------------------------------------------------
14 #if defined (HAVE_LIBVA)
15 #include <va/va_drm.h>
16 #include "cores/VideoPlayer/DVDCodecs/Video/VAAPI.h"
18 #include "cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVAAPIGL.h"
21 #include "cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVAAPIGLES.h"
31 class CVaapiProxy
: public VAAPI::IVaapiWinSystem
34 CVaapiProxy(int fd
) : m_fd(fd
) {};
35 virtual ~CVaapiProxy() = default;
36 VADisplay
GetVADisplay() override
;
37 void *GetEGLDisplay() override
{ return eglDisplay
; };
46 VADisplay
CVaapiProxy::GetVADisplay()
48 return vaGetDisplayDRM(m_fd
);
51 CVaapiProxy
* VaapiProxyCreate(int fd
)
53 return new CVaapiProxy(fd
);
56 void VaapiProxyDelete(CVaapiProxy
*proxy
)
61 void VaapiProxyConfig(CVaapiProxy
*proxy
, void *eglDpy
)
63 proxy
->vaDpy
= proxy
->GetVADisplay();
64 proxy
->eglDisplay
= eglDpy
;
67 void VAAPIRegister(CVaapiProxy
*winSystem
, bool deepColor
)
69 VAAPI::CDecoder::Register(winSystem
, deepColor
);
73 void VAAPIRegisterRenderGL(CVaapiProxy
* winSystem
, bool& general
, bool& deepColor
)
75 CRendererVAAPIGL::Register(winSystem
, winSystem
->vaDpy
, winSystem
->eglDisplay
, general
,
81 void VAAPIRegisterRenderGLES(CVaapiProxy
* winSystem
, bool& general
, bool& deepColor
)
83 CRendererVAAPIGLES::Register(winSystem
, winSystem
->vaDpy
, winSystem
->eglDisplay
, general
,
104 CVaapiProxy
* VaapiProxyCreate(int fd
)
109 void VaapiProxyDelete(CVaapiProxy
*proxy
)
113 void VaapiProxyConfig(CVaapiProxy
*proxy
, void *eglDpy
)
118 void VAAPIRegister(CVaapiProxy
*winSystem
, bool deepColor
)
124 void VAAPIRegisterRenderGL(CVaapiProxy
* winSystem
, bool& general
, bool& deepColor
)
130 #if defined(HAS_GLES)
131 void VAAPIRegisterRenderGLES(CVaapiProxy
* winSystem
, bool& general
, bool& deepColor
)