diff options
author | Philipp Kerling <pkerling@casix.org> | 2019-03-28 17:26:43 +0100 |
---|---|---|
committer | Philipp Kerling <pkerling@casix.org> | 2019-03-28 18:22:01 +0100 |
commit | 467e65eb02dd4016e05ba89c693f13aabd6e6632 (patch) | |
tree | c2f30e4958efa7f6c9dcf18fd2eb0f646a60eaae | |
parent | 52e07cf767e1c2fa22a51a1a133561f6f1b3eb6b (diff) |
[vaapi] Remove texture bit guessing
This information is not actually used anywhere and it is unclear what
the purpose of reading GL_IMPLEMENTATION_COLOR_READ_FORMAT is in the
first place. Plus it has caused warnings to be issued now when the EGL
context has 10 bits of precision per color channel.
3 files changed, 0 insertions, 59 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVAAPIGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVAAPIGL.cpp index 47b488c1fb..f35fc73d08 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVAAPIGL.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVAAPIGL.cpp @@ -211,7 +211,6 @@ bool CRendererVAAPI::UploadTexture(int index) } m_vaapiTextures[index]->Map(pic); - m_buffers[index].m_srcTextureBits = m_vaapiTextures[index]->GetBits(); YuvImage &im = buf.image; CYuvPlane (&planes)[3] = buf.fields[0]; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.cpp index 35113d6421..e50963891e 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.cpp @@ -60,7 +60,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) { case VA_FOURCC('N','V','1','2'): { - m_bits = 8; attrib = attribs; *attrib++ = EGL_LINUX_DRM_FOURCC_EXT; *attrib++ = fourcc_code('R', '8', ' ', ' '); @@ -109,8 +108,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) return false; } - GLint format, type; - glGenTextures(1, &m_textureY); glBindTexture(m_interop.textureTarget, m_textureY); glTexParameteri(m_interop.textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -118,7 +115,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) glTexParameteri(m_interop.textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(m_interop.textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); m_interop.glEGLImageTargetTexture2DOES(m_interop.textureTarget, m_glSurface.eglImageY); - glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &format); glGenTextures(1, &m_textureVU); glBindTexture(m_interop.textureTarget, m_textureVU); @@ -127,17 +123,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) glTexParameteri(m_interop.textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(m_interop.textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); m_interop.glEGLImageTargetTexture2DOES(m_interop.textureTarget, m_glSurface.eglImageVU); - glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &format); - glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &type); - if (type == GL_UNSIGNED_BYTE) - m_bits = 8; - else if (type == GL_UNSIGNED_SHORT) - m_bits = 16; - else - { - CLog::Log(LOGWARNING, "Did not expect texture type: %d", (int) type); - m_bits = 8; - } glBindTexture(m_interop.textureTarget, 0); @@ -145,7 +130,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) } case VA_FOURCC('P','0','1','0'): { - m_bits = 10; attrib = attribs; *attrib++ = EGL_LINUX_DRM_FOURCC_EXT; *attrib++ = fourcc_code('R', '1', '6', ' '); @@ -194,8 +178,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) return false; } - GLint format, type; - glGenTextures(1, &m_textureY); glBindTexture(m_interop.textureTarget, m_textureY); glTexParameteri(m_interop.textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -203,7 +185,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) glTexParameteri(m_interop.textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(m_interop.textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); m_interop.glEGLImageTargetTexture2DOES(m_interop.textureTarget, m_glSurface.eglImageY); - glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &format); glGenTextures(1, &m_textureVU); glBindTexture(m_interop.textureTarget, m_textureVU); @@ -212,17 +193,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) glTexParameteri(m_interop.textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(m_interop.textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); m_interop.glEGLImageTargetTexture2DOES(m_interop.textureTarget, m_glSurface.eglImageVU); - glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &format); - glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &type); - if (type == GL_UNSIGNED_BYTE) - m_bits = 8; - else if (type == GL_UNSIGNED_SHORT) - m_bits = 16; - else - { - CLog::Log(LOGWARNING, "Did not expect texture type: %d", (int) type); - m_bits = 8; - } glBindTexture(m_interop.textureTarget, 0); @@ -230,7 +200,6 @@ bool CVaapi1Texture::Map(CVaapiRenderPicture *pic) } case VA_FOURCC('B','G','R','A'): { - m_bits = 8; attrib = attribs; *attrib++ = EGL_DRM_BUFFER_FORMAT_MESA; *attrib++ = EGL_DRM_BUFFER_FORMAT_ARGB32_MESA; @@ -307,11 +276,6 @@ void CVaapi1Texture::Unmap() m_vaapiPic = nullptr; } -int CVaapi1Texture::GetBits() -{ - return m_bits; -} - GLuint CVaapi1Texture::GetTextureY() { return m_textureY; @@ -514,18 +478,6 @@ bool CVaapi2Texture::Map(CVaapiRenderPicture* pic) m_textureSize.Set(pic->DVDPic.iWidth, pic->DVDPic.iHeight); - GLint type; - glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &type); - if (type == GL_UNSIGNED_BYTE) - m_bits = 8; - else if (type == GL_UNSIGNED_SHORT) - m_bits = 16; - else - { - CLog::Log(LOGWARNING, "Did not expect texture type: %d", static_cast<int> (type)); - m_bits = 8; - } - for (uint32_t layerNo = 0; layerNo < surface.num_layers; layerNo++) { int plane = 0; @@ -626,11 +578,6 @@ void CVaapi2Texture::Unmap() m_vaapiPic = nullptr; } -int CVaapi2Texture::GetBits() -{ - return m_bits; -} - GLuint CVaapi2Texture::GetTextureY() { return m_y.glTexture; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h index 6bac5a8804..b24f1ca77d 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h @@ -49,7 +49,6 @@ public: virtual bool Map(CVaapiRenderPicture *pic) = 0; virtual void Unmap() = 0; - virtual int GetBits() = 0; virtual GLuint GetTextureY() = 0; virtual GLuint GetTextureVU() = 0; virtual CSizeInt GetTextureSize() = 0; @@ -64,7 +63,6 @@ public: void Unmap() override; void Init(InteropInfo &interop) override; - int GetBits() override; GLuint GetTextureY() override; GLuint GetTextureVU() override; CSizeInt GetTextureSize() override; @@ -76,7 +74,6 @@ public: GLuint m_textureVU = 0; int m_texWidth = 0; int m_texHeight = 0; - int m_bits = 0; protected: static bool TestInteropDeepColor(VADisplay vaDpy, EGLDisplay eglDisplay); @@ -99,7 +96,6 @@ public: void Unmap() override; void Init(InteropInfo &interop) override; - int GetBits() override; GLuint GetTextureY() override; GLuint GetTextureVU() override; CSizeInt GetTextureSize() override; @@ -120,7 +116,6 @@ private: CVaapiRenderPicture* m_vaapiPic{}; bool m_hasPlaneModifiers{false}; std::array<KODI::UTILS::POSIX::CFileHandle, 4> m_drmFDs; - int m_bits{0}; MappedTexture m_y, m_vu; CSizeInt m_textureSize; }; |