Commit 08bf5c8d authored by Francois Cartegnie's avatar Francois Cartegnie

demux: dash: add timescale inheritance to timeline

parent 8c6bf181
......@@ -353,12 +353,12 @@ void IsoffMainParser::parseInitSegment(Node *initNode, Initializable<Segment> *i
init->initialisationSegment.Set(seg);
}
void IsoffMainParser::parseTimeline(Node *node, Timelineable *timelineable)
void IsoffMainParser::parseTimeline(Node *node, MediaSegmentTemplate *templ)
{
if(!node)
return;
SegmentTimeline *timeline = new (std::nothrow) SegmentTimeline();
SegmentTimeline *timeline = new (std::nothrow) SegmentTimeline(templ);
if(timeline)
{
std::vector<Node *> elements = DOMHelper::getElementByTagName(node, "S", false);
......@@ -379,7 +379,7 @@ void IsoffMainParser::parseTimeline(Node *node, Timelineable *timelineable)
}
else timeline->addElement(d, r);
timelineable->segmentTimeline.Set(timeline);
templ->segmentTimeline.Set(timeline);
}
}
}
......
......@@ -54,7 +54,7 @@ namespace dash
void setAdaptationSets (dash::xml::Node *periodNode, Period *period);
void setRepresentations (dash::xml::Node *adaptationSetNode, AdaptationSet *adaptationSet);
void parseInitSegment (dash::xml::Node *, Initializable<Segment> *);
void parseTimeline (dash::xml::Node *, Timelineable *);
void parseTimeline (dash::xml::Node *, MediaSegmentTemplate *);
void parsePeriods (dash::xml::Node *);
size_t parseSegmentInformation(dash::xml::Node *, SegmentInformation *);
void parseSegmentBase (dash::xml::Node *, SegmentInformation *);
......
......@@ -29,7 +29,8 @@
using namespace dash::mpd;
SegmentTimeline::SegmentTimeline()
SegmentTimeline::SegmentTimeline(TimescaleAble *parent)
:TimescaleAble(parent)
{
pruned = 0;
}
......@@ -108,8 +109,9 @@ mtime_t SegmentTimeline::getScaledPlaybackTimeByElementNumber(uint64_t number) c
return totalscaledtime;
}
size_t SegmentTimeline::prune(mtime_t scaled)
size_t SegmentTimeline::prune(mtime_t time)
{
mtime_t scaled = time * inheritTimescale() / CLOCK_FREQ;
size_t prunednow = 0;
while(elements.size())
{
......
......@@ -24,6 +24,7 @@
#ifndef SEGMENTTIMELINE_H
#define SEGMENTTIMELINE_H
#include "SegmentInfoCommon.h"
#include <vlc_common.h>
#include <list>
......@@ -31,12 +32,12 @@ namespace dash
{
namespace mpd
{
class SegmentTimeline
class SegmentTimeline : public TimescaleAble
{
class Element;
public:
SegmentTimeline();
SegmentTimeline(TimescaleAble * = NULL);
virtual ~SegmentTimeline();
void addElement(mtime_t d, uint64_t r = 0, mtime_t t = 0);
uint64_t getElementNumberByScaledPlaybackTime(time_t) const;
......
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