这篇教程C++ CheckShutdown函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CheckShutdown函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckShutdown函数的具体用法?C++ CheckShutdown怎么用?C++ CheckShutdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CheckShutdown函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: DbgLogPrintfHRESULT HDMediaSource::SetRate(BOOL fThin,float flRate){ DbgLogPrintf(L"%s::SetRate... (Thin:%d, Rate:%.2f)",L"HDMediaSource",fThin,flRate); CritSec::AutoLock lock(_cs); HRESULT hr = CheckShutdown(); if (FAILED(hr)) return hr; if (fThin) return MF_E_THINNING_UNSUPPORTED; if (flRate < MIN_MFSOURCE_RATE_SUPPORT || flRate > MAX_MFSOURCE_RATE_SUPPORT) return MF_E_UNSUPPORTED_RATE; if (flRate == _currentRate) return _pEventQueue->QueueEventParamVar(MESourceRateChanged,GUID_NULL,S_OK,nullptr); ComPtr<SourceOperation> op; hr = SourceOperation::CreateSetRateOperation(fThin,flRate,op.GetAddressOf()); if (FAILED(hr)) return hr; DbgLogPrintf(L"%s::SetRate OK.",L"HDMediaSource"); return QueueOperation(op.Get());}
开发者ID:carlnome,项目名称:SYEngine,代码行数:28,
示例2: lockHRESULT FlvStream::GetEvent(DWORD dwFlags, IMFMediaEvent** ppEvent){ HRESULT hr = S_OK; IMFMediaEventQueuePtr pQueue; { // scope for lock SourceLock lock(source); // Check shutdown hr = CheckShutdown(); // Cache a local pointer to the queue. if (SUCCEEDED(hr)) { pQueue = event_queue; } } // release lock // Use the local pointer to call GetEvent. if (SUCCEEDED(hr)) { hr = pQueue->GetEvent(dwFlags, ppEvent); } return hr;}
开发者ID:heartszhang,项目名称:FlvSource,代码行数:28,
示例3: lockHRESULT PpboxStream::GetMediaSource(IMFMediaSource** ppMediaSource){ SourceLock lock(m_pSource); if (ppMediaSource == NULL) { return E_POINTER; } if (m_pSource == NULL) { return E_UNEXPECTED; } HRESULT hr = S_OK; hr = CheckShutdown(); // QI the source for IMFMediaSource. // (Does not hold the source's critical section.) if (SUCCEEDED(hr)) { hr = m_pSource->QueryInterface(IID_PPV_ARGS(ppMediaSource)); } return hr;}
开发者ID:huangyt,项目名称:MyProjects,代码行数:26,
示例4: lockHRESULT CMPEG1Stream::GetMediaSource(IMFMediaSource **ppMediaSource){ SourceLock lock(m_spSource.Get()); if (ppMediaSource == nullptr) { return E_POINTER; } if (m_spSource == nullptr) { return E_UNEXPECTED; } HRESULT hr = S_OK; hr = CheckShutdown(); // QI the source for IMFMediaSource. // (Does not hold the source's critical section.) if (SUCCEEDED(hr)) { hr = m_spSource.CopyTo(IID_PPV_ARGS(ppMediaSource)); } return hr;}
开发者ID:badreddine-dlaila,项目名称:Windows-8.1-Universal-App,代码行数:26,
示例5: lock__override HRESULT CGeometricMediaSource::DispatchOperation(CSourceOperation *pOp){ AutoLock lock(_critSec); HRESULT hr = CheckShutdown(); if (SUCCEEDED(hr)) { switch(pOp->GetOperationType()) { case CSourceOperation::Operation_Start: hr = DoStart(static_cast<CStartOperation *>(pOp)); break; case CSourceOperation::Operation_Stop: hr = DoStop(pOp); break; case CSourceOperation::Operation_SetRate: hr = DoSetRate(static_cast<CSetRateOperation *>(pOp)); break; default: hr = E_UNEXPECTED; break; } } return hr;}
开发者ID:ckc,项目名称:WinApp,代码行数:27,
示例6: EnterCriticalSectionHRESULT WavStream::GetStreamDescriptor(IMFStreamDescriptor** ppStreamDescriptor){ if (ppStreamDescriptor == NULL) { return E_POINTER; } if (m_pStreamDescriptor == NULL) { return E_UNEXPECTED; } EnterCriticalSection(&m_critSec); HRESULT hr = S_OK; hr = CheckShutdown(); if (SUCCEEDED(hr)) { *ppStreamDescriptor = m_pStreamDescriptor; (*ppStreamDescriptor)->AddRef(); } LeaveCriticalSection(&m_critSec); return hr;}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:28,
示例7: lockHRESULT MPEG1Stream::GetMediaSource(IMFMediaSource** ppMediaSource){ SourceLock lock(m_pSource); if (ppMediaSource == NULL) { return E_POINTER; } if (m_pSource == NULL) { return E_UNEXPECTED; } HRESULT hr = S_OK; CHECK_HR(hr = CheckShutdown()); // QI the source for IMFMediaSource. // (Does not hold the source's critical section.) CHECK_HR(hr = m_pSource->QueryInterface(IID_PPV_ARGS(ppMediaSource)));done: return hr;}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:25,
示例8: Log// Called when the rate changes on the presentation clock.HRESULT STDMETHODCALLTYPE EVRCustomPresenter::OnClockSetRate(MFTIME hnsSystemTime, float fRate){ Log("EVRCustomPresenter::OnClockSetRate (rate=%f)", fRate); HRESULT hr = S_OK; CAutoLock lock(this); // We cannot set the rate after shutdown. hr = CheckShutdown(); CHECK_HR(hr, "EVRCustomPresenter::OnClockRestart cannot set rate after shutdown"); // If the rate is changing from zero (scrubbing) to non-zero, cancel the frame-step operation. if ((m_fRate == 0.0f) && (fRate != 0.0f)) { CancelFrameStep(); m_FrameStep.samples.Clear(); } m_fRate = fRate; // Tell the scheduler about the new rate. m_scheduler.SetClockRate(fRate); return hr;}
开发者ID:MediaPortal,项目名称:MediaPortal-2,代码行数:27,
示例9: Log// Retrieves the presenter's media type.HRESULT STDMETHODCALLTYPE EVRCustomPresenter::GetCurrentMediaType(IMFVideoMediaType **ppMediaType){ Log("EVRCustomPresenter::GetCurrentMediaType"); HRESULT hr = S_OK; if (ppMediaType == NULL) { return E_POINTER; } *ppMediaType = NULL; CAutoLock lock(this); hr = CheckShutdown(); CHECK_HR(hr, "EVRCustomPresenter::GetCurrentMediaType presenter is shutdown"); CheckPointer(m_pMediaType, MF_E_NOT_INITIALIZED); // Get IMFVideoMediaType pointer and store as an IMFMediaType pointer by callin QueryInterface hr = m_pMediaType->QueryInterface(__uuidof(IMFVideoMediaType), (void**)&ppMediaType); CHECK_HR(hr, "EVRCustomPresenter::GetCurrentMediaType IMFMediaType::QueryInterface() failed"); return hr;}
开发者ID:DieBagger,项目名称:MediaPortal-2,代码行数:27,
示例10: CheckShutdownSTDMETHODIMP CMediaEventGenerator::QueueEvent( _In_ MediaEventType met, _In_ REFGUID extendedType, _In_ HRESULT hrStatus, _In_opt_ const PROPVARIANT* pvValue ){ HRESULT hr = S_OK; //MFWMITRACE(DH_THIS_FILE, TP_NORMAL, __FUNCTION__ " : MultiPinMFT QueueEvent called"); m_critSec.Lock(); hr = CheckShutdown(); if (SUCCEEDED(hr)) { hr = m_pQueue->QueueEventParamVar( met, extendedType, hrStatus, pvValue ); } m_critSec.Unlock(); return hr;}
开发者ID:CM44,项目名称:Windows-driver-samples,代码行数:28,
示例11: void CMPEG1Stream::Shutdown(){ if (SUCCEEDED(CheckShutdown())) { m_state = STATE_SHUTDOWN; // Shut down the event queue. if (m_spEventQueue) { m_spEventQueue->Shutdown(); } // Release objects. m_Samples.Clear(); m_Requests.Clear(); m_spStreamDescriptor.Reset(); m_spEventQueue.Reset(); // NOTE: // Do NOT release the source pointer here, because the stream uses // it to hold the critical section. In particular, the stream must // hold the critical section when checking the shutdown status, // which obviously can occur after the stream is shut down. // It is OK to hold a ref count on the source after shutdown, // because the source releases its ref count(s) on the streams, // which breaks the circular ref count. }}
开发者ID:badreddine-dlaila,项目名称:Windows-8.1-Universal-App,代码行数:30,
示例12: ThrowIfErrorvoid CMPEG1Stream::Pause(){ ThrowIfError(CheckShutdown()); m_state = STATE_PAUSED; ThrowIfError(QueueEvent(MEStreamPaused, GUID_NULL, S_OK, nullptr));}
开发者ID:badreddine-dlaila,项目名称:Windows-8.1-Universal-App,代码行数:8,
注:本文中的CheckShutdown函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CheckStableMaster函数代码示例 C++ CheckRhs函数代码示例 |