Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable the libva GLX backend if EGL is enabled #760

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions mythtv/libs/libmythtv/libmythtv.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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* {
Expand Down
11 changes: 8 additions & 3 deletions mythtv/libs/libmythtv/opengl/mythvaapiinterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion mythtv/libs/libmythtv/opengl/mythvaapiinterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down