Permalink
Browse files

Merge pull request #1086 from elupus/weave

Make weave double rate since we are unable to sync to specific field on output
  • Loading branch information...
2 parents d67bb81 + 7f3fb69 commit ef206e08cc596d997eda8fb63057a8c9dd59a3c4 @elupus elupus committed Jul 2, 2012
@@ -628,8 +628,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
index = m_iYV12RenderBuffer;
}
}
- else
- m_iLastRenderBuffer = index;
if (clear)
{
@@ -652,17 +650,26 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}
- if( (flags & RENDER_FLAG_TOP)
- && (flags & RENDER_FLAG_BOT) )
+ if(flags & RENDER_FLAG_WEAVE)
{
- glEnable(GL_POLYGON_STIPPLE);
+ int top_index = index;
+ int bot_index = index;
+
+ if((flags & RENDER_FLAG_FIELD0) && m_iLastRenderBuffer > -1)
+ {
+ if(flags & RENDER_FLAG_TOP)
+ bot_index = m_iLastRenderBuffer;
+ else
+ top_index = m_iLastRenderBuffer;
+ }
+ glEnable(GL_POLYGON_STIPPLE);
glPolygonStipple(stipple_weave);
- Render(flags & ~RENDER_FLAG_BOT, index);
+ Render((flags & ~RENDER_FLAG_FIELDMASK) | RENDER_FLAG_TOP, top_index);
glPolygonStipple(stipple_weave+4);
- Render(flags & ~RENDER_FLAG_TOP , index);
-
+ Render((flags & ~RENDER_FLAG_FIELDMASK) | RENDER_FLAG_BOT, bot_index);
glDisable(GL_POLYGON_STIPPLE);
+
}
else
Render(flags, index);
@@ -733,6 +740,8 @@ void CLinuxRendererGL::FlipPage(int source)
{
UnBindPbo(m_buffers[m_iYV12RenderBuffer]);
+ m_iLastRenderBuffer = m_iYV12RenderBuffer;
+
if( source >= 0 && source < m_NumYV12Buffers )
m_iYV12RenderBuffer = source;
else
@@ -29,6 +29,7 @@
#define RENDER_FLAG_FIELD0 0x80
#define RENDER_FLAG_FIELD1 0x100
+#define RENDER_FLAG_WEAVE 0x200
// #define RENDER_FLAG_LAST 0x40
@@ -652,9 +652,9 @@ void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha)
CSharedLock lock(m_sharedSection);
if( m_presentmethod == PRESENT_METHOD_BOB )
- PresentBob(clear, flags, alpha);
+ PresentFields(clear, flags, alpha);
else if( m_presentmethod == PRESENT_METHOD_WEAVE )
- PresentWeave(clear, flags, alpha);
+ PresentFields(clear, flags | RENDER_FLAG_WEAVE, alpha);
else if( m_presentmethod == PRESENT_METHOD_BLEND )
PresentBlend(clear, flags, alpha);
else
@@ -698,7 +698,7 @@ void CXBMCRenderManager::PresentSingle(bool clear, DWORD flags, DWORD alpha)
/* new simpler method of handling interlaced material, *
* we just render the two fields right after eachother */
-void CXBMCRenderManager::PresentBob(bool clear, DWORD flags, DWORD alpha)
+void CXBMCRenderManager::PresentFields(bool clear, DWORD flags, DWORD alpha)
{
CSingleLock lock(g_graphicsContext);
@@ -738,16 +738,6 @@ void CXBMCRenderManager::PresentBlend(bool clear, DWORD flags, DWORD alpha)
m_presentstep = PRESENT_IDLE;
}
-/* renders the two fields as one, but doing fieldbased *
- * scaling then reinterlaceing resulting image */
-void CXBMCRenderManager::PresentWeave(bool clear, DWORD flags, DWORD alpha)
-{
- CSingleLock lock(g_graphicsContext);
-
- m_pRenderer->RenderUpdate(clear, flags | RENDER_FLAG_BOTH, alpha);
- m_presentstep = PRESENT_IDLE;
-}
-
void CXBMCRenderManager::Recover()
{
#if defined(HAS_GL) && !defined(TARGET_DARWIN)
@@ -135,8 +135,7 @@ class CXBMCRenderManager
void Render(bool clear, DWORD flags, DWORD alpha);
void PresentSingle(bool clear, DWORD flags, DWORD alpha);
- void PresentWeave(bool clear, DWORD flags, DWORD alpha);
- void PresentBob(bool clear, DWORD flags, DWORD alpha);
+ void PresentFields(bool clear, DWORD flags, DWORD alpha);
void PresentBlend(bool clear, DWORD flags, DWORD alpha);
EINTERLACEMETHOD AutoInterlaceMethodInternal(EINTERLACEMETHOD mInt);

0 comments on commit ef206e0

Please sign in to comment.