Cocoa Port:

- Fix compiling when using Xcode 3.
- Don’t set the output frame size with multiple glViewport() calls per frame. Just set it once for the output.
- Do some minor code cleanup.
This commit is contained in:
rogerman 2015-03-21 21:18:00 +00:00
parent b906b233c5
commit f0e8760dc4
3 changed files with 13 additions and 22 deletions

View File

@ -4520,7 +4520,7 @@ void OGLFilter::SetScaleOGL(GLfloat scale)
free(tempDstBuffer);
}
GLuint OGLFilter::RunFilterOGL(GLuint srcTexID, GLsizei viewportWidth, GLsizei viewportHeight)
GLuint OGLFilter::RunFilterOGL(GLuint srcTexID)
{
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, this->_fboID);
glBindVertexArrayDESMUME(this->_vaoID);
@ -4534,7 +4534,6 @@ GLuint OGLFilter::RunFilterOGL(GLuint srcTexID, GLsizei viewportWidth, GLsizei v
glBindVertexArrayDESMUME(0);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glViewport(0, 0, viewportWidth, viewportHeight);
return this->GetDstTexID();
}
@ -4576,7 +4575,7 @@ OGLFilterDeposterize::~OGLFilterDeposterize()
glDeleteTextures(1, &this->_texIntermediateID);
}
GLuint OGLFilterDeposterize::RunFilterOGL(GLuint srcTexID, GLsizei viewportWidth, GLsizei viewportHeight)
GLuint OGLFilterDeposterize::RunFilterOGL(GLuint srcTexID)
{
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, this->_fboID);
glBindVertexArrayDESMUME(this->_vaoID);
@ -4595,7 +4594,6 @@ GLuint OGLFilterDeposterize::RunFilterOGL(GLuint srcTexID, GLsizei viewportWidth
glBindVertexArrayDESMUME(0);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glViewport(0, 0, viewportWidth, viewportHeight);
return this->GetDstTexID();
}
@ -4906,6 +4904,8 @@ void OGLImage::UploadTransformationOGL()
glRotatef(0.0f, 0.0f, 0.0f, 1.0f);
glScalef(s, s, 1.0f);
}
glViewport(0, 0, this->_viewportWidth, this->_viewportHeight);
}
int OGLImage::GetOutputFilter()
@ -5283,7 +5283,7 @@ void OGLImage::ProcessOGL()
// Source
if (this->_useDeposterize)
{
this->_texVideoSourceID = this->_filterDeposterize->RunFilterOGL(this->_texVideoInputDataID, this->_viewportWidth, this->_viewportHeight);
this->_texVideoSourceID = this->_filterDeposterize->RunFilterOGL(this->_texVideoInputDataID);
if (isUsingCPUPixelScaler) // Hybrid CPU/GPU-based path (may cause a performance hit on pixel download)
{
@ -5304,7 +5304,7 @@ void OGLImage::ProcessOGL()
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
this->_texVideoPixelScalerID = this->_shaderFilter->RunFilterOGL(this->_texVideoSourceID, this->_viewportWidth, this->_viewportHeight);
this->_texVideoPixelScalerID = this->_shaderFilter->RunFilterOGL(this->_texVideoSourceID);
this->UpdateTexCoords(this->_shaderFilter->GetDstWidth(), this->_shaderFilter->GetDstHeight());
}
@ -5659,16 +5659,6 @@ void OGLDisplayLayer::SetRotation(GLfloat theRotation)
this->_rotation = theRotation;
}
bool OGLDisplayLayer::GetBilinear()
{
return (this->_displayTexFilter == GL_LINEAR);
}
void OGLDisplayLayer::SetBilinear(bool useBilinear)
{
this->_displayTexFilter = (useBilinear) ? GL_LINEAR : GL_NEAREST;
}
bool OGLDisplayLayer::GetSourceDeposterize()
{
return this->_useDeposterize;
@ -5835,6 +5825,8 @@ void OGLDisplayLayer::UploadTransformationOGL()
glRotatef(CLOCKWISE_DEGREES(this->_rotation), 0.0f, 0.0f, 1.0f);
glScalef(s, s, 1.0f);
}
glViewport(0, 0, this->_viewportWidth, this->_viewportHeight);
}
int OGLDisplayLayer::GetOutputFilter()
@ -6237,7 +6229,7 @@ void OGLDisplayLayer::ProcessOGL()
// Source
if (this->_useDeposterize)
{
this->_texVideoSourceID = this->_filterDeposterize->RunFilterOGL(this->_texVideoInputDataID, this->_viewportWidth, this->_viewportHeight);
this->_texVideoSourceID = this->_filterDeposterize->RunFilterOGL(this->_texVideoInputDataID);
if (isUsingCPUPixelScaler) // Hybrid CPU/GPU-based path (may cause a performance hit on pixel download)
{
@ -6260,7 +6252,7 @@ void OGLDisplayLayer::ProcessOGL()
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
this->_texVideoPixelScalerID = this->_shaderFilter->RunFilterOGL(this->_texVideoSourceID, this->_viewportWidth, this->_viewportHeight);
this->_texVideoPixelScalerID = this->_shaderFilter->RunFilterOGL(this->_texVideoSourceID);
this->UpdateTexCoords(this->_shaderFilter->GetDstWidth(), this->_shaderFilter->GetDstHeight());
}

View File

@ -151,7 +151,7 @@ public:
void SetSrcSizeOGL(GLsizei w, GLsizei h);
GLfloat GetScale();
void SetScaleOGL(GLfloat scale);
virtual GLuint RunFilterOGL(GLuint srcTexID, GLsizei viewportWidth, GLsizei viewportHeight);
virtual GLuint RunFilterOGL(GLuint srcTexID);
void DownloadDstBufferOGL(uint32_t *dstBuffer, size_t lineOffset, size_t readLineCount);
};
@ -164,7 +164,7 @@ public:
OGLFilterDeposterize(GLsizei srcWidth, GLsizei srcHeight, ShaderSupportTier theTier, bool useShader150);
~OGLFilterDeposterize();
virtual GLuint RunFilterOGL(GLuint srcTexID, GLsizei viewportWidth, GLsizei viewportHeight);
virtual GLuint RunFilterOGL(GLuint srcTexID);
};
class OGLVideoLayer
@ -362,8 +362,6 @@ public:
void SetGapScalar(GLfloat theScalar);
GLfloat GetRotation();
void SetRotation(GLfloat theRotation);
bool GetBilinear();
void SetBilinear(bool useBilinear);
bool GetSourceDeposterize();
void SetSourceDeposterize(bool useDeposterize);

View File

@ -93,6 +93,7 @@ typedef struct
id <CocoaDSControllerDelegate> delegate;
float micLevel;
BOOL autohold;
BOOL hardwareMicMute;
BOOL _isAutoholdCleared;
BOOL _useHardwareMic;
size_t _availableMicSamples;