return NULL;
}
+void MPD::getTimeLinesBoundaries(mtime_t *min, mtime_t *max) const
+{
+ *min = *max = 0;
+ for(size_t i = 0; i < periods.size(); i++)
+ {
+ std::vector<SegmentTimeline *> timelines;
+ periods.at(i)->collectTimelines(&timelines);
+
+ for(size_t j = 0; j < timelines.size(); j++)
+ {
+ const SegmentTimeline *timeline = timelines.at(j);
+ if(timeline->start() > *min)
+ *min = timeline->start();
+ if(!*max || timeline->end() < *max)
+ *max = timeline->end();
+ }
+ }
+}
+
void MPD::mergeWith(MPD *updatedMPD)
{
availabilityEndTime.Set(updatedMPD->availabilityEndTime.Get());
virtual Period* getNextPeriod(Period *period);
void mergeWith(MPD *);
+ void getTimeLinesBoundaries(mtime_t *, mtime_t *) const;
Property<time_t> duration;
Property<time_t> playbackStart;
}
}
+mtime_t SegmentTimeline::start() const
+{
+ if(elements.empty())
+ return 0;
+ return CLOCK_FREQ * elements.front()->t / inheritTimescale();
+}
+
+mtime_t SegmentTimeline::end() const
+{
+ if(elements.empty())
+ return 0;
+ const Element *last = elements.back();
+ mtime_t scaled = last->t + last->d * (last->r + 1);
+ return CLOCK_FREQ * scaled / inheritTimescale();
+}
+
SegmentTimeline::Element::Element(mtime_t d_, uint64_t r_, mtime_t t_)
{
d = d_;
mtime_t getScaledPlaybackTimeByElementNumber(uint64_t) const;
size_t prune(mtime_t);
void mergeWith(SegmentTimeline &);
+ mtime_t start() const;
+ mtime_t end() const;
private:
std::list<Element *> elements;