本文整理汇总了C++中MythProgramInfo::Duration方法的典型用法代码示例。如果您正苦于以下问题:C++ MythProgramInfo::Duration方法的具体用法?C++ MythProgramInfo::Duration怎么用?C++ MythProgramInfo::Duration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythProgramInfo
的用法示例。
在下文中一共展示了MythProgramInfo::Duration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRecordingFrameRate
float PVRClientMythTV::GetRecordingFrameRate(MythProgramInfo &recording)
{
// MythTV uses frame offsets whereas XBMC expects a time offset.
// This function can be used to convert the frame offsets to time offsets and back.
// The average frameRate is calculated by: frameRate = frameCount / duration.
float frameRate = 0.0f;
if (g_bExtraDebug)
{
XBMC->Log(LOG_DEBUG, "%s - Getting Framerate for: %s)", __FUNCTION__, recording.Title(false).c_str());
}
// cmyth_get_bookmark_mark returns the appropriate frame offset for the given byte offset (recordedseek table)
// This can be used to determine the frame count (by querying the max byte offset)
long long frameCount = m_db.GetBookmarkMark(recording, LLONG_MAX, 0);
if (frameCount > 0)
{
if (g_bExtraDebug)
{
XBMC->Log(LOG_DEBUG, "%s - FrameCount: %lld)", __FUNCTION__, frameCount);
XBMC->Log(LOG_DEBUG, "%s - Duration: %d)", __FUNCTION__, recording.Duration());
}
if (recording.Duration() > 0)
{
// Calculate frameRate
frameRate = (float)frameCount / (float)recording.Duration();
if (g_bExtraDebug)
{
XBMC->Log(LOG_DEBUG, "%s - FrameRate: %f)", __FUNCTION__, frameRate);
}
}
}
return frameRate;
}