2 * Copyright (C) 2017-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 "cores/RetroPlayer/buffers/BaseRenderBuffer.h"
15 #include "system_gl.h"
27 * @brief Special IRenderBuffer implementation for use with CBufferObject.
28 * This buffer type uses Direct Memory Access (DMA) sharing via file
29 * descriptors (fds). The file descriptor is then used to create an
33 class CRenderBufferDMA
: public CBaseRenderBuffer
36 CRenderBufferDMA(CRenderContext
& context
, int fourcc
);
37 ~CRenderBufferDMA() override
;
39 // implementation of IRenderBuffer via CRenderBufferSysMem
40 bool Allocate(AVPixelFormat format
, unsigned int width
, unsigned int height
) override
;
41 size_t GetFrameSize() const override
;
42 uint8_t* GetMemory() override
;
43 void ReleaseMemory() override
;
45 // implementation of IRenderBuffer
46 bool UploadTexture() override
;
48 GLuint
TextureID() const { return m_textureId
; }
51 // Construction parameters
52 CRenderContext
& m_context
;
53 const int m_fourcc
= 0;
55 const GLenum m_textureTarget
= GL_TEXTURE_2D
;
56 GLuint m_textureId
= 0;
62 std::unique_ptr
<CEGLImage
> m_egl
;
63 std::unique_ptr
<IBufferObject
> m_bo
;