Skip to content

Commit

Permalink
[VideoRendererGles] - render video with full color range on gles systems
Browse files Browse the repository at this point in the history
  • Loading branch information
Memphiz committed Jan 3, 2016
1 parent e0fe70a commit 8aa00d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Expand Up @@ -876,6 +876,7 @@ void CLinuxRendererGLES::RenderSinglePass(int index, int field)
pYUVShader->SetField(0);

pYUVShader->SetMatrices(glMatrixProject.Get(), glMatrixModview.Get());
pYUVShader->SetForceLimitedColorRange(false);
pYUVShader->Enable();

GLubyte idx[4] = {0, 1, 3, 2}; //determines order of triangle strip
Expand Down
Expand Up @@ -289,7 +289,7 @@ bool BaseYUV2RGBGLSLShader::OnEnabled()

GLfloat matrix[4][4];
// keep video levels
CalculateYUVMatrixGL(matrix, m_flags, m_format, m_black, m_contrast, true);
CalculateYUVMatrixGL(matrix, m_flags, m_format, m_black, m_contrast, m_forceLimitedColorRange);

glUniformMatrix4fv(m_hMatrix, 1, GL_FALSE, (GLfloat*)matrix);
#if HAS_GLES == 2
Expand Down
Expand Up @@ -46,6 +46,7 @@ namespace Shaders {
: virtual public CShaderProgram
{
public:
BaseYUV2RGBShader() : m_forceLimitedColorRange(true) {};
virtual ~BaseYUV2RGBShader() {};
virtual void SetField(int field) {};
virtual void SetWidth(int width) {};
Expand All @@ -63,6 +64,10 @@ namespace Shaders {
virtual void SetMatrices(GLfloat *p, GLfloat *m) {};
virtual void SetAlpha(GLfloat alpha) {};
#endif
void SetForceLimitedColorRange(bool forceLimitedColorRange) { m_forceLimitedColorRange = forceLimitedColorRange; }

protected:
bool m_forceLimitedColorRange;
};


Expand Down

0 comments on commit 8aa00d2

Please sign in to comment.