Commit 6347005a authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f565072b
......@@ -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));
......
......@@ -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;
......
......@@ -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())
{
......
......@@ -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;
std::vector<const Segment *> retSegments;
SegmentInfo* info = rep->getSegmentInfo();
Segment* initSegment = info->getInitSegment();
const Segment* initSegment = info->getInitialisationSegment();
if ( initSegment )
retSegments.push_back( initSegment );
......
......@@ -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;
......
......@@ -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(){}
......
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