]> git.sesse.net Git - vlc/commitdiff
stream_filter: dash: remove vlc object ref from adaptationlogic
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 27 Nov 2014 10:39:54 +0000 (11:39 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 18 Dec 2014 20:23:50 +0000 (21:23 +0100)
modules/stream_filter/dash/DASHManager.cpp
modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h
modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h

index 6172caaf60cb7200154490ad64acf2514dc717f0..7cedefb159b0b5ee3a3077360dc293094a108068 100644 (file)
@@ -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;
index 410726c46ac1d01fe690734a13a2eec9dd881edc..afd884a3e71a4a5bad2dcfb354bb56c222cbd2f6 100644 (file)
@@ -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   ()
 {
 }
index 2b647fd8d69e04c0dd1a32e5e2eede3907c1b0fa..28a9fd5f74a7082a4c98958dfad8e1018d76d16e 100644 (file)
@@ -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;
         };
index 578aacbd16d7f49be8782cfd0ebd96b64093901d..7733960414ef82f51d0071baf3f6affeb695f9a3 100644 (file)
@@ -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:
index a7d9143429749623148fea1834ddb388c862da4b..4f17f8ab3432cc5e6a1485b91d82491802b27441 100644 (file)
@@ -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);
         };
     }
 }
index 562e48813fd32f1a4b93fa297443b8e7e238a635..94002c1c25f95fe446de81256273a15488bfb4df 100644 (file)
@@ -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();
index e4c322304d0077f0151ee1cb589a94407944e2bc..4520656293347ccb71d2c8f9b2878560e098cb8f 100644 (file)
@@ -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();
index b55eb7ccc32cb83a690426b52d7dc01190c410f4..bc5618c1a856770782bf9d2d4808bc2973aff522 100644 (file)
 #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()
index c1d130685f4a7cb43655076abfbded6921ec8da5..7094d656014e7baece3788cfc94b16fc8d1493a0 100644 (file)
@@ -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;