0

2 つの質問:

1-レート ベースの適応ロジックgetBufferedPercentコード (完全な cpp コードは一番下にあります) を理解しようとしていますが、関数が返すものをよく理解できません。

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() );
}
4

1 に答える 1

1

あなたの質問は、videolan プロジェクトのコードに関するものです。貼り付けたコードは、videolan Web サーバーにあります

videolan 開発者ページには、IRC チャンネル (irc://irc.videolan.org/videolan) と、質問できるメーリング リストがあると書かれています。

DASH の stream_filter モジュール、特にバッファー ディレクトリ (あなたが求めているバッファーの割合を計算します)のコードをもう少し読んでから、IRC またはメーリング リストで特定の質問をすることをお勧めします。

残念ながら、このコードにはコメントやドキュメントがないようです。通常のチャネルが役に立たない場合は、作成者に尋ねることができます。彼らは親切にも、ファイルの上部にある著作権表示に電子メール アドレスを含めてくれました。

于 2013-11-25T06:31:12.823 に答える