Skip to content

Commit

Permalink
Revert "mmalrender: Disable deinterlace when no interlaced frames seen"
Browse files Browse the repository at this point in the history
This reverts commit a78f5e4.
  • Loading branch information
popcornmix committed Jul 27, 2016
1 parent 0347585 commit ce09b96
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Expand Up @@ -420,7 +420,6 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this,
m_deint_height = 0;
m_deint_aligned_width = 0;
m_deint_aligned_height = 0;
m_interlace_history = 0;

m_queue_process = mmal_queue_create();
m_processThread.Create();
Expand Down Expand Up @@ -550,7 +549,6 @@ void CMMALRenderer::Run()
if (interlace_method == VS_INTERLACEMETHOD_AUTO)
interlace_method = AutoInterlaceMethod();
bool interlace = (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED) ? true:false;
m_interlace_history = (m_interlace_history << 1) | (interlace ? 1 : 0);
// we don't keep up when running at 60fps in the background so switch to half rate
if (!g_graphicsContext.IsFullScreenVideo())
{
Expand All @@ -560,18 +558,14 @@ void CMMALRenderer::Run()
interlace_method = VS_INTERLACEMETHOD_MMAL_BOB_HALF;
}

bool was_enabled = m_deint_input != nullptr;

if (interlace_method == VS_INTERLACEMETHOD_NONE || !m_interlace_history)
if (interlace_method == VS_INTERLACEMETHOD_NONE)
{
if (m_deint_input)
DestroyDeinterlace();
}
else if (m_deint_input || interlace)
CheckConfigurationDeint(omvb->m_width, omvb->m_height, omvb->m_aligned_width, omvb->m_aligned_height, omvb->m_encoding, interlace_method);

CLog::Log(LOGDEBUG, "%s::%s im:%d in:%d(%llx) flags:%x enabled:%d->%d", CLASSNAME, __func__, interlace_method, interlace, m_interlace_history, omvb->mmal_buffer->flags, was_enabled, m_deint_input != nullptr);

if (m_deint_input)
{
MMAL_STATUS_T status = mmal_port_send_buffer(m_deint_input, omvb->mmal_buffer);
Expand Down
Expand Up @@ -158,7 +158,6 @@ class CMMALRenderer : public CBaseRenderer, public CThread, public IRunnable
EINTERLACEMETHOD m_interlace_method;
uint32_t m_deint_width, m_deint_height, m_deint_aligned_width, m_deint_aligned_height;
MMAL_FOURCC_T m_deinterlace_out_encoding;
uint64_t m_interlace_history;
void DestroyDeinterlace();
bool CheckConfigurationDeint(uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t encoding, EINTERLACEMETHOD interlace_method);

Expand Down

0 comments on commit ce09b96

Please sign in to comment.