本文整理汇总了C++中CGolombBuffer::GetBufferPos方法的典型用法代码示例。如果您正苦于以下问题:C++ CGolombBuffer::GetBufferPos方法的具体用法?C++ CGolombBuffer::GetBufferPos怎么用?C++ CGolombBuffer::GetBufferPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGolombBuffer
的用法示例。
在下文中一共展示了CGolombBuffer::GetBufferPos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseObject
HRESULT CDVBSub::ParseObject(CGolombBuffer& gb, WORD wSegLength)
{
HRESULT hr = E_FAIL;
if (m_pCurrentPage && wSegLength > 2) {
CompositionObject* pObject = DNew CompositionObject();
BYTE object_coding_method;
pObject->m_object_id_ref = gb.ReadShort();
pObject->m_version_number = (BYTE)gb.BitRead(4);
object_coding_method = (BYTE)gb.BitRead(2); // object_coding_method
gb.BitRead(1); // non_modifying_colour_flag
gb.BitRead(1); // reserved
if (object_coding_method == 0x00) {
pObject->SetRLEData(gb.GetBufferPos(), wSegLength - 3, wSegLength - 3);
gb.SkipBytes(wSegLength - 3);
m_pCurrentPage->Objects.AddTail(pObject);
hr = S_OK;
} else {
delete pObject;
hr = E_NOTIMPL;
}
}
return hr;
}
示例2: ParseObject
HRESULT CDVBSub::ParseObject(CGolombBuffer& gb, WORD wSegLength)
{
HRESULT hr = E_POINTER;
if (m_pCurrentPage) {
size_t nExpectedSize = 3;
size_t nEnd = gb.GetPos() + wSegLength;
short id = gb.ReadShort();
POSITION posObject = FindObject(m_pCurrentPage, id);
if (!posObject) {
posObject = m_pCurrentPage->objects.AddTail(CAutoPtr<CompositionObject>(DEBUG_NEW CompositionObject()));
}
const auto& pObject = m_pCurrentPage->objects.GetAt(posObject);
pObject->m_object_id_ref = id;
pObject->m_version_number = (BYTE)gb.BitRead(4);
BYTE object_coding_method = (BYTE)gb.BitRead(2); // object_coding_method
gb.BitRead(1); // non_modifying_colour_flag
gb.BitRead(1); // reserved
if (object_coding_method == 0x00) {
pObject->SetRLEData(gb.GetBufferPos(), wSegLength - nExpectedSize, wSegLength - nExpectedSize);
gb.SkipBytes(wSegLength - 3);
hr = (wSegLength >= nExpectedSize) ? S_OK : E_UNEXPECTED;
} else {
TRACE_DVB(_T("DVB - Text subtitles are currently not supported\n"));
m_pCurrentPage->objects.RemoveTail();
hr = E_NOTIMPL;
}
}
return hr;
}