aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalP <crystalp@kodi.tv>2023-10-24 13:04:43 -0400
committerGitHub <noreply@github.com>2023-10-24 13:04:43 -0400
commit3e13d1a3557f66b73928cf1eeaa49c1b6e10d667 (patch)
treef8c84909175148623c0551ebb423af9da9236064
parent662910846287558a90649776f61bb2ba44cafa85 (diff)
parent1e74da1af2e9baa27568498c0740f2d7e4a02524 (diff)
Merge pull request #23988 from CrystalP/fix-dxva-caps
[Windows] Disable video settings not supported by the DXVA processor.
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp15
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h1
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp19
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp12
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h2
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp14
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h1
7 files changed, 48 insertions, 16 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp
index cf2d73b750..8147222f65 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp
@@ -660,3 +660,18 @@ bool CProcessorHD::SetConversion(const ProcessorConversion& conversion)
return true;
}
+
+bool CProcessorHD::Supports(ERENDERFEATURE feature) const
+{
+ switch (feature)
+ {
+ case RENDERFEATURE_BRIGHTNESS:
+ return m_procCaps.m_Filters[D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS].bSupported;
+ case RENDERFEATURE_CONTRAST:
+ return m_procCaps.m_Filters[D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST].bSupported;
+ case RENDERFEATURE_ROTATION:
+ return (m_procCaps.m_vcaps.FeatureCaps & D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ROTATION);
+ default:
+ return false;
+ }
+}
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h
index 65d2537830..943a64a0eb 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h
@@ -57,6 +57,7 @@ public:
static bool IsSuperResolutionSuitable(const VideoPicture& picture);
void TryEnableVideoSuperResolution();
bool IsVideoSuperResolutionEnabled() const { return m_superResolutionEnabled; }
+ bool Supports(ERENDERFEATURE feature) const;
protected:
bool ReInit();
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
index 3ec27f8c6d..777600c139 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
@@ -272,23 +272,10 @@ bool CWinRenderer::Flush(bool saveBuffers)
bool CWinRenderer::Supports(ERENDERFEATURE feature) const
{
- if(feature == RENDERFEATURE_BRIGHTNESS)
- return true;
-
- if(feature == RENDERFEATURE_CONTRAST)
- return true;
-
- if (feature == RENDERFEATURE_STRETCH ||
- feature == RENDERFEATURE_NONLINSTRETCH ||
- feature == RENDERFEATURE_ZOOM ||
- feature == RENDERFEATURE_VERTICAL_SHIFT ||
- feature == RENDERFEATURE_PIXEL_RATIO ||
- feature == RENDERFEATURE_ROTATION ||
- feature == RENDERFEATURE_POSTPROCESS ||
- feature == RENDERFEATURE_TONEMAP)
- return true;
+ if (!m_bConfigured)
+ return false;
- return false;
+ return m_renderer->Supports(feature);
}
bool CWinRenderer::Supports(ESCALINGMETHOD method) const
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp
index 4156c403af..296dc003fb 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp
@@ -770,3 +770,15 @@ bool CRendererBase::IntendToRenderAsHDR(const VideoPicture& picture)
return streamIsHDR && canDisplayHDR;
}
+
+bool CRendererBase::Supports(ERENDERFEATURE feature) const
+{
+ if (feature == RENDERFEATURE_BRIGHTNESS || feature == RENDERFEATURE_CONTRAST ||
+ feature == RENDERFEATURE_STRETCH || feature == RENDERFEATURE_NONLINSTRETCH ||
+ feature == RENDERFEATURE_ZOOM || feature == RENDERFEATURE_VERTICAL_SHIFT ||
+ feature == RENDERFEATURE_PIXEL_RATIO || feature == RENDERFEATURE_ROTATION ||
+ feature == RENDERFEATURE_POSTPROCESS || feature == RENDERFEATURE_TONEMAP)
+ return true;
+
+ return false;
+}
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h
index 475d471b96..0c7e8909b1 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h
@@ -115,6 +115,8 @@ public:
virtual CRenderInfo GetRenderInfo();
virtual bool Configure(const VideoPicture &picture, float fps, unsigned int orientation);
virtual bool Supports(ESCALINGMETHOD method) const = 0;
+ virtual bool Supports(ERENDERFEATURE feature) const;
+
virtual bool WantsDoublePass() { return false; }
virtual bool NeedBuffer(int idx) { return false; }
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp
index 6a2d0d955a..2ef7543242 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp
@@ -304,6 +304,20 @@ void CRendererDXVA::FillBuffersSet(CRenderBuffer* (&buffers)[8])
}
}
+bool CRendererDXVA::Supports(ERENDERFEATURE feature) const
+{
+ if (feature == RENDERFEATURE_BRIGHTNESS || feature == RENDERFEATURE_CONTRAST ||
+ feature == RENDERFEATURE_ROTATION)
+ {
+ if (m_processor)
+ return m_processor->Supports(feature);
+
+ return false;
+ }
+
+ return CRendererBase::Supports(feature);
+}
+
bool CRendererDXVA::Supports(ESCALINGMETHOD method) const
{
if (method == VS_SCALINGMETHOD_DXVA_HARDWARE)
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h
index 46fe5adef0..02708d6d18 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h
@@ -29,6 +29,7 @@ public:
CRenderInfo GetRenderInfo() override;
bool Supports(ESCALINGMETHOD method) const override;
+ bool Supports(ERENDERFEATURE feature) const override;
bool WantsDoublePass() override { return true; }
bool Configure(const VideoPicture& picture, float fps, unsigned orientation) override;
bool NeedBuffer(int idx) override;