Commit 2a852751 authored by François Cartegnie's avatar François Cartegnie 🤞

stream_filter: dash: remove vlc object ref from adaptationlogic

parent 3a60ec4b
......@@ -62,7 +62,7 @@ bool DASHManager::start()
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;
......
......@@ -31,16 +31,15 @@ using namespace dash::logic;
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 ()
{
}
......
......@@ -43,7 +43,7 @@ namespace dash
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);
......@@ -59,7 +59,6 @@ namespace dash
private:
int bpsAvg;
long bpsLastChunk;
stream_t *stream;
mtime_t bufferedMicroSec;
int bufferedPercent;
};
......
......@@ -32,12 +32,12 @@ using namespace dash::xml;
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:
......
......@@ -40,7 +40,7 @@ namespace dash
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);
};
}
}
......
......@@ -32,8 +32,8 @@ using namespace dash::xml;
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();
......
......@@ -41,7 +41,7 @@ namespace dash
class AlwaysBestAdaptationLogic : public AbstractAdaptationLogic
{
public:
AlwaysBestAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream);
AlwaysBestAdaptationLogic (dash::mpd::MPDManager *mpdManager);
virtual ~AlwaysBestAdaptationLogic ();
dash::http::Chunk* getNextChunk();
......
......@@ -28,18 +28,21 @@
#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()
......
......@@ -30,9 +30,6 @@
#include "mpd/MPDManager.hpp"
#include "http/Chunk.h"
#include <vlc_common.h>
#include <vlc_stream.h>
#define MINBUFFER 30
namespace dash
......@@ -42,7 +39,7 @@ 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment