本文整理汇总了C++中filter::Lock类的典型用法代码示例。如果您正苦于以下问题:C++ Lock类的具体用法?C++ Lock怎么用?C++ Lock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Lock类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: EndOfStream
HRESULT Inpin::EndOfStream()
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
#ifdef _DEBUG
odbgstream os;
os << "webmvorbisdecoder::inpin::EOS" << endl;
#endif
if (m_bFlush)
return S_FALSE; //?
m_bEndOfStream = true;
m_buffers.push_back(0);
const BOOL b = SetEvent(m_hSamples);
assert(b);
return S_OK;
}
开发者ID:brion,项目名称:webmdshow,代码行数:29,代码来源:webmvorbisdecoderinpin.cpp
示例2: OnCompletion
void Inpin::OnCompletion()
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
assert(SUCCEEDED(hr));
while (!m_buffers.empty())
{
IMediaSample* const pSample = m_buffers.front();
if (pSample == 0) //EOS notification
break; //don't throw EOS notification away
m_buffers.pop_front();
pSample->Release();
}
typedef channels_t::iterator iter_t;
iter_t i = m_channels.begin();
const iter_t j = m_channels.end();
while (i != j)
{
samples_t& ss = *i++;
ss.clear();
}
m_bDone = true;
}
开发者ID:brion,项目名称:webmdshow,代码行数:31,代码来源:webmvorbisdecoderinpin.cpp
示例3: GetAvailable
HRESULT OutpinVideo::GetAvailable(
LONGLONG* pEarliest,
LONGLONG* pLatest)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->GetAvailable(pEarliest, pLatest);
}
return E_FAIL;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:25,代码来源:vp8encoderoutpinvideo.cpp
示例4: BeginFlush
HRESULT Inpin::BeginFlush()
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
//TODO:
//if (m_bFlush)
// return S_FALSE;
#if 0 //def _DEBUG
odbgstream os;
os << "vp8decoder::inpin::beginflush" << endl;
#endif
m_bFlush = true;
if (IPin* pPin = m_pFilter->m_outpin.m_pPinConnection)
{
lock.Release();
const HRESULT hr = pPin->BeginFlush();
return hr;
}
return S_OK;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:33,代码来源:vp8decoderinpin.cpp
示例5: NewSegment
HRESULT Inpin::NewSegment(
REFERENCE_TIME st,
REFERENCE_TIME sp,
double r)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
if (IPin* pPin = m_pFilter->m_outpin.m_pPinConnection)
{
lock.Release();
const HRESULT hr = pPin->NewSegment(st, sp, r);
return hr;
}
return S_OK;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:25,代码来源:vp8decoderinpin.cpp
示例6: GetPositions
HRESULT OutpinVideo::GetPositions(
LONGLONG* pCurrPos,
LONGLONG* pStopPos)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->GetPositions(pCurrPos, pStopPos);
}
return E_FAIL;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:25,代码来源:vp8encoderoutpinvideo.cpp
示例7: GetCurrentPosition
HRESULT OutpinVideo::GetCurrentPosition(LONGLONG* p)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
#if 0
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->GetCurrentPosition(p);
}
if (p == 0)
return E_POINTER;
return E_FAIL;
#else
if (p == 0)
return E_POINTER;
*p = inpin.m_start_reftime;
return S_OK;
#endif
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:35,代码来源:vp8encoderoutpinvideo.cpp
示例8: GetCurrentPosition
HRESULT Outpin::GetCurrentPosition(LONGLONG* p)
{
if (p == 0)
return E_POINTER;
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
LONGLONG& pos = *p;
pos = m_pStream->GetCurrTime();
if (pos < 0) //means "use duration"
{
hr = GetDuration(&pos);
if (FAILED(hr) || (pos < 0))
return E_FAIL;
}
return S_OK;
}
开发者ID:brion,项目名称:webmdshow,代码行数:25,代码来源:webmoggsourceoutpin.cpp
示例9: SetTimeFormat
HRESULT OutpinVideo::SetTimeFormat(const GUID* p)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->SetTimeFormat(p);
}
if (p == 0)
return E_INVALIDARG;
if (*p == TIME_FORMAT_MEDIA_TIME)
return S_OK;
return E_INVALIDARG;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:29,代码来源:vp8encoderoutpinvideo.cpp
示例10: GetDuration
HRESULT OutpinVideo::GetDuration(LONGLONG* p)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->GetDuration(p);
}
if (p == 0)
return E_POINTER;
return E_FAIL;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:26,代码来源:vp8encoderoutpinvideo.cpp
示例11: QueryPreferredFormat
HRESULT OutpinVideo::QueryPreferredFormat(GUID* p)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->QueryPreferredFormat(p);
}
if (p == 0)
return E_POINTER;
*p = TIME_FORMAT_MEDIA_TIME;
return S_OK;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:27,代码来源:vp8encoderoutpinvideo.cpp
示例12: IsFormatSupported
HRESULT OutpinVideo::IsFormatSupported(const GUID* p)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->IsFormatSupported(p);
}
if (p == 0)
return E_POINTER;
const GUID& g = *p;
if (g == TIME_FORMAT_MEDIA_TIME)
return S_OK;
return S_FALSE;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:31,代码来源:vp8encoderoutpinvideo.cpp
示例13: CheckCapabilities
HRESULT OutpinVideo::CheckCapabilities(DWORD* pdw)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->CheckCapabilities(pdw);
}
if (pdw == 0)
return E_POINTER;
DWORD& dw = *pdw;
const DWORD dwRequested = dw;
if (dwRequested == 0)
return E_INVALIDARG;
return E_FAIL;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:33,代码来源:vp8encoderoutpinvideo.cpp
示例14: GetCapabilities
HRESULT OutpinVideo::GetCapabilities(DWORD* pdw)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
const Inpin& inpin = m_pFilter->m_inpin;
const GraphUtil::IMediaSeekingPtr pSeek(inpin.m_pPinConnection);
if (bool(pSeek))
{
lock.Release();
return pSeek->GetCapabilities(pdw);
}
if (pdw == 0)
return E_POINTER;
DWORD& dw = *pdw;
dw = 0;
return S_OK; //?
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:29,代码来源:vp8encoderoutpinvideo.cpp
示例15: EndFlush
HRESULT Inpin::EndFlush()
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (!bool(m_pPinConnection))
return VFW_E_NOT_CONNECTED;
#if 0 //def _DEBUG
odbgstream os;
os << "vp8decoder::inpin::endflush" << endl;
#endif
m_bFlush = false;
m_bEndOfStream = false;
if (IPin* pPin = m_pFilter->m_outpin.m_pPinConnection)
{
lock.Release();
const HRESULT hr = pPin->EndFlush();
return hr;
}
return S_OK;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:30,代码来源:vp8decoderinpin.cpp
示例16: QueryAccept
HRESULT Outpin::QueryAccept(const AM_MEDIA_TYPE* pmt_query)
{
if (pmt_query == 0)
return E_INVALIDARG;
const AM_MEDIA_TYPE& mt_query = *pmt_query;
if (mt_query.majortype != MEDIATYPE_Video)
return S_FALSE;
if (mt_query.subtype == MEDIASUBTYPE_NV12)
__noop;
else if (mt_query.subtype == MEDIASUBTYPE_YV12)
__noop;
else if (mt_query.subtype == WebmTypes::MEDIASUBTYPE_I420)
__noop;
else if (mt_query.subtype == MEDIASUBTYPE_UYVY)
__noop;
else if (mt_query.subtype == MEDIASUBTYPE_YVYU)
__noop;
else if (mt_query.subtype == MEDIASUBTYPE_YUY2)
__noop;
else if (mt_query.subtype == MEDIASUBTYPE_YUYV)
__noop;
else
return S_FALSE;
Filter::Lock lock;
const HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return S_FALSE;
const Inpin& inpin = m_pFilter->m_inpin;
if (!bool(inpin.m_pPinConnection))
return S_FALSE;
if (mt_query.formattype == FORMAT_None)
return S_OK;
if (mt_query.formattype == GUID_NULL)
return S_OK;
const AM_MEDIA_TYPE& mt_in = inpin.m_connection_mtv[0];
if (mt_query.formattype == FORMAT_VideoInfo)
return QueryAcceptVideoInfo(mt_in, mt_query);
if (mt_query.formattype == FORMAT_VideoInfo2)
return QueryAcceptVideoInfo2(mt_in, mt_query);
return S_FALSE;
}
开发者ID:brion,项目名称:webmdshow,代码行数:55,代码来源:vp8decoderoutpin.cpp
示例17: EnumMediaTypes
HRESULT Pin::EnumMediaTypes(IEnumMediaTypes** pp)
{
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
//wodbgstream os;
//os << "mkvsplit::pin[" << m_id << "]::EnumMediaTypes" << endl;
return m_preferred_mtv.CreateEnum(this, pp);
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:14,代码来源:vp8decoderpin.cpp
示例18: QueryInternalConnections
HRESULT Inpin::QueryInternalConnections(
IPin** pa,
ULONG* pn)
{
if (pn == 0)
return E_POINTER;
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
const ULONG m = 1; //number of output pins
ULONG& n = *pn;
if (n == 0)
{
if (pa == 0) //query for required number
{
n = m;
return S_OK;
}
return S_FALSE; //means "insufficient number of array elements"
}
if (n < m)
{
n = 0;
return S_FALSE; //means "insufficient number of array elements"
}
if (pa == 0)
{
n = 0;
return E_POINTER;
}
IPin*& pin = pa[0];
pin = &m_pFilter->m_outpin;
pin->AddRef();
n = m;
return S_OK;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:49,代码来源:vp8decoderinpin.cpp
示例19: ReceiveCanBlock
HRESULT Inpin::ReceiveCanBlock()
{
Filter::Lock lock;
const HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return S_OK; //?
if (IMemInputPin* pPin = m_pFilter->m_outpin.m_pInputPin)
{
lock.Release();
return pPin->ReceiveCanBlock();
}
return S_FALSE;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:17,代码来源:vp8decoderinpin.cpp
示例20: ReceiveConnection
HRESULT Inpin::ReceiveConnection(
IPin* pin,
const AM_MEDIA_TYPE* pmt)
{
if (pin == 0)
return E_INVALIDARG;
if (pmt == 0)
return E_INVALIDARG;
Filter::Lock lock;
HRESULT hr = lock.Seize(m_pFilter);
if (FAILED(hr))
return hr;
if (m_pFilter->m_state != State_Stopped)
return VFW_E_NOT_STOPPED;
if (bool(m_pPinConnection))
return VFW_E_ALREADY_CONNECTED;
m_connection_mtv.Clear();
hr = QueryAccept(pmt);
if (hr != S_OK)
return VFW_E_TYPE_NOT_ACCEPTED;
const AM_MEDIA_TYPE& mt = *pmt;
hr = m_connection_mtv.Add(mt);
if (FAILED(hr))
return hr;
m_pPinConnection = pin;
//TODO: init decompressor here?
m_pFilter->m_outpin.OnInpinConnect(mt);
return S_OK;
}
开发者ID:kazutomi,项目名称:xiphqt,代码行数:45,代码来源:vp8decoderinpin.cpp
注:本文中的filter::Lock类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论