本文整理汇总了C++中xbmcthreads::EndTime::IsTimePast方法的典型用法代码示例。如果您正苦于以下问题:C++ EndTime::IsTimePast方法的具体用法?C++ EndTime::IsTimePast怎么用?C++ EndTime::IsTimePast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbmcthreads::EndTime
的用法示例。
在下文中一共展示了EndTime::IsTimePast方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WaitOnEvent
static NPT_Result WaitOnEvent(CEvent& event, XbmcThreads::EndTime& timeout, CGUIDialogBusy*& dialog)
{
if(event.WaitMSec(0))
return NPT_SUCCESS;
if(dialog == NULL) {
dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
dialog->Show();
}
g_windowManager.ProcessRenderLoop(false);
do {
if(event.WaitMSec(100))
return NPT_SUCCESS;
g_windowManager.ProcessRenderLoop(false);
if(dialog->IsCanceled())
return NPT_FAILURE;
} while(!timeout.IsTimePast());
return NPT_FAILURE;
}
示例2: handleZeroconfAnnouncement
void handleZeroconfAnnouncement()
{
#if defined(HAS_ZEROCONF)
static XbmcThreads::EndTime timeout(10000);
if(timeout.IsTimePast())
{
CZeroconf::GetInstance()->ForceReAnnounceService("servers.airplay");
timeout.Set(10000);
}
#endif
}
示例3: PresentRender
void CRenderSystemDX::PresentRender(bool rendered, bool videoLayer)
{
if (!m_bRenderCreated)
return;
if ( rendered
&& ( m_stereoMode == RENDER_STEREO_MODE_INTERLACED
|| m_stereoMode == RENDER_STEREO_MODE_CHECKERBOARD))
{
auto m_pContext = m_deviceResources->GetD3DContext();
// all views prepared, let's merge them before present
ID3D11RenderTargetView *const views[1] = { m_deviceResources->GetBackBufferRTV() };
m_pContext->OMSetRenderTargets(1, views, m_deviceResources->GetDSV());
auto outputSize = m_deviceResources->GetOutputSize();
CRect destRect = { 0.0f, 0.0f, float(outputSize.Width), float(outputSize.Height) };
SHADER_METHOD method = RENDER_STEREO_MODE_INTERLACED == m_stereoMode
? SHADER_METHOD_RENDER_STEREO_INTERLACED_RIGHT
: SHADER_METHOD_RENDER_STEREO_CHECKERBOARD_RIGHT;
SetAlphaBlendEnable(true);
CD3DTexture::DrawQuad(destRect, 0, &m_rightEyeTex, nullptr, method);
CD3DHelper::PSClearShaderResources(m_pContext);
}
// time for decoder that may require the context
{
CSingleLock lock(m_decoderSection);
XbmcThreads::EndTime timer;
timer.Set(5);
while (!m_decodingTimer.IsTimePast() && !timer.IsTimePast())
{
m_decodingEvent.wait(lock, 1);
}
}
PresentRenderImpl(rendered);
}
示例4: PlayFile
//.........这里部分代码省略.........
timeout.Set(timeout.GetInitialTimeoutValue());
NPT_CHECK_LABEL_SEVERE(m_control->GetTransportInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed_gettransportinfo);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_traevnt, timeout, dialog), failed_gettransportinfo);
if (m_delegate->m_trainfo.cur_transport_state != "NO_MEDIA_PRESENT" &&
m_delegate->m_trainfo.cur_transport_state != "STOPPED")
{
timeout.Set(timeout.GetInitialTimeoutValue());
NPT_CHECK_LABEL_SEVERE(m_control->Stop(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed_stop);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed_stop);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed_stop);
}
timeout.Set(timeout.GetInitialTimeoutValue());
NPT_CHECK_LABEL_SEVERE(m_control->SetAVTransportURI(m_delegate->m_device
, m_delegate->m_instance
, obj->m_Resources[res_index].m_Uri
, (const char*)tmp
, m_delegate), failed_setavtransporturi);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed_setavtransporturi);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed_setavtransporturi);
timeout.Set(timeout.GetInitialTimeoutValue());
NPT_CHECK_LABEL_SEVERE(m_control->Play(m_delegate->m_device
, m_delegate->m_instance
, "1"
, m_delegate), failed_play);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed_play);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed_play);
/* wait for PLAYING state */
timeout.Set(timeout.GetInitialTimeoutValue());
do {
NPT_CHECK_LABEL_SEVERE(m_control->GetTransportInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed_waitplaying);
{ CSingleLock lock(m_delegate->m_section);
if(m_delegate->m_trainfo.cur_transport_state == "PLAYING"
|| m_delegate->m_trainfo.cur_transport_state == "PAUSED_PLAYBACK")
break;
if(m_delegate->m_trainfo.cur_transport_state == "STOPPED"
&& m_delegate->m_trainfo.cur_transport_status != "OK")
{
CLog::Log(LOGERROR, "UPNP: CUPnPPlayer::OpenFile - remote player signalled error %s", file.GetPath().c_str());
return NPT_FAILURE;
}
}
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_traevnt, timeout, dialog), failed_waitplaying);
} while(!timeout.IsTimePast());
if(options.starttime > 0)
{
/* many upnp units won't load file properly until after play (including xbmc) */
NPT_CHECK_LABEL(m_control->Seek(m_delegate->m_device
, m_delegate->m_instance
, "REL_TIME"
, PLT_Didl::FormatTimeStamp((NPT_UInt32)options.starttime)
, m_delegate), failed_seek);
}
return NPT_SUCCESS;
failed_todidl:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s) failed to serialize item into DIDL-Lite", file.GetPath().c_str());
return NPT_FAILURE;
failed_findbestresource:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s) failed to find a matching resource", file.GetPath().c_str());
return NPT_FAILURE;
failed_gettransportinfo:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s): call to GetTransportInfo failed", file.GetPath().c_str());
return NPT_FAILURE;
failed_stop:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s) failed to stop current playback", file.GetPath().c_str());
return NPT_FAILURE;
failed_setavtransporturi:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s) failed to set the playback URI", file.GetPath().c_str());
return NPT_FAILURE;
failed_play:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s) failed to start playback", file.GetPath().c_str());
return NPT_FAILURE;
failed_waitplaying:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s) failed to wait for PLAYING state", file.GetPath().c_str());
return NPT_FAILURE;
failed_seek:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s) failed to seek to start offset", file.GetPath().c_str());
return NPT_FAILURE;
failed:
CLog::Log(LOGERROR, "CUPnPPlayer::PlayFile(%s) failed", file.GetPath().c_str());
return NPT_FAILURE;
}
示例5: OpenFile
bool CUPnPPlayer::OpenFile(const CFileItem& file, const CPlayerOptions& options)
{
CFileItem item(file);
NPT_Reference<CThumbLoader> thumb_loader;
NPT_Reference<PLT_MediaObject> obj;
NPT_String path(file.GetPath().c_str());
NPT_String tmp, resource;
XbmcThreads::EndTime timeout;
CGUIDialogBusy* dialog = NULL;
NPT_CHECK_POINTER_LABEL_SEVERE(m_delegate, failed);
timeout.Set(10000);
/* if no path we want to attach to a already playing player */
if(path != "") {
if (file.IsVideoDb())
thumb_loader = NPT_Reference<CThumbLoader>(new CVideoThumbLoader());
else if (item.IsMusicDb())
thumb_loader = NPT_Reference<CThumbLoader>(new CMusicThumbLoader());
obj = BuildObject(item, path, false, thumb_loader, NULL, CUPnP::GetServer());
if(obj.IsNull()) goto failed;
NPT_CHECK_LABEL_SEVERE(PLT_Didl::ToDidl(*obj, "", tmp), failed);
tmp.Insert(didl_header, 0);
tmp.Append(didl_footer);
/* The resource uri's are stored in the Didl. We must choose the best resource
* for the playback device */
NPT_Cardinal res_index;
NPT_CHECK_LABEL_SEVERE(m_control->FindBestResource(m_delegate->m_device, *obj, res_index), failed);
/* dlna specifies that a return code of 705 should be returned
* if TRANSPORT_STATE is not STOPPED or NO_MEDIA_PRESENT */
NPT_CHECK_LABEL_SEVERE(m_control->Stop(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed);
NPT_CHECK_LABEL_SEVERE(m_control->SetAVTransportURI(m_delegate->m_device
, m_delegate->m_instance
, obj->m_Resources[res_index].m_Uri
, (const char*)tmp
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed);
NPT_CHECK_LABEL_SEVERE(m_control->Play(m_delegate->m_device
, m_delegate->m_instance
, "1"
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_resevent, timeout, dialog), failed);
NPT_CHECK_LABEL_SEVERE(m_delegate->m_resstatus, failed);
}
/* wait for PLAYING state */
do {
NPT_CHECK_LABEL_SEVERE(m_control->GetTransportInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
{ CSingleLock lock(m_delegate->m_section);
if(m_delegate->m_trainfo.cur_transport_state == "PLAYING"
|| m_delegate->m_trainfo.cur_transport_state == "PAUSED_PLAYBACK")
break;
if(m_delegate->m_trainfo.cur_transport_state == "STOPPED"
&& m_delegate->m_trainfo.cur_transport_status != "OK")
{
CLog::Log(LOGERROR, "UPNP: CUPnPPlayer::OpenFile - remote player signalled error %s", file.GetPath().c_str());
goto failed;
}
}
NPT_CHECK_LABEL_SEVERE(WaitOnEvent(m_delegate->m_traevnt, timeout, dialog), failed);
} while(!timeout.IsTimePast());
if(options.starttime > 0)
{
/* many upnp units won't load file properly until after play (including xbmc) */
NPT_CHECK_LABEL(m_control->Seek(m_delegate->m_device
, m_delegate->m_instance
, "REL_TIME"
, PLT_Didl::FormatTimeStamp((NPT_UInt32)options.starttime)
, m_delegate), failed);
}
m_started = true;
m_callback.OnPlayBackStarted();
NPT_CHECK_LABEL_SEVERE(m_control->GetPositionInfo(m_delegate->m_device
, m_delegate->m_instance
, m_delegate), failed);
NPT_CHECK_LABEL_SEVERE(m_control->GetMediaInfo(m_delegate->m_device
//.........这里部分代码省略.........