[vlc-commits] stream_filter: dash: remove vlc object ref from adaptationlogic

Francois Cartegnie git at videolan.org
Thu Dec 18 22:39:51 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 27 11:39:54 2014 +0100| [2a852751744231104cee5a981fd69d7acdeab201] | committer: Francois Cartegnie

stream_filter: dash: remove vlc object ref from adaptationlogic

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a852751744231104cee5a981fd69d7acdeab201
---

 modules/stream_filter/dash/DASHManager.cpp                  |    2 +-
 .../dash/adaptationlogic/AbstractAdaptationLogic.cpp        |    5 ++---
 .../dash/adaptationlogic/AbstractAdaptationLogic.h          |    3 +--
 .../dash/adaptationlogic/AdaptationLogicFactory.cpp         |    6 +++---
 .../dash/adaptationlogic/AdaptationLogicFactory.h           |    2 +-
 .../dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp      |    4 ++--
 .../dash/adaptationlogic/AlwaysBestAdaptationLogic.h        |    2 +-
 .../dash/adaptationlogic/RateBasedAdaptationLogic.cpp       |   11 +++++++----
 .../dash/adaptationlogic/RateBasedAdaptationLogic.h         |    5 +----
 9 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp b/modules/stream_filter/dash/DASHManager.cpp
index 6172caa..7cedefb 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -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;
diff --git a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
index 410726c..afd884a 100644
--- a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
@@ -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   ()
 {
 }
diff --git a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
index 2b647fd..28a9fd5 100644
--- a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
+++ b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
@@ -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;
         };
diff --git a/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp b/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
index 578aacb..7733960 100644
--- a/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.cpp
@@ -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:
diff --git a/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h b/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h
index a7d9143..4f17f8a 100644
--- a/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h
+++ b/modules/stream_filter/dash/adaptationlogic/AdaptationLogicFactory.h
@@ -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);
         };
     }
 }
diff --git a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
index 562e488..94002c1 100644
--- a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
@@ -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();
diff --git a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
index e4c3223..4520656 100644
--- a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
+++ b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
@@ -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();
diff --git a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
index b55eb7c..bc5618c 100644
--- a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
@@ -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()
diff --git a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
index c1d1306..7094d65 100644
--- a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
+++ b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
@@ -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;



More information about the vlc-commits mailing list