Add VAAPI VPP support for deinterlacing #2460

Closed
wants to merge 2 commits into
from
@@ -7344,7 +7344,32 @@ msgctxt "#16326"
msgid "DXVA-HD"
msgstr ""
-#empty strings from id 16327 to 16399
+#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
+msgctxt "#16327"
+msgid "VAAPI Auto"
+msgstr ""
+
+#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
+msgctxt "#16328"
+msgid "VAAPI Weave"
+msgstr ""
+
+#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
+msgctxt "#16329"
+msgid "VAAPI Bob"
+msgstr ""
+
+#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
+msgctxt "#16330"
+msgid "VAAPI Motion Adaptive"
+msgstr ""
+
+#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
+msgctxt "#16331"
+msgid "VAAPI Motion Compensated"
+msgstr ""
+
+#empty strings from id 16332 to 16399
#: xbmc/video/dialogs/GUIDialogVideoSettings.cpp
msgctxt "#16400"
@@ -3531,6 +3531,26 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method)
if(m_renderMethod & RENDER_VAAPI)
{
#ifdef HAVE_LIBVA
+ if(method == VS_INTERLACEMETHOD_VAAPI_AUTO)
+ return VAAPI::VppSupported();
+
+ if(method == VS_INTERLACEMETHOD_VAAPI_BOB)
+ return VAAPI::DeintSupported(VAAPI::DeinterlacingBob);
+
+ // MADI and MACI still produce problems
+ // disable them completely by now
+ if(g_advancedSettings.m_useVAAPIAdvancedDeinterlacing)
+ {
+ if(method == VS_INTERLACEMETHOD_VAAPI_WEAVE)
+ return VAAPI::DeintSupported(VAAPI::DeinterlacingWeave);
+
+ if(method == VS_INTERLACEMETHOD_VAAPI_MOTION_ADAPTIVE)
+ return VAAPI::DeintSupported(VAAPI::DeinterlacingMotionAdaptive);
+
+ if(method == VS_INTERLACEMETHOD_VAAPI_MOTION_COMPENSATED)
+ return VAAPI::DeintSupported(VAAPI::DeinterlacingMotionCompensated);
+ }
+
VAAPI::CDisplayPtr disp = m_buffers[m_iYV12RenderBuffer].vaapi.display;
if(disp)
{
@@ -3618,6 +3638,14 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod()
if(m_renderMethod & RENDER_VDPAU)
return VS_INTERLACEMETHOD_NONE;
+ if(m_renderMethod & RENDER_VAAPI)
+ {
+#ifdef HAVE_LIBVA
+ if(VAAPI::VppSupported())
+ return VS_INTERLACEMETHOD_VAAPI_AUTO;
+#endif
+ }
+
if(Supports(VS_INTERLACEMETHOD_RENDER_BOB))
return VS_INTERLACEMETHOD_RENDER_BOB;
@@ -10,6 +10,7 @@ SRCS += VDPAU.cpp
endif
ifeq (@USE_VAAPI@,1)
SRCS += VAAPI.cpp
+SRCS += VAAPI_VPP.cpp
endif
ifeq (@USE_CRYSTALHD@,1)
SRCS += CrystalHD.cpp
Oops, something went wrong.