Commit bc77d458 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

dash: Store the parent Group in every representations.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f4816ca7
...@@ -287,7 +287,8 @@ void BasicCMParser::setRepresentations (Node *root, Group *group) ...@@ -287,7 +287,8 @@ void BasicCMParser::setRepresentations (Node *root, Group *group)
{ {
const std::map<std::string, std::string> attributes = representations.at(i)->getAttributes(); const std::map<std::string, std::string> attributes = representations.at(i)->getAttributes();
Representation *rep = new Representation( attributes ); Representation *rep = new Representation;
rep->setParentGroup( group );
if ( this->parseCommonAttributesElements( representations.at( i ), rep, group ) == false ) if ( this->parseCommonAttributesElements( representations.at( i ), rep, group ) == false )
{ {
delete rep; delete rep;
......
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
using namespace dash::mpd; using namespace dash::mpd;
Representation::Representation (const std::map<std::string, std::string>& attributes) : Representation::Representation() :
qualityRanking( -1 ), qualityRanking( -1 ),
attributes( attributes ),
segmentInfo( NULL ), segmentInfo( NULL ),
trickModeType( NULL ) trickModeType( NULL ),
parentGroup( NULL )
{ {
} }
...@@ -82,6 +82,17 @@ void Representation::setTrickMode (TrickModeType *trickMod ...@@ -82,6 +82,17 @@ void Representation::setTrickMode (TrickModeType *trickMod
this->trickModeType = trickModeType; this->trickModeType = trickModeType;
} }
const Group *Representation::getParentGroup() const
{
return this->parentGroup;
}
void Representation::setParentGroup(const Group *group)
{
if ( group != NULL )
this->parentGroup = group;
}
void Representation::setSegmentInfo (SegmentInfo *info) void Representation::setSegmentInfo (SegmentInfo *info)
{ {
this->segmentInfo = info; this->segmentInfo = info;
......
...@@ -35,10 +35,12 @@ namespace dash ...@@ -35,10 +35,12 @@ namespace dash
{ {
namespace mpd namespace mpd
{ {
class Group;
class Representation : public CommonAttributesElements class Representation : public CommonAttributesElements
{ {
public: public:
Representation ( const std::map<std::string, std::string>& attributes); Representation();
virtual ~Representation (); virtual ~Representation ();
const std::string& getId () const; const std::string& getId () const;
...@@ -65,14 +67,17 @@ namespace dash ...@@ -65,14 +67,17 @@ namespace dash
void setSegmentInfo( SegmentInfo *info ); void setSegmentInfo( SegmentInfo *info );
void setTrickMode( TrickModeType *trickModeType ); void setTrickMode( TrickModeType *trickModeType );
const Group* getParentGroup() const;
void setParentGroup( const Group *group );
private: private:
int bandwidth; int bandwidth;
std::string id; int qualityRanking; std::string id;
int qualityRanking;
std::list<const Representation*> dependencies; std::list<const Representation*> dependencies;
std::map<std::string, std::string> attributes;
SegmentInfo *segmentInfo; SegmentInfo *segmentInfo;
TrickModeType *trickModeType; TrickModeType *trickModeType;
const Group *parentGroup;
}; };
} }
} }
......
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