13
13
#include " mythplayerui.h"
14
14
#include " mythvideocolourspace.h"
15
15
#include " fourcc.h"
16
+ #if CONFIG_VAAPI_DRM
16
17
#include " mythvaapidrminterop.h"
18
+ #endif
19
+ #if CONFIG_VAAPI_GLX
17
20
#include " mythvaapiglxinterop.h"
21
+ #endif
18
22
19
23
extern " C" {
20
24
#include " libavfilter/buffersrc.h"
@@ -46,9 +50,9 @@ void MythVAAPIInterop::GetVAAPITypes(MythRenderOpenGL* Context, MythInteropGPU::
46
50
return ;
47
51
48
52
OpenGLLocker locker (Context);
49
- bool egl = Context->IsEGL ();
50
- bool opengles = Context->isOpenGLES ();
51
- bool wayland = qgetenv (" XDG_SESSION_TYPE" ).contains (" wayland" );
53
+ [[maybe_unused]] bool egl = Context->IsEGL ();
54
+ [[maybe_unused]] bool opengles = Context->isOpenGLES ();
55
+ [[maybe_unused]] bool wayland = qgetenv (" XDG_SESSION_TYPE" ).contains (" wayland" );
52
56
53
57
// best first
54
58
MythInteropGPU::InteropTypes vaapitypes;
@@ -58,17 +62,21 @@ void MythVAAPIInterop::GetVAAPITypes(MythRenderOpenGL* Context, MythInteropGPU::
58
62
vaapitypes.emplace_back (DRM_DRMPRIME);
59
63
#endif
60
64
61
- #if CONFIG_EGL
65
+ #if CONFIG_VAAPI_DRM && CONFIG_EGL
62
66
// zero copy
63
67
if (egl && MythVAAPIInteropDRM::IsSupported (Context))
64
68
vaapitypes.emplace_back (GL_VAAPIEGLDRM);
65
69
#endif
70
+ #if CONFIG_VAAPI_GLX
71
+ # if CONFIG_VAAPI_X11
66
72
// 1x copy
67
73
if (!egl && !wayland && MythVAAPIInteropGLXPixmap::IsSupported (Context))
68
74
vaapitypes.emplace_back (GL_VAAPIGLXPIX);
75
+ # endif
69
76
// 2x copy
70
77
if (!egl && !opengles && !wayland)
71
78
vaapitypes.emplace_back (GL_VAAPIGLXCOPY);
79
+ #endif
72
80
73
81
if (!vaapitypes.empty ())
74
82
Types[FMT_VAAPI] = vaapitypes;
@@ -82,16 +90,20 @@ MythVAAPIInterop* MythVAAPIInterop::CreateVAAPI(MythPlayerUI *Player, MythRender
82
90
const auto & types = Player->GetInteropTypes ();
83
91
if (const auto & vaapi = types.find (FMT_VAAPI); vaapi != types.cend ())
84
92
{
85
- for (auto type : vaapi->second )
93
+ for ([[maybe_unused]] auto type : vaapi->second )
86
94
{
87
- #if CONFIG_EGL
95
+ #if CONFIG_VAAPI_DRM && CONFIG_EGL
88
96
if ((type == GL_VAAPIEGLDRM) || (type == DRM_DRMPRIME))
89
97
return new MythVAAPIInteropDRM (Player, Context, type);
90
98
#endif
99
+ #if CONFIG_VAAPI_GLX
100
+ # if CONFIG_VAAPI_X11
91
101
if (type == GL_VAAPIGLXPIX)
92
102
return new MythVAAPIInteropGLXPixmap (Player, Context);
103
+ # endif
93
104
if (type == GL_VAAPIGLXCOPY)
94
105
return new MythVAAPIInteropGLXCopy (Player, Context);
106
+ #endif
95
107
}
96
108
}
97
109
return nullptr ;
0 commit comments