diff options
author | CrystalP <crystalp@kodi.tv> | 2023-06-09 22:56:58 -0400 |
---|---|---|
committer | CrystalP <crystalp@kodi.tv> | 2023-06-10 12:34:03 -0400 |
commit | 995e75027da74357450a68e47bddd496a0422936 (patch) | |
tree | 067d42a6b408c81104e59399f67f86be4e905e49 | |
parent | 5b79de77edb2a39e0176fd941d5485518c1c6595 (diff) |
[Windows] Add render method information to debug OSD
11 files changed, 43 insertions, 3 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/DebugInfo.h b/xbmc/cores/VideoPlayer/VideoRenderers/DebugInfo.h index d800c1a837..451386ce66 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/DebugInfo.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/DebugInfo.h @@ -24,6 +24,7 @@ struct DEBUG_INFO_VIDEO std::string metaPrim; std::string metaLight; std::string shader; + std::string render; }; struct DEBUG_INFO_RENDER diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/DebugRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/DebugRenderer.cpp index 61cdedcc2e..9a8f496f96 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/DebugRenderer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/DebugRenderer.cpp @@ -90,6 +90,7 @@ void CDebugRenderer::SetInfo(DEBUG_INFO_VIDEO& video, DEBUG_INFO_RENDER& render) m_adapter->AddSubtitle(video.metaPrim, 0., 5000000.); m_adapter->AddSubtitle(video.metaLight, 0., 5000000.); m_adapter->AddSubtitle(video.shader, 0., 5000000.); + m_adapter->AddSubtitle(video.render, 0., 5000000.); m_adapter->AddSubtitle(render.renderFlags, 0., 5000000.); m_adapter->AddSubtitle(render.videoOutput, 0., 5000000.); } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h index 5f10089d78..cc280550df 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.h @@ -123,6 +123,7 @@ public: static bool IsPQ10PassthroughSupported(const DXGI_FORMAT dxgi_format); static bool IsSuperResolutionSuitable(const VideoPicture& picture); void TryEnableVideoSuperResolution(); + bool IsVideoSuperResolutionEnabled() const { return m_superResolutionEnabled; } protected: bool ReInit(); diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp index 91cf885e28..09f721d8a3 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.cpp @@ -723,5 +723,14 @@ DEBUG_INFO_VIDEO CRendererBase::GetDebugInfo(int idx) if (m_outputShader) info.shader = m_outputShader->GetDebugInfo(); + info.render = StringUtils::Format("Render method: {}", m_renderMethodName); + + std::string rmInfo = GetRenderMethodDebugInfo(); + if (!rmInfo.empty()) + { + info.render.append(", "); + info.render.append(rmInfo); + } + return info; } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h index d4f401aaff..43797b42be 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererBase.h @@ -155,6 +155,7 @@ protected: virtual void CheckVideoParameters(); virtual void OnViewSizeChanged() {} virtual void OnOutputReset() {} + virtual std::string GetRenderMethodDebugInfo() const { return {}; } bool m_toneMapping = false; bool m_useDithering = false; @@ -188,4 +189,5 @@ protected: DXGI_HDR_METADATA_HDR10 m_lastHdr10 = {}; HDR_TYPE m_HdrType = HDR_TYPE::HDR_NONE_SDR; bool m_AutoSwitchHDR = false; + std::string m_renderMethodName; }; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp index 1a636bf07f..6bbd1b13ba 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.cpp @@ -110,6 +110,11 @@ void CRendererDXVA::GetWeight(std::map<RenderMethod, int>& weights, const VideoP weights[RENDER_DXVA] = weight; } +CRendererDXVA::CRendererDXVA(CVideoSettings& videoSettings) : CRendererHQ(videoSettings) +{ + m_renderMethodName = "DXVA"; +} + CRenderInfo CRendererDXVA::GetRenderInfo() { auto info = __super::GetRenderInfo(); @@ -295,6 +300,16 @@ CRenderBuffer* CRendererDXVA::CreateBuffer() return new CRenderBufferImpl(m_format, m_sourceWidth, m_sourceHeight); } +std::string CRendererDXVA::GetRenderMethodDebugInfo() const +{ + if (m_processor && DX::Windowing()->SupportsVideoSuperResolution()) + { + return StringUtils::Format("Video Super Resolution: {}", + m_processor->IsVideoSuperResolutionEnabled() ? "requested" : "OFF"); + } + return {}; +} + CRendererDXVA::CRenderBufferImpl::CRenderBufferImpl(AVPixelFormat av_pix_format, unsigned width, unsigned height) : CRenderBuffer(av_pix_format, width, height) { diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h index 0eed9503dc..ea67e7b5f6 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererDXVA.h @@ -37,11 +37,12 @@ public: static void GetWeight(std::map<RenderMethod, int>& weights, const VideoPicture& picture); protected: - explicit CRendererDXVA(CVideoSettings& videoSettings) : CRendererHQ(videoSettings) {} + explicit CRendererDXVA(CVideoSettings& videoSettings); void CheckVideoParameters() override; void RenderImpl(CD3DTexture& target, CRect& sourceRect, CPoint(&destPoints)[4], uint32_t flags) override; CRenderBuffer* CreateBuffer() override; + virtual std::string GetRenderMethodDebugInfo() const; private: void FillBuffersSet(CRenderBuffer* (&buffers)[8]); diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererShaders.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererShaders.cpp index 32bce25f96..9e869404a6 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererShaders.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererShaders.cpp @@ -71,6 +71,11 @@ void CRendererShaders::GetWeight(std::map<RenderMethod, int>& weights, const Vid weights[RENDER_PS] = weight; } +CRendererShaders::CRendererShaders(CVideoSettings& videoSettings) : CRendererHQ(videoSettings) +{ + m_renderMethodName = "Pixel Shaders"; +} + bool CRendererShaders::Supports(ESCALINGMETHOD method) const { if (method == VS_SCALINGMETHOD_LINEAR) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererShaders.h b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererShaders.h index af4d677aae..fc640d3b83 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererShaders.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererShaders.h @@ -39,7 +39,7 @@ public: static void GetWeight(std::map<RenderMethod, int>& weights, const VideoPicture& picture); protected: - explicit CRendererShaders(CVideoSettings& videoSettings) : CRendererHQ(videoSettings) {} + explicit CRendererShaders(CVideoSettings& videoSettings); void RenderImpl(CD3DTexture& target, CRect& sourceRect, CPoint(&destPoints)[4], uint32_t flags) override; void CheckVideoParameters() override; void UpdateVideoFilters() override; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererSoftware.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererSoftware.cpp index 7bc80a178d..0f1b9279d2 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererSoftware.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererSoftware.cpp @@ -39,6 +39,11 @@ void CRendererSoftware::GetWeight(std::map<RenderMethod, int>& weights, const Vi weights[RENDER_SW] = weight; } +CRendererSoftware::CRendererSoftware(CVideoSettings& videoSettings) : CRendererBase(videoSettings) +{ + m_renderMethodName = "Software"; +} + CRendererSoftware::~CRendererSoftware() { if (m_sw_scale_ctx) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererSoftware.h b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererSoftware.h index fde19e7d6f..165798b933 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererSoftware.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/windows/RendererSoftware.h @@ -28,7 +28,7 @@ public: static void GetWeight(std::map<RenderMethod, int>& weights, const VideoPicture& picture); protected: - explicit CRendererSoftware(CVideoSettings& videoSettings) : CRendererBase(videoSettings) {} + explicit CRendererSoftware(CVideoSettings& videoSettings); CRenderBuffer* CreateBuffer() override; void RenderImpl(CD3DTexture& target, CRect& sourceRect, CPoint(&destPoints)[4], uint32_t flags) override; void FinalOutput(CD3DTexture& source, CD3DTexture& target, const CRect& src, const CPoint(&destPoints)[4]) override; |