Commit 4603cb4a authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: inherit playlist

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