AdaptationSet::~AdaptationSet ()
{
vlc_delete_all( this->representations );
+ childs.clear();
}
const std::string& AdaptationSet::getMimeType() const
void AdaptationSet::addRepresentation (Representation *rep)
{
this->representations.push_back(rep);
+ childs.push_back(rep);
}
Period::~Period ()
{
vlc_delete_all( this->adaptationSets );
+ childs.clear();
}
const std::vector<AdaptationSet*>& Period::getAdaptationSets() const
void Period::addAdaptationSet(AdaptationSet *adaptationSet)
{
if ( adaptationSet != NULL )
+ {
this->adaptationSets.push_back(adaptationSet);
+ childs.push_back(adaptationSet);
+ }
}
AdaptationSet * Period::getAdaptationSet(Streams::Type type) const
return time;
}
+void SegmentInformation::collectTimelines(std::vector<SegmentTimeline *> *timelines) const
+{
+ if(mediaSegmentTemplate && mediaSegmentTemplate->segmentTimeline.Get())
+ timelines->push_back(mediaSegmentTemplate->segmentTimeline.Get());
+
+ std::vector<SegmentInformation *>::const_iterator it;
+ for(it = childs.begin(); it != childs.end(); it++)
+ (*it)->collectTimelines(timelines);
+}
+
bool SegmentInformation::canBitswitch() const
{
if(bitswitch_policy == BITSWITCH_INHERIT)
class SegmentBase;
class SegmentList;
class SegmentTemplate;
+ class SegmentTimeline;
/* common segment elements for period/adaptset/rep 5.3.9.1,
* with properties inheritance */
ISegment * getSegment(SegmentInfoType, uint64_t = 0) const;
bool getSegmentNumberByTime(mtime_t, uint64_t *) const;
mtime_t getPlaybackTimeBySegmentNumber(uint64_t) const;
+ void collectTimelines(std::vector<SegmentTimeline *> *) const;
protected:
std::vector<ISegment *> getSegments() const;
std::vector<ISegment *> getSegments(SegmentInfoType) const;
+ std::vector<SegmentInformation *> childs;
private:
void setSegmentList(SegmentList *);