当前位置: 首页>>代码示例>>C++>>正文


C++ CGolombBuffer::GetBufferPos方法代码示例

本文整理汇总了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;
}
开发者ID:finalpatch,项目名称:mpc-hc,代码行数:29,代码来源:DVBSub.cpp

示例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;
}
开发者ID:chichalito,项目名称:mpc-hc,代码行数:36,代码来源:DVBSub.cpp


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