if ( this->mpdManager == NULL )
return false;
- this->adaptationLogic = AdaptationLogicFactory::create( this->logicType, this->mpdManager, this->stream);
+ adaptationLogic = AdaptationLogicFactory::create( logicType, mpdManager );
if ( this->adaptationLogic == NULL )
return false;
using namespace dash::xml;
using namespace dash::mpd;
-AbstractAdaptationLogic::AbstractAdaptationLogic (MPDManager *mpdManager, stream_t *stream) :
+AbstractAdaptationLogic::AbstractAdaptationLogic (MPDManager *mpdManager) :
mpdManager (mpdManager),
bpsAvg (0),
bpsLastChunk (0),
- stream (stream),
bufferedMicroSec (0),
bufferedPercent (0)
-
{
}
+
AbstractAdaptationLogic::~AbstractAdaptationLogic ()
{
}
class AbstractAdaptationLogic : public IAdaptationLogic
{
public:
- AbstractAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream);
+ AbstractAdaptationLogic (dash::mpd::MPDManager *mpdManager);
virtual ~AbstractAdaptationLogic ();
virtual void downloadRateChanged (uint64_t bpsAvg, uint64_t bpsLastChunk);
private:
int bpsAvg;
long bpsLastChunk;
- stream_t *stream;
mtime_t bufferedMicroSec;
int bufferedPercent;
};
using namespace dash::mpd;
IAdaptationLogic* AdaptationLogicFactory::create ( IAdaptationLogic::LogicType logic,
- MPDManager *mpdManager, stream_t *stream)
+ MPDManager *mpdManager)
{
switch(logic)
{
- case IAdaptationLogic::AlwaysBest: return new AlwaysBestAdaptationLogic (mpdManager, stream);
- case IAdaptationLogic::RateBased: return new RateBasedAdaptationLogic (mpdManager, stream);
+ case IAdaptationLogic::AlwaysBest: return new AlwaysBestAdaptationLogic (mpdManager);
+ case IAdaptationLogic::RateBased: return new RateBasedAdaptationLogic (mpdManager);
case IAdaptationLogic::Default:
case IAdaptationLogic::AlwaysLowest:
default:
class AdaptationLogicFactory
{
public:
- static IAdaptationLogic* create (IAdaptationLogic::LogicType logic, dash::mpd::MPDManager *mpdManager, stream_t *stream);
+ static IAdaptationLogic* create (IAdaptationLogic::LogicType logic, dash::mpd::MPDManager *mpdManager);
};
}
}
using namespace dash::http;
using namespace dash::mpd;
-AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic (MPDManager *mpdManager, stream_t *stream) :
- AbstractAdaptationLogic (mpdManager, stream)
+AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic (MPDManager *mpdManager) :
+ AbstractAdaptationLogic (mpdManager)
{
this->count = 0;
this->initSchedule();
class AlwaysBestAdaptationLogic : public AbstractAdaptationLogic
{
public:
- AlwaysBestAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream);
+ AlwaysBestAdaptationLogic (dash::mpd::MPDManager *mpdManager);
virtual ~AlwaysBestAdaptationLogic ();
dash::http::Chunk* getNextChunk();
#include "RateBasedAdaptationLogic.h"
#include "Representationselectors.hpp"
+#include <vlc_common.h>
+#include <vlc_variables.h>
+
using namespace dash::logic;
using namespace dash::xml;
using namespace dash::http;
using namespace dash::mpd;
-RateBasedAdaptationLogic::RateBasedAdaptationLogic (MPDManager *mpdManager, stream_t *stream) :
- AbstractAdaptationLogic (mpdManager, stream),
+RateBasedAdaptationLogic::RateBasedAdaptationLogic (MPDManager *mpdManager) :
+ AbstractAdaptationLogic (mpdManager),
count (0),
currentPeriod (mpdManager->getFirstPeriod())
{
- width = var_InheritInteger(stream, "dash-prefwidth");
- height = var_InheritInteger(stream, "dash-prefheight");
+ width = var_InheritInteger(mpdManager->getMPD()->getVLCObject(), "dash-prefwidth");
+ height = var_InheritInteger(mpdManager->getMPD()->getVLCObject(), "dash-prefheight");
}
Chunk* RateBasedAdaptationLogic::getNextChunk()
#include "mpd/MPDManager.hpp"
#include "http/Chunk.h"
-#include <vlc_common.h>
-#include <vlc_stream.h>
-
#define MINBUFFER 30
namespace dash
class RateBasedAdaptationLogic : public AbstractAdaptationLogic
{
public:
- RateBasedAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream);
+ RateBasedAdaptationLogic (dash::mpd::MPDManager *mpdManager);
dash::http::Chunk* getNextChunk();
const dash::mpd::Representation *getCurrentRepresentation() const;