Debian Codegraph @

xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVAAPIGL.h

raw
1 /*
2 * Copyright (C) 2007-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 "VaapiEGL.h"
12 #include "cores/VideoPlayer/VideoRenderers/LinuxRendererGL.h"
13
14 #include <memory>
15
16 namespace VAAPI
17 {
18 class IVaapiWinSystem;
19 }
20
21 class CRendererVAAPIGL : public CLinuxRendererGL
22 {
23 public:
24 CRendererVAAPIGL();
25 ~CRendererVAAPIGL() override;
26
27 static CBaseRenderer* Create(CVideoBuffer *buffer);
28 static void Register(VAAPI::IVaapiWinSystem *winSystem, VADisplay vaDpy, EGLDisplay eglDisplay, bool &general, bool &deepColor);
29
30 bool Configure(const VideoPicture &picture, float fps, unsigned int orientation) override;
31
32 // Player functions
33 bool ConfigChanged(const VideoPicture &picture) override;
34 void ReleaseBuffer(int idx) override;
35 bool NeedBuffer(int idx) override;
36 bool Flush(bool saveBuffers) override;
37
38 // Feature support
39 bool Supports(ERENDERFEATURE feature) const override;
40 bool Supports(ESCALINGMETHOD method) const override;
41
42 protected:
43 bool LoadShadersHook() override;
44 bool RenderHook(int idx) override;
45 void AfterRenderHook(int idx) override;
46
47 // textures
48 bool UploadTexture(int index) override;
49 void DeleteTexture(int index) override;
50 bool CreateTexture(int index) override;
51
52 EShaderFormat GetShaderFormat() override;
53
54 bool m_isVAAPIBuffer = true;
55 std::unique_ptr<VAAPI::CVaapiTexture> m_vaapiTextures[NUM_BUFFERS];
56 GLsync m_fences[NUM_BUFFERS];
57 static VAAPI::IVaapiWinSystem *m_pWinSystem;
58 };