summaryrefslogtreecommitdiff
blob: 1a80f9f90a0762d19b5a42d41d53be2a0c8e75da (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
https://bugs.gentoo.org/904437
https://github.com/MythTV/mythtv/pull/760
--- a/libs/libmythtv/libmythtv.pro
+++ b/libs/libmythtv/libmythtv.pro
@@ -538,7 +538,7 @@ using_frontend {
         DEFINES += USING_VAAPI
         HEADERS += decoders/mythvaapicontext.h
         SOURCES += decoders/mythvaapicontext.cpp
-        LIBS    += -lva -lva-x11 -lva-glx -lva-drm
+        LIBS    += -lva -lva-drm
     }
 
     using_nvdec {
@@ -605,10 +605,9 @@ using_frontend {
         SOURCES += opengl/mythopengltonemap.cpp
         SOURCES += visualisations/videovisualcircles.cpp
 
-
         using_vaapi {
-            HEADERS += opengl/mythvaapiinterop.h   opengl/mythvaapiglxinterop.h
-            SOURCES += opengl/mythvaapiinterop.cpp opengl/mythvaapiglxinterop.cpp
+            HEADERS += opengl/mythvaapiinterop.h
+            SOURCES += opengl/mythvaapiinterop.cpp
         }
 
         using_vdpau:using_x11 {
@@ -649,6 +648,12 @@ using_frontend {
                 HEADERS += opengl/mythvaapidrminterop.h
                 SOURCES += opengl/mythvaapidrminterop.cpp
             }
+        } else {
+            using_vaapi {
+                HEADERS += opengl/mythvaapiglxinterop.h
+                SOURCES += opengl/mythvaapiglxinterop.cpp
+                LIBS    += -lva-x11 -lva-glx
+            }
         }
 
         !win32-msvc* {
--- a/libs/libmythtv/opengl/mythvaapiinterop.cpp
+++ b/libs/libmythtv/opengl/mythvaapiinterop.cpp
@@ -8,8 +8,12 @@
 #include "mythvideocolourspace.h"
 #include "fourcc.h"
 #include "mythvaapiinterop.h"
+
+#ifdef USING_EGL
 #include "mythvaapidrminterop.h"
+#else
 #include "mythvaapiglxinterop.h"
+#endif
 
 extern "C" {
 #include "libavfilter/buffersrc.h"
@@ -57,14 +61,14 @@ void MythVAAPIInterop::GetVAAPITypes(MythRenderOpenGL* Context, MythInteropGPU::
     // zero copy
     if (egl && MythVAAPIInteropDRM::IsSupported(Context))
         vaapitypes.emplace_back(GL_VAAPIEGLDRM);
-#endif
+#else
     // 1x copy
     if (!egl && !wayland && MythVAAPIInteropGLXPixmap::IsSupported(Context))
         vaapitypes.emplace_back(GL_VAAPIGLXPIX);
     // 2x copy
     if (!egl && !opengles && !wayland)
         vaapitypes.emplace_back(GL_VAAPIGLXCOPY);
-
+#endif
     if (!vaapitypes.empty())
         Types[FMT_VAAPI] = vaapitypes;
 }
@@ -82,11 +86,12 @@ MythVAAPIInterop* MythVAAPIInterop::CreateVAAPI(MythPlayerUI *Player, MythRender
 #ifdef USING_EGL
             if ((type == GL_VAAPIEGLDRM) || (type == DRM_DRMPRIME))
                 return new MythVAAPIInteropDRM(Player, Context, type);
-#endif
+#else
             if (type == GL_VAAPIGLXPIX)
                 return new MythVAAPIInteropGLXPixmap(Player, Context);
             if (type == GL_VAAPIGLXCOPY)
                 return new MythVAAPIInteropGLXCopy(Player, Context);
+#endif
         }
     }
     return nullptr;
--- a/libs/libmythtv/opengl/mythvaapiinterop.h
+++ b/libs/libmythtv/opengl/mythvaapiinterop.h
@@ -25,9 +25,12 @@ struct AVFilterContext;
 #undef None            // X11/X.h defines this. Causes compile failure in Qt6.
 #undef Cursor
 #undef pointer
-#include "va/va_glx.h"
+#ifdef USING_EGL
 #include "va/va_drm.h"
 #include "va/va_drmcommon.h"
+#else
+#include "va/va_glx.h"
+#endif
 #undef Bool            // Interferes with cmake moc file compilation
 
 #ifndef VA_FOURCC_I420