Commit 4603cb4a authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptative: inherit playlist

parent d3ba198c
......@@ -35,12 +35,13 @@
using namespace adaptative::playlist;
BasePeriod::BasePeriod(AbstractPlaylist *playlist) :
SegmentInformation( playlist )
BasePeriod::BasePeriod(AbstractPlaylist *playlist_) :
SegmentInformation( playlist_ )
{
duration.Set(0);
startTime.Set(0);
baseUrl.Set(NULL);
playlist = playlist_;
}
BasePeriod::~BasePeriod ()
......@@ -50,6 +51,11 @@ BasePeriod::~BasePeriod ()
childs.clear();
}
AbstractPlaylist *BasePeriod::getPlaylist() const
{
return playlist;
}
const std::vector<BaseAdaptationSet*>& BasePeriod::getAdaptationSets() const
{
return adaptationSets;
......
......@@ -48,12 +48,14 @@ namespace adaptative
void debug (vlc_object_t *,int = 0) const;
virtual mtime_t getPeriodStart() const; /* reimpl */
virtual AbstractPlaylist *getPlaylist() const; /* reimpl */
Property<mtime_t> duration;
Property<mtime_t> startTime;
private:
std::vector<BaseAdaptationSet *> adaptationSets;
AbstractPlaylist *playlist;
};
}
}
......
......@@ -33,9 +33,8 @@
using namespace adaptative::playlist;
BaseRepresentation::BaseRepresentation( BaseAdaptationSet *set, AbstractPlaylist *playlist_ ) :
BaseRepresentation::BaseRepresentation( BaseAdaptationSet *set ) :
SegmentInformation( set ),
playlist ( playlist_ ),
adaptationSet ( set ),
bandwidth (0)
{
......@@ -66,11 +65,6 @@ void BaseRepresentation::debug(vlc_object_t *obj, int indent) const
(*l)->debug(obj, indent + 1);
}
AbstractPlaylist * BaseRepresentation::getPlaylist() const
{
return playlist;
}
std::string BaseRepresentation::contextualize(size_t, const std::string &component,
const BaseSegmentTemplate *) const
{
......
......@@ -42,7 +42,7 @@ namespace adaptative
public SegmentInformation
{
public:
BaseRepresentation( BaseAdaptationSet *, AbstractPlaylist *playlist );
BaseRepresentation( BaseAdaptationSet * );
virtual ~BaseRepresentation ();
/*
......@@ -54,8 +54,6 @@ namespace adaptative
uint64_t getBandwidth () const;
void setBandwidth ( uint64_t bandwidth );
AbstractPlaylist* getPlaylist () const;
void debug (vlc_object_t *,int = 0) const;
/* for segment templates */
......@@ -63,7 +61,6 @@ namespace adaptative
const BaseSegmentTemplate *) const;
protected:
AbstractPlaylist *playlist;
BaseAdaptationSet *adaptationSet;
uint64_t bandwidth;
};
......
......@@ -61,6 +61,14 @@ SegmentInformation::~SegmentInformation()
delete mediaSegmentTemplate;
}
AbstractPlaylist * SegmentInformation::getPlaylist() const
{
if(parent)
return parent->getPlaylist();
else
return NULL;
}
vector<ISegment *> SegmentInformation::getSegments(SegmentInfoType type) const
{
vector<ISegment *> retSegments;
......
......@@ -56,6 +56,7 @@ namespace adaptative
virtual ~SegmentInformation();
bool canBitswitch() const;
virtual mtime_t getPeriodStart() const;
virtual AbstractPlaylist *getPlaylist() const;
class SplitPoint
{
......@@ -82,6 +83,7 @@ namespace adaptative
std::vector<ISegment *> getSegments() const;
std::vector<ISegment *> getSegments(SegmentInfoType) const;
std::vector<SegmentInformation *> childs;
SegmentInformation *parent;
public:
void setSegmentList(SegmentList *);
......@@ -97,7 +99,6 @@ namespace adaptative
SegmentList * inheritSegmentList() const;
MediaSegmentTemplate * inheritSegmentTemplate() const;
SegmentInformation *parent;
SegmentBase *segmentBase;
SegmentList *segmentList;
MediaSegmentTemplate *mediaSegmentTemplate;
......
......@@ -228,7 +228,7 @@ void IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
for(size_t i = 0; i < representations.size(); i++)
{
Representation *currentRepresentation = new Representation(adaptationSet, getMPD());
Representation *currentRepresentation = new Representation(adaptationSet);
Node *repNode = representations.at(i);
std::vector<Node *> baseUrls = DOMHelper::getChildElementByTagName(repNode, "BaseURL");
......
......@@ -36,9 +36,8 @@
using namespace dash::mpd;
Representation::Representation ( AdaptationSet *set, MPD *mpd_ ) :
BaseRepresentation( set, mpd_ ),
mpd ( mpd_ ),
Representation::Representation ( AdaptationSet *set ) :
BaseRepresentation( set ),
qualityRanking ( -1 ),
trickModeType ( NULL )
{
......
......@@ -44,7 +44,7 @@ namespace dash
public UniqueNess<Representation>
{
public:
Representation( AdaptationSet *, MPD *mpd );
Representation( AdaptationSet * );
virtual ~Representation ();
int getQualityRanking () const;
......@@ -65,7 +65,6 @@ namespace dash
const BaseSegmentTemplate *) const; // reimpl
private:
MPD *mpd;
int qualityRanking;
std::list<const Representation*> dependencies;
TrickModeType *trickModeType;
......
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