本文整理汇总了C++中CheckShutdown函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckShutdown函数的具体用法?C++ CheckShutdown怎么用?C++ CheckShutdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckShutdown函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DbgLogPrintf
HRESULT 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());
}
示例2: lock
HRESULT 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;
}
示例3: lock
HRESULT 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;
}
示例4: lock
HRESULT 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;
}
示例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;
}
示例6: EnterCriticalSection
HRESULT 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;
}
示例7: lock
HRESULT 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;
}
示例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;
}
示例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;
}
示例10: CheckShutdown
STDMETHODIMP 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;
}
示例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.
}
}
示例12: ThrowIfError
void CMPEG1Stream::Pause()
{
ThrowIfError(CheckShutdown());
m_state = STATE_PAUSED;
ThrowIfError(QueueEvent(MEStreamPaused, GUID_NULL, S_OK, nullptr));
}