Commit 2a852751 authored by Francois Cartegnie's avatar Francois Cartegnie

stream_filter: dash: remove vlc object ref from adaptationlogic

parent 3a60ec4b
...@@ -62,7 +62,7 @@ bool DASHManager::start() ...@@ -62,7 +62,7 @@ bool DASHManager::start()
if ( this->mpdManager == NULL ) if ( this->mpdManager == NULL )
return false; return false;
this->adaptationLogic = AdaptationLogicFactory::create( this->logicType, this->mpdManager, this->stream); adaptationLogic = AdaptationLogicFactory::create( logicType, mpdManager );
if ( this->adaptationLogic == NULL ) if ( this->adaptationLogic == NULL )
return false; return false;
......
...@@ -31,16 +31,15 @@ using namespace dash::logic; ...@@ -31,16 +31,15 @@ using namespace dash::logic;
using namespace dash::xml; using namespace dash::xml;
using namespace dash::mpd; using namespace dash::mpd;
AbstractAdaptationLogic::AbstractAdaptationLogic (MPDManager *mpdManager, stream_t *stream) : AbstractAdaptationLogic::AbstractAdaptationLogic (MPDManager *mpdManager) :
mpdManager (mpdManager), mpdManager (mpdManager),
bpsAvg (0), bpsAvg (0),
bpsLastChunk (0), bpsLastChunk (0),
stream (stream),
bufferedMicroSec (0), bufferedMicroSec (0),
bufferedPercent (0) bufferedPercent (0)
{ {
} }
AbstractAdaptationLogic::~AbstractAdaptationLogic () AbstractAdaptationLogic::~AbstractAdaptationLogic ()
{ {
} }
......
...@@ -43,7 +43,7 @@ namespace dash ...@@ -43,7 +43,7 @@ namespace dash
class AbstractAdaptationLogic : public IAdaptationLogic class AbstractAdaptationLogic : public IAdaptationLogic
{ {
public: public:
AbstractAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream); AbstractAdaptationLogic (dash::mpd::MPDManager *mpdManager);
virtual ~AbstractAdaptationLogic (); virtual ~AbstractAdaptationLogic ();
virtual void downloadRateChanged (uint64_t bpsAvg, uint64_t bpsLastChunk); virtual void downloadRateChanged (uint64_t bpsAvg, uint64_t bpsLastChunk);
...@@ -59,7 +59,6 @@ namespace dash ...@@ -59,7 +59,6 @@ namespace dash
private: private:
int bpsAvg; int bpsAvg;
long bpsLastChunk; long bpsLastChunk;
stream_t *stream;
mtime_t bufferedMicroSec; mtime_t bufferedMicroSec;
int bufferedPercent; int bufferedPercent;
}; };
......
...@@ -32,12 +32,12 @@ using namespace dash::xml; ...@@ -32,12 +32,12 @@ using namespace dash::xml;
using namespace dash::mpd; using namespace dash::mpd;
IAdaptationLogic* AdaptationLogicFactory::create ( IAdaptationLogic::LogicType logic, IAdaptationLogic* AdaptationLogicFactory::create ( IAdaptationLogic::LogicType logic,
MPDManager *mpdManager, stream_t *stream) MPDManager *mpdManager)
{ {
switch(logic) switch(logic)
{ {
case IAdaptationLogic::AlwaysBest: return new AlwaysBestAdaptationLogic (mpdManager, stream); case IAdaptationLogic::AlwaysBest: return new AlwaysBestAdaptationLogic (mpdManager);
case IAdaptationLogic::RateBased: return new RateBasedAdaptationLogic (mpdManager, stream); case IAdaptationLogic::RateBased: return new RateBasedAdaptationLogic (mpdManager);
case IAdaptationLogic::Default: case IAdaptationLogic::Default:
case IAdaptationLogic::AlwaysLowest: case IAdaptationLogic::AlwaysLowest:
default: default:
......
...@@ -40,7 +40,7 @@ namespace dash ...@@ -40,7 +40,7 @@ namespace dash
class AdaptationLogicFactory class AdaptationLogicFactory
{ {
public: 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; ...@@ -32,8 +32,8 @@ using namespace dash::xml;
using namespace dash::http; using namespace dash::http;
using namespace dash::mpd; using namespace dash::mpd;
AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic (MPDManager *mpdManager, stream_t *stream) : AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic (MPDManager *mpdManager) :
AbstractAdaptationLogic (mpdManager, stream) AbstractAdaptationLogic (mpdManager)
{ {
this->count = 0; this->count = 0;
this->initSchedule(); this->initSchedule();
......
...@@ -41,7 +41,7 @@ namespace dash ...@@ -41,7 +41,7 @@ namespace dash
class AlwaysBestAdaptationLogic : public AbstractAdaptationLogic class AlwaysBestAdaptationLogic : public AbstractAdaptationLogic
{ {
public: public:
AlwaysBestAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream); AlwaysBestAdaptationLogic (dash::mpd::MPDManager *mpdManager);
virtual ~AlwaysBestAdaptationLogic (); virtual ~AlwaysBestAdaptationLogic ();
dash::http::Chunk* getNextChunk(); dash::http::Chunk* getNextChunk();
......
...@@ -28,18 +28,21 @@ ...@@ -28,18 +28,21 @@
#include "RateBasedAdaptationLogic.h" #include "RateBasedAdaptationLogic.h"
#include "Representationselectors.hpp" #include "Representationselectors.hpp"
#include <vlc_common.h>
#include <vlc_variables.h>
using namespace dash::logic; using namespace dash::logic;
using namespace dash::xml; using namespace dash::xml;
using namespace dash::http; using namespace dash::http;
using namespace dash::mpd; using namespace dash::mpd;
RateBasedAdaptationLogic::RateBasedAdaptationLogic (MPDManager *mpdManager, stream_t *stream) : RateBasedAdaptationLogic::RateBasedAdaptationLogic (MPDManager *mpdManager) :
AbstractAdaptationLogic (mpdManager, stream), AbstractAdaptationLogic (mpdManager),
count (0), count (0),
currentPeriod (mpdManager->getFirstPeriod()) currentPeriod (mpdManager->getFirstPeriod())
{ {
width = var_InheritInteger(stream, "dash-prefwidth"); width = var_InheritInteger(mpdManager->getMPD()->getVLCObject(), "dash-prefwidth");
height = var_InheritInteger(stream, "dash-prefheight"); height = var_InheritInteger(mpdManager->getMPD()->getVLCObject(), "dash-prefheight");
} }
Chunk* RateBasedAdaptationLogic::getNextChunk() Chunk* RateBasedAdaptationLogic::getNextChunk()
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
#include "mpd/MPDManager.hpp" #include "mpd/MPDManager.hpp"
#include "http/Chunk.h" #include "http/Chunk.h"
#include <vlc_common.h>
#include <vlc_stream.h>
#define MINBUFFER 30 #define MINBUFFER 30
namespace dash namespace dash
...@@ -42,7 +39,7 @@ namespace dash ...@@ -42,7 +39,7 @@ namespace dash
class RateBasedAdaptationLogic : public AbstractAdaptationLogic class RateBasedAdaptationLogic : public AbstractAdaptationLogic
{ {
public: public:
RateBasedAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream); RateBasedAdaptationLogic (dash::mpd::MPDManager *mpdManager);
dash::http::Chunk* getNextChunk(); dash::http::Chunk* getNextChunk();
const dash::mpd::Representation *getCurrentRepresentation() const; 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