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


C++ ISegment::getSequenceNumber方法代码示例

本文整理汇总了C++中ISegment::getSequenceNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ ISegment::getSequenceNumber方法的具体用法?C++ ISegment::getSequenceNumber怎么用?C++ ISegment::getSequenceNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISegment的用法示例。


在下文中一共展示了ISegment::getSequenceNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getSegments

ISegment * SegmentInformation::getSegment(SegmentInfoType type, uint64_t pos) const
{
    std::vector<ISegment *> retSegments;
    const size_t size = getSegments( type, retSegments );
    if( size )
    {
        if(size == 1 && retSegments[0]->isTemplate())
        {
            MediaSegmentTemplate *templ = dynamic_cast<MediaSegmentTemplate*>(retSegments[0]);
            if(!templ || templ->segmentTimeline.Get() == NULL ||
               templ->segmentTimeline.Get()->maxElementNumber() > pos)
                return templ;
        }
        else
        {
            std::vector<ISegment *>::const_iterator it;
            for(it = retSegments.begin(); it != retSegments.end(); ++it)
            {
                ISegment *seg = *it;
                if(seg->getSequenceNumber() >= pos)
                {
                    if(seg->getSequenceNumber() == pos)
                        return seg;
                    else
                        return NULL;
                }
            }
        }
    }

    return NULL;
}
开发者ID:n2i911,项目名称:vlc-with-fec,代码行数:32,代码来源:SegmentInformation.cpp

示例2: if

ISegment * SegmentList::getSegmentByNumber(uint64_t number)
{
    std::vector<ISegment *>::const_iterator it = segments.begin();
    for(it = segments.begin(); it != segments.end(); ++it)
    {
        ISegment *seg = *it;
        if(seg->getSequenceNumber() == number)
        {
            return seg;
        }
        else if (seg->getSequenceNumber() > number)
        {
            break;
        }
    }
    return NULL;
}
开发者ID:IAPark,项目名称:vlc,代码行数:17,代码来源:SegmentList.cpp

示例3: if

/* Returns wanted segment, or next in sequence if not found */
ISegment * SegmentInformation::getNextSegment(SegmentInfoType type, uint64_t i_pos,
                                              uint64_t *pi_newpos, bool *pb_gap) const
{
    *pb_gap = false;
    *pi_newpos = i_pos;
    if( type != INFOTYPE_MEDIA )
        return NULL;

    std::vector<ISegment *> retSegments;
    const size_t size = getSegments( type, retSegments );
    if( size )
    {
        std::vector<ISegment *>::const_iterator it;
        for(it = retSegments.begin(); it != retSegments.end(); ++it)
        {
            ISegment *seg = *it;
            if(seg->isTemplate()) /* we don't care about seq number */
            {
                /* Check if we don't exceed timeline */
                MediaSegmentTemplate *templ = dynamic_cast<MediaSegmentTemplate*>(retSegments[0]);
                SegmentTimeline *timeline = (templ) ? templ->segmentTimeline.Get() : NULL;
                if(timeline)
                {
                    *pi_newpos = std::max(timeline->minElementNumber(), i_pos);
                    if(timeline->maxElementNumber() < i_pos)
                        return NULL;
                }
                else
                {
                    *pi_newpos = i_pos;
                    /* start number */
                    *pi_newpos = std::max((uint64_t)templ->startNumber.Get(), i_pos);
                }
                return seg;
            }
            else if(seg->getSequenceNumber() >= i_pos)
            {
                *pi_newpos = seg->getSequenceNumber();
                *pb_gap = (*pi_newpos != i_pos);
                return seg;
            }
        }
    }

    return NULL;
}
开发者ID:anutakay,项目名称:vlc-for-krasview,代码行数:47,代码来源:SegmentInformation.cpp

示例4: pruneBySegmentNumber

void SegmentList::pruneBySegmentNumber(uint64_t tobelownum)
{
    std::vector<ISegment *>::iterator it = segments.begin();
    while(it != segments.end())
    {
        ISegment *seg = *it;

        if(seg->getSequenceNumber() >= tobelownum)
            break;

        if(seg->chunksuse.Get()) /* can't prune from here, still in use */
            break;

        delete *it;
        it = segments.erase(it);
    }
}
开发者ID:IAPark,项目名称:vlc,代码行数:17,代码来源:SegmentList.cpp


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