vlc | branch: master | Francois Cartegnie <fcvlc...@free.fr> | Tue May 12 00:18:08 2015 +0200| [f6f45bce06c80a79e43dae3411d7e184e1f9b791] | committer: Francois Cartegnie
demux: adaptative: split segments using interface > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f6f45bce06c80a79e43dae3411d7e184e1f9b791 --- modules/demux/adaptative/playlist/Segment.cpp | 7 ++++++- modules/demux/adaptative/playlist/Segment.h | 6 ++++-- modules/demux/adaptative/playlist/SegmentInformation.cpp | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/demux/adaptative/playlist/Segment.cpp b/modules/demux/adaptative/playlist/Segment.cpp index e6acd87..0cd0b82 100644 --- a/modules/demux/adaptative/playlist/Segment.cpp +++ b/modules/demux/adaptative/playlist/Segment.cpp @@ -215,7 +215,7 @@ IndexSegment::IndexSegment(ICanonicalUrl *parent) : classId = CLASSID_INDEXSEGMENT; } -SubSegment::SubSegment(Segment *main, size_t start, size_t end) : +SubSegment::SubSegment(ISegment *main, size_t start, size_t end) : ISegment(main), parent(main) { setByteRange(start, end); @@ -234,3 +234,8 @@ std::vector<ISegment*> SubSegment::subSegments() list.push_back(this); return list; } + +void SubSegment::addSubSegment(SubSegment *) +{ + +} diff --git a/modules/demux/adaptative/playlist/Segment.h b/modules/demux/adaptative/playlist/Segment.h index 20d0bb7..bd16ec2 100644 --- a/modules/demux/adaptative/playlist/Segment.h +++ b/modules/demux/adaptative/playlist/Segment.h @@ -55,6 +55,7 @@ namespace adaptative virtual void setByteRange (size_t start, size_t end); virtual size_t getOffset () const; virtual std::vector<ISegment*> subSegments () = 0; + virtual void addSubSegment (SubSegment *) = 0; virtual std::string toString (int = 0) const; virtual bool contains (size_t byte) const; int getClassId () const; @@ -121,12 +122,13 @@ namespace adaptative class SubSegment : public ISegment { public: - SubSegment(Segment *, size_t start, size_t end); + SubSegment(ISegment *, size_t start, size_t end); virtual Url getUrlSegment() const; /* impl */ virtual std::vector<ISegment*> subSegments(); + virtual void addSubSegment(SubSegment *); static const int CLASSID_SUBSEGMENT = 4; private: - Segment *parent; + ISegment *parent; }; } } diff --git a/modules/demux/adaptative/playlist/SegmentInformation.cpp b/modules/demux/adaptative/playlist/SegmentInformation.cpp index 350d460..5a50112 100644 --- a/modules/demux/adaptative/playlist/SegmentInformation.cpp +++ b/modules/demux/adaptative/playlist/SegmentInformation.cpp @@ -267,13 +267,13 @@ void SegmentInformation::setSegmentTemplate(MediaSegmentTemplate *templ) mediaSegmentTemplate = templ; } -static void insertIntoSegment(std::vector<Segment *> &seglist, size_t start, +static void insertIntoSegment(std::vector<ISegment *> &seglist, size_t start, size_t end, mtime_t time) { - std::vector<Segment *>::iterator segIt; + std::vector<ISegment *>::iterator segIt; for(segIt = seglist.begin(); segIt < seglist.end(); ++segIt) { - Segment *segment = *segIt; + ISegment *segment = *segIt; if(segment->getClassId() == Segment::CLASSID_SEGMENT && segment->contains(end + segment->getOffset())) { @@ -289,7 +289,7 @@ static void insertIntoSegment(std::vector<Segment *> &seglist, size_t start, void SegmentInformation::SplitUsingIndex(std::vector<SplitPoint> &splitlist) { - std::vector<Segment *> seglist = segmentList->getSegments(); + std::vector<ISegment *> seglist = getSegments(INFOTYPE_MEDIA); std::vector<SplitPoint>::const_iterator splitIt; size_t start = 0, end = 0; mtime_t time = 0; _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits