From bb1a5d1afb4240fc085b0dd0bfa7d365e1be79cc Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 16 Sep 2014 11:50:11 +0200 Subject: renderer: rename/correct GetProcessorSize, processor is not exposed anymore --- xbmc/cores/VideoRenderers/BaseRenderer.h | 2 +- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 14 +++++--------- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 2 +- xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 10 ++-------- xbmc/cores/VideoRenderers/LinuxRendererGLES.h | 2 +- xbmc/cores/VideoRenderers/RenderManager.cpp | 14 +++++++++----- xbmc/cores/VideoRenderers/RenderManager.h | 2 +- xbmc/cores/VideoRenderers/WinRenderer.cpp | 4 ++-- xbmc/cores/VideoRenderers/WinRenderer.h | 2 +- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- 10 files changed, 24 insertions(+), 30 deletions(-) diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h index d303598c60..850aa6fd2d 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.h +++ b/xbmc/cores/VideoRenderers/BaseRenderer.h @@ -89,7 +89,7 @@ public: /** * Returns number of references a single buffer can retain when rendering a single frame */ - virtual unsigned int GetProcessorSize() { return 0; } + virtual unsigned int GetOptimalBufferSize() { return 0; } virtual unsigned int GetMaxBufferSize() { return 0; } virtual void SetBufferSize(int numBuffers) { } virtual void ReleaseBuffer(int idx) { } diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp index 417577d17f..5d3aaf7a79 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp @@ -3496,16 +3496,12 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } -unsigned int CLinuxRendererGL::GetProcessorSize() -{ - if(m_format == RENDER_FMT_VDPAU - || m_format == RENDER_FMT_VDPAU_420 - || m_format == RENDER_FMT_VAAPI - || m_format == RENDER_FMT_VAAPINV12 - || m_format == RENDER_FMT_CVBREF) - return 1; +unsigned int CLinuxRendererGL::GetOptimalBufferSize() +{ + if(m_format == RENDER_FMT_CVBREF) + return 2; else - return 0; + return 3; } #ifdef HAVE_LIBVDPAU diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h index 1e46940c78..813ca686f9 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h @@ -136,7 +136,7 @@ public: virtual void ReleaseBuffer(int idx); virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } - virtual unsigned int GetProcessorSize(); + virtual unsigned int GetOptimalBufferSize(); #ifdef HAVE_LIBVDPAU virtual void AddProcessor(VDPAU::CVdpauRenderPicture* vdpau, int index); diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp index 8db4ea1538..88292d4a1d 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp @@ -2893,15 +2893,9 @@ EINTERLACEMETHOD CLinuxRendererGLES::AutoInterlaceMethod() #endif } -unsigned int CLinuxRendererGLES::GetProcessorSize() +unsigned int CLinuxRendererGLES::GetOptimalBufferSize() { - if(m_format == RENDER_FMT_OMXEGL - || m_format == RENDER_FMT_CVBREF - || m_format == RENDER_FMT_EGLIMG - || m_format == RENDER_FMT_MEDIACODEC) - return 1; - else - return 0; + return 2; } #ifdef HAVE_LIBOPENMAX diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h index 1e89ecf71d..4be992d413 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.h @@ -143,7 +143,7 @@ public: virtual void ReleaseBuffer(int idx); virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } - virtual unsigned int GetProcessorSize(); + virtual unsigned int GetOptimalBufferSize(); virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp index 7300896a33..64273f8be8 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp @@ -261,14 +261,14 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi lock2.Enter(); m_format = format; - int processor = m_pRenderer->GetProcessorSize(); - m_QueueSize = std::min(buffers, processor); + int renderbuffers = m_pRenderer->GetOptimalBufferSize(); + m_QueueSize = std::min(buffers, renderbuffers); m_QueueSize = std::min(m_QueueSize, (int)m_pRenderer->GetMaxBufferSize()); m_QueueSize = std::min(m_QueueSize, NUM_BUFFERS); if(m_QueueSize < 2) { m_QueueSize = 2; - CLog::Log(LOGWARNING, "CXBMCRenderManager::Configure - queue size too small (%d, %d, %d)", m_QueueSize, processor, buffers); + CLog::Log(LOGWARNING, "CXBMCRenderManager::Configure - queue size too small (%d, %d, %d)", m_QueueSize, renderbuffers, buffers); } m_pRenderer->SetBufferSize(m_QueueSize); @@ -855,10 +855,14 @@ void CXBMCRenderManager::UpdateResolution() } -unsigned int CXBMCRenderManager::GetProcessorSize() +unsigned int CXBMCRenderManager::GetOptimalBufferSize() { CSharedLock lock(m_sharedSection); - return std::max(4, NUM_BUFFERS); + if (!m_pRenderer) + { + CLog::Log(LOGERROR, "%s - renderer is NULL", __FUNCTION__); + } + return m_pRenderer->GetMaxBufferSize(); } // Supported pixel formats, can be called before configure diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h index 8b237fb6c0..8b6b79a707 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.h +++ b/xbmc/cores/VideoRenderers/RenderManager.h @@ -153,7 +153,7 @@ public: CLinuxRenderer *m_pRenderer; #endif - unsigned int GetProcessorSize(); + unsigned int GetOptimalBufferSize(); // Supported pixel formats, can be called before configure std::vector SupportedFormats(); diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp index 8bdc03ddf3..832251abb9 100644 --- a/xbmc/cores/VideoRenderers/WinRenderer.cpp +++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp @@ -1311,12 +1311,12 @@ EINTERLACEMETHOD CWinRenderer::AutoInterlaceMethod() return VS_INTERLACEMETHOD_DEINTERLACE_HALF; } -unsigned int CWinRenderer::GetProcessorSize() +unsigned int CWinRenderer::GetOptimalBufferSize() { if (m_format == RENDER_FMT_DXVA && m_processor) return m_processor->Size(); else - return 0; + return 2; } void CWinRenderer::ReleaseBuffer(int idx) diff --git a/xbmc/cores/VideoRenderers/WinRenderer.h b/xbmc/cores/VideoRenderers/WinRenderer.h index 6d081a3ce7..e0f76f4944 100644 --- a/xbmc/cores/VideoRenderers/WinRenderer.h +++ b/xbmc/cores/VideoRenderers/WinRenderer.h @@ -168,7 +168,7 @@ public: void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); - virtual unsigned int GetProcessorSize(); + virtual unsigned int GetOptimalBufferSize(); virtual void SetBufferSize(int numBuffers) { m_neededBuffers = numBuffers; } virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } virtual void ReleaseBuffer(int idx); diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp index 3ad22e8135..21afca1c08 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -186,7 +186,7 @@ bool CDVDPlayerVideo::OpenStream( CDVDStreamInfo &hint ) unsigned int surfaces = 0; std::vector formats; #ifdef HAS_VIDEO_PLAYBACK - surfaces = g_renderManager.GetProcessorSize(); + surfaces = g_renderManager.GetOptimalBufferSize(); formats = g_renderManager.SupportedFormats(); #endif -- cgit v1.2.3