[vlc-commits] dash: Only use const Segments.

Hugo Beauzée-Luyssen git at videolan.org
Tue Jan 24 23:21:58 CET 2012


vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Dec 30 15:06:43 2011 +0100| [4468816d11570e7a5b8e01afb128d1e7b15381df] | committer: Jean-Baptiste Kempf

dash: Only use const Segments.

Everything after the parsing step should be used as a const instance, as
the MPD tree is read only.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 6347005a9f86d2b546cc47dc17d02f4ab2780e85)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=4468816d11570e7a5b8e01afb128d1e7b15381df
---

 .../adaptationlogic/AlwaysBestAdaptationLogic.cpp  |    2 +-
 .../adaptationlogic/AlwaysBestAdaptationLogic.h    |    2 +-
 .../adaptationlogic/RateBasedAdaptationLogic.cpp   |    2 +-
 modules/stream_filter/dash/mpd/BasicCMManager.cpp  |    8 ++++----
 modules/stream_filter/dash/mpd/BasicCMManager.h    |    2 +-
 modules/stream_filter/dash/mpd/IMPDManager.h       |    2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
index 8265538..9996489 100644
--- a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.cpp
@@ -75,7 +75,7 @@ void    AlwaysBestAdaptationLogic::initSchedule ()
 
             if(best != NULL)
             {
-                std::vector<Segment *> segments = this->mpdManager->getSegments(best);
+                std::vector<const Segment *> segments = this->mpdManager->getSegments(best);
                 for(size_t j = 0; j < segments.size(); j++)
                 {
                     this->schedule.push_back(segments.at(j));
diff --git a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
index a0ba0e2..49f7a98 100644
--- a/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
+++ b/modules/stream_filter/dash/adaptationlogic/AlwaysBestAdaptationLogic.h
@@ -48,7 +48,7 @@ namespace dash
                 dash::http::Chunk* getNextChunk () throw(dash::exception::EOFException);
 
             private:
-                std::vector<dash::mpd::Segment *>  schedule;
+                std::vector<const mpd::Segment *>   schedule;
                 dash::mpd::IMPDManager              *mpdManager;
                 size_t                              count;
 
diff --git a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
index 78a9bdf..dbf4cba 100644
--- a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
@@ -56,7 +56,7 @@ Chunk*  RateBasedAdaptationLogic::getNextChunk () throw(EOFException)
     if(rep == NULL)
         throw EOFException();
 
-    std::vector<Segment *> segments = this->mpdManager->getSegments(rep);
+    std::vector<const Segment *> segments = this->mpdManager->getSegments(rep);
 
     if(this->count == segments.size())
     {
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.cpp b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
index 830c49a..e8b3167 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
@@ -40,11 +40,11 @@ BasicCMManager::~BasicCMManager ()
     delete this->mpd;
 }
 
-std::vector<Segment*>  BasicCMManager::getSegments             (Representation *rep)
+std::vector<const Segment*>  BasicCMManager::getSegments( Representation *rep )
 {
-    std::vector<Segment *>  retSegments;
-    SegmentInfo*            info = rep->getSegmentInfo();
-    Segment*                initSegment = info->getInitSegment();
+    std::vector<const Segment *>    retSegments;
+    SegmentInfo*                    info = rep->getSegmentInfo();
+    const Segment*                  initSegment = info->getInitialisationSegment();
 
     if ( initSegment )
         retSegments.push_back( initSegment );
diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.h b/modules/stream_filter/dash/mpd/BasicCMManager.h
index c13e51e..f38da3c 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.h
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.h
@@ -51,7 +51,7 @@ namespace dash
                 Period*                         getFirstPeriod();
                 Period*                         getNextPeriod( Period *period );
                 Representation*                 getBestRepresentation( Period *period );
-                std::vector<Segment *>          getSegments( Representation *rep );
+                std::vector<const Segment *>    getSegments( Representation *rep );
                 Representation*                 getRepresentation( Period *period, long bitrate );
                 const MPD*                      getMPD() const;
 
diff --git a/modules/stream_filter/dash/mpd/IMPDManager.h b/modules/stream_filter/dash/mpd/IMPDManager.h
index 6bf16a7..16494d7 100644
--- a/modules/stream_filter/dash/mpd/IMPDManager.h
+++ b/modules/stream_filter/dash/mpd/IMPDManager.h
@@ -31,7 +31,7 @@ namespace dash
                 virtual Period*                 getFirstPeriod          ()                              = 0;
                 virtual Period*                 getNextPeriod           (Period *period)                = 0;
                 virtual Representation*         getBestRepresentation   (Period *period)                = 0;
-                virtual std::vector<Segment *> getSegments             (Representation *rep)           = 0;
+                virtual std::vector<const Segment *> getSegments        (Representation *rep)           = 0;
                 virtual Representation*         getRepresentation       (Period *period, long bitrate)  = 0;
                 virtual const MPD*              getMPD                  () const = 0;
                 virtual ~IMPDManager(){}



More information about the vlc-commits mailing list