как работает bufferedPercent

2 вопроса:

1- Я пытаюсь понять Логика адаптации на основе тарифов код (полный код cpp внизу), и я не совсем понимаю, что getBufferedPercent функция возвращает.

2- Есть ли место, где я могу найти надлежащую документацию об этом типе функций?

вот код RateBasedAdaptationLogic.cpp:

    #ifdef HAVE_CONFIG_H
# include "config.h"#endif

#include "RateBasedAdaptationLogic.h"
using namespace dash::logic;
using namespace dash::xml;
using namespace dash::http;
using namespace dash::mpd;

RateBasedAdaptationLogic::RateBasedAdaptationLogic  (IMPDManager *mpdManager, stream_t *stream) :
AbstractAdaptationLogic   (mpdManager, stream),
mpdManager                (mpdManager),
count                     (0),
currentPeriod             (mpdManager->getFirstPeriod()),
width                     (0),
height                    (0)
{
this->width  = var_InheritInteger(stream, "dash-prefwidth");
this->height = var_InheritInteger(stream, "dash-prefheight");
}

Chunk*  RateBasedAdaptationLogic::getNextChunk()
{
if(this->mpdManager == NULL)
return NULL;

if(this->currentPeriod == NULL)
return NULL;

uint64_t bitrate = this->getBpsAvg();

if(this->getBufferPercent() < MINBUFFER)
bitrate = 0;

Representation *rep = this->mpdManager->getRepresentation(this->currentPeriod, bitrate, this->width, this->height);

if ( rep == NULL )
return NULL;

std::vector<Segment *> segments = this->mpdManager->getSegments(rep);

if ( this->count == segments.size() )
{
this->currentPeriod = this->mpdManager->getNextPeriod(this->currentPeriod);
this->count = 0;
return this->getNextChunk();
}

if ( segments.size() > this->count )
{
Segment *seg = segments.at( this->count );
Chunk *chunk = seg->toChunk();
//In case of UrlTemplate, we must stay on the same segment.
if ( seg->isSingleShot() == true )
this->count++;
seg->done();
chunk->setCalculatedBW(this->getBpsAvg());
return chunk;
}
return NULL;
}

const Representation *RateBasedAdaptationLogic::getCurrentRepresentation() const
{
return this->mpdManager->getRepresentation( this->currentPeriod, this->getBpsAvg() );
}

0

Решение

Ваш вопрос о коде из проекта videolan. Код, который вы вставили на веб-сервере videolan.

Страница разработчиков видеолана говорит, что у них есть канал IRC (irc: //irc.videolan.org/videolan) и списки рассылки где вы можете задать вопросы.

Я рекомендую вам еще немного прочитать код в Модуль DASH stream_filter, особенно буферный каталог (который вычисляет процент буферизованного файла, о котором вы спрашиваете), а затем задайте конкретный вопрос в IRC или в списке рассылки.

К сожалению, этот код не имеет комментариев или документации. Если нормальные каналы не помогают, вы можете спросить авторов. Они были достаточно любезны, чтобы включить адреса электронной почты в уведомление об авторских правах в верхней части файла.

1

Другие решения

Других решений пока нет …