-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
/
RenderBufferPoolGBM.cpp
58 lines (48 loc) · 1.27 KB
/
RenderBufferPoolGBM.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (C) 2017-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "RenderBufferPoolGBM.h"
#include "RenderBufferGBM.h"
#include "cores/RetroPlayer/rendering/VideoRenderers/RPRendererGBM.h"
#include <drm_fourcc.h>
using namespace KODI;
using namespace RETRO;
CRenderBufferPoolGBM::CRenderBufferPoolGBM(CRenderContext &context)
: m_context(context)
{
}
bool CRenderBufferPoolGBM::IsCompatible(const CRenderVideoSettings &renderSettings) const
{
if (!CRPRendererGBM::SupportsScalingMethod(renderSettings.GetScalingMethod()))
return false;
return true;
}
IRenderBuffer *CRenderBufferPoolGBM::CreateRenderBuffer(void *header /* = nullptr */)
{
return new CRenderBufferGBM(m_context,
m_fourcc);
}
bool CRenderBufferPoolGBM::ConfigureInternal()
{
switch (m_format)
{
case AV_PIX_FMT_0RGB32:
{
m_fourcc = DRM_FORMAT_ARGB8888;
return true;
}
case AV_PIX_FMT_RGB555:
case AV_PIX_FMT_RGB565:
{
m_fourcc = DRM_FORMAT_RGB565;
return true;
}
default:
break; // we shouldn't even get this far if we are given an unsupported pixel format
}
return false;
}