本文整理汇总了C++中filter::Lock类的典型用法代码示例。如果您正苦于以下问题:C++ Lock类的具体用法?C++ Lock怎么用?C++ Lock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Lock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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; //?
}
示例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;
}