Skip to content

Commit

Permalink
[mmalrenderer] Separate mmal and renderer configured flags
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Apr 18, 2015
1 parent 4ca5e8a commit 730f798
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
26 changes: 15 additions & 11 deletions xbmc/cores/VideoRenderers/MMALRenderer.cpp
Expand Up @@ -74,13 +74,12 @@ void *CMMALRenderer::PassCookie(void *cookie)
CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, cookie);
#endif

if (m_mmal_video)
{
bool formatChanged = m_format != RENDER_FMT_MMAL;
m_format = RENDER_FMT_MMAL;
m_bConfigured = init_vout(formatChanged);
if (m_mmal_video && !m_bMMALConfigured)
m_bMMALConfigured = init_vout(RENDER_FMT_MMAL);

if (m_mmal_video && m_bMMALConfigured)
Prime();
}

return NULL;
}

Expand Down Expand Up @@ -122,10 +121,10 @@ bool CMMALRenderer::init_vout(ERenderFormat format)

CLog::Log(LOGDEBUG, "%s::%s configured:%d format:%d->%d", CLASSNAME, __func__, m_bConfigured, m_format, format);

if (m_bConfigured && formatChanged)
if (m_bMMALConfigured && formatChanged)
UnInitMMAL();

if (m_bConfigured)
if (m_bMMALConfigured)
return true;

m_format = RENDER_FMT_MMAL;
Expand Down Expand Up @@ -248,6 +247,8 @@ CMMALRenderer::CMMALRenderer()
m_iFlags = 0;
m_format = RENDER_FMT_NONE;
m_mmal_video = NULL;
m_bConfigured = false;
m_bMMALConfigured = false;
m_iYV12RenderBuffer = 0;
Create();
}
Expand Down Expand Up @@ -298,8 +299,9 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned
SetViewMode(CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode);
ManageDisplay();

m_bConfigured = init_vout(format);

m_bMMALConfigured = init_vout(format);
m_bConfigured = m_bMMALConfigured;
assert(m_bConfigured);
return m_bConfigured;
}

Expand Down Expand Up @@ -362,7 +364,8 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly)

void CMMALRenderer::ReleaseBuffer(int idx)
{
if (!m_bConfigured || m_format == RENDER_FMT_BYPASS)
CSingleLock lock(m_sharedSection);
if (!m_bMMALConfigured || m_format == RENDER_FMT_BYPASS)
return;

#if defined(MMAL_DEBUG_VERBOSE)
Expand Down Expand Up @@ -542,6 +545,7 @@ void CMMALRenderer::UnInitMMAL()
m_StereoInvert = false;

m_bConfigured = false;
m_bMMALConfigured = false;
}

void CMMALRenderer::UnInit()
Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/VideoRenderers/MMALRenderer.h
Expand Up @@ -100,6 +100,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread

YUVBUFFER m_buffers[NUM_BUFFERS];
bool m_bConfigured;
bool m_bMMALConfigured;
unsigned int m_extended_format;
unsigned int m_destWidth;
unsigned int m_destHeight;
Expand Down

0 comments on commit 730f798

Please sign in to comment.