• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CheckShutdown函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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());
}
开发者ID:carlnome,项目名称:SYEngine,代码行数:28,代码来源:HDMediaSource_GetService.cpp


示例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;
}
开发者ID:heartszhang,项目名称:FlvSource,代码行数:28,代码来源:FlvStream.cpp


示例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;
}
开发者ID:huangyt,项目名称:MyProjects,代码行数:26,代码来源:PpboxStream.cpp


示例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;
}
开发者ID:badreddine-dlaila,项目名称:Windows-8.1-Universal-App,代码行数:26,代码来源:MPEG1Stream.cpp


示例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,代码来源:GeometricMediaSource.cpp


示例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;
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:28,代码来源:WavSource.cpp


示例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;
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:25,代码来源:MPEG1Stream.cpp


示例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,代码来源:IMFClockStateSink.cpp


示例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,代码来源:IMFVideoPresenter.cpp


示例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;
}
开发者ID:CM44,项目名称:Windows-driver-samples,代码行数:28,代码来源:mftpeventgenerator.cpp


示例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,代码来源:MPEG1Stream.cpp


示例12: ThrowIfError

void 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,代码来源:MPEG1Stream.cpp



注:本文中的CheckShutdown函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CheckStableMaster函数代码示例发布时间:2022-05-30
下一篇:
C++ CheckRhs函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap