diff options
author | popcornmix <popcornmix@gmail.com> | 2013-03-22 13:49:05 +0000 |
---|---|---|
committer | popcornmix <popcornmix@gmail.com> | 2013-04-03 15:49:39 +0100 |
commit | 8e6ebfd69bb25995132803feb33e2058feefb8bc (patch) | |
tree | f6697ff624e1ee83d0b09b8cee726a8efeb5355b | |
parent | d1b6df908b5a4033a2052d6d03adcc7512a6cc42 (diff) |
[rbp] Add OMXLateCount to query if packets have arrived late
Could be useful for detecting underrun conditions
-rw-r--r-- | xbmc/linux/OMXClock.cpp | 32 | ||||
-rw-r--r-- | xbmc/linux/OMXClock.h | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/xbmc/linux/OMXClock.cpp b/xbmc/linux/OMXClock.cpp index 54ccf31c90..38608186b3 100644 --- a/xbmc/linux/OMXClock.cpp +++ b/xbmc/linux/OMXClock.cpp @@ -791,6 +791,38 @@ bool OMXClock::OMXMediaTime(double pts, bool fixPreroll /* = true*/, bool lock / return true; } +// gets count of late frames, indicating underrun has occurred +int OMXClock::OMXLateCount(int port /* true */ , bool lock /* = true */) +{ + if(m_omx_clock.GetComponent() == NULL) + return 0; + + if(lock) + Lock(); + + OMX_ERRORTYPE omx_err = OMX_ErrorNone; + + OMX_PARAM_U32TYPE late; + OMX_INIT_STRUCTURE(late); + late.nPortIndex = m_omx_clock.GetInputPort()+port; + + omx_err = m_omx_clock.GetConfig(OMX_IndexConfigBrcmClockMissCount, &late); + if(omx_err != OMX_ErrorNone) + { + CLog::Log(LOGERROR, "OMXClock::OMXLateCount error getting OMX_IndexConfigBrcmClockMissCount(%d)\n", port); + if(lock) + UnLock(); + return 0; + } + + //CLog::Log(LOGINFO, "OMXClock::OMXLateCount(%d)=%d", port, late.nU32); + + if(lock) + UnLock(); + + return late.nU32; +} + bool OMXClock::OMXPause(bool lock /* = true */) { if(m_omx_clock.GetComponent() == NULL) diff --git a/xbmc/linux/OMXClock.h b/xbmc/linux/OMXClock.h index 3001d86b56..a969e176c8 100644 --- a/xbmc/linux/OMXClock.h +++ b/xbmc/linux/OMXClock.h @@ -117,6 +117,7 @@ public: double OMXWallTime(bool lock = true); double OMXMediaTime(bool fixPreroll = true, bool lock = true); bool OMXMediaTime(double pts, bool fixPreroll = true, bool lock = true); + int OMXLateCount(int port, bool lock = true); bool OMXPause(bool lock = true); bool OMXResume(bool lock = true); bool OMXUpdateClock(double pts, bool lock = true); |