Skip to content

Commit

Permalink
[mmalrenderer] Add SetCodecControl function
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Dec 28, 2015
1 parent 6d911e9 commit 1042859
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
Expand Up @@ -130,6 +130,7 @@ CMMALVideo::CMMALVideo()
m_speed = DVD_PLAYSPEED_NORMAL;
m_fps = 0.0f;
m_num_decoded = 0;
m_codecControlFlags = 0;
}

CMMALVideo::~CMMALVideo()
Expand Down Expand Up @@ -877,7 +878,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts)
}

if (g_advancedSettings.CanLogComponent(LOGVIDEO))
CLog::Log(LOGDEBUG, "%s::%s - ret(%x) pics(%d) inputs(%d) slept(%d) queued(%.2f) (%.2f:%.2f) full(%d)", CLASSNAME, __func__, ret, m_output_ready.size(), mmal_queue_length(m_dec_input_pool->queue), slept, queued*1e-6, m_demuxerPts*1e-6, m_decoderPts*1e-6, full);
CLog::Log(LOGDEBUG, "%s::%s - ret(%x) pics(%d) inputs(%d) slept(%d) queued(%.2f) (%.2f:%.2f) full(%d) flags(%x)", CLASSNAME, __func__, ret, m_output_ready.size(), mmal_queue_length(m_dec_input_pool->queue), slept, queued*1e-6, m_demuxerPts*1e-6, m_decoderPts*1e-6, full, m_codecControlFlags);

return ret;
}
Expand Down Expand Up @@ -941,6 +942,7 @@ void CMMALVideo::Reset(void)
}
m_decoderPts = DVD_NOPTS_VALUE;
m_demuxerPts = DVD_NOPTS_VALUE;
m_codecControlFlags = 0;
}

void CMMALVideo::SetSpeed(int iSpeed)
Expand Down Expand Up @@ -1051,3 +1053,9 @@ bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics)
droppedPics= -1;
return false;
}

void CMMALVideo::SetCodecControl(int flags)
{
CSingleLock lock(m_sharedSection);
m_codecControlFlags = flags;
}
2 changes: 2 additions & 0 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h
Expand Up @@ -79,6 +79,7 @@ class CMMALVideo : public CDVDVideoCodec
virtual void SetDropState(bool bDrop);
virtual const char* GetName(void) { return m_pFormatName ? m_pFormatName:"mmal-xxx"; }
virtual bool GetCodecStats(double &pts, int &droppedPics);
virtual void SetCodecControl(int flags);
virtual void SetSpeed(int iSpeed);

// MMAL decoder callback routines.
Expand Down Expand Up @@ -121,6 +122,7 @@ class CMMALVideo : public CDVDVideoCodec
double m_demuxerPts;
double m_decoderPts;
int m_speed;
int m_codecControlFlags;

CCriticalSection m_sharedSection;
MMAL_COMPONENT_T *m_dec;
Expand Down

0 comments on commit 1042859

Please sign in to comment.