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

dash: Handling Group @subsegmentAlignmentFlag in parser.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4abd4469
......@@ -149,12 +149,16 @@ void BasicCMParser::setGroups (Node *root, Period *period)
for(size_t i = 0; i < groups.size(); i++)
{
Group *group = new Group(groups.at(i)->getAttributes());
const std::map<std::string, std::string> attr = groups.at(i)->getAttributes();
Group *group = new Group();
if ( this->parseCommonAttributesElements( groups.at( i ), group, NULL ) == false )
{
delete group;
continue ;
}
std::map<std::string, std::string>::const_iterator it = attr.find( "subsegmentAlignmentFlag" );
if ( it != attr.end() && it->second == "true" )
group->setSubsegmentAlignmentFlag( true ); //Otherwise it is false by default.
this->setRepresentations(groups.at(i), group);
period->addGroup(group);
}
......
......@@ -30,8 +30,8 @@
using namespace dash::mpd;
using namespace dash::exception;
Group::Group ( const std::map<std::string, std::string>& attributes) :
attributes( attributes )
Group::Group() :
subsegmentAlignmentFlag( false )
{
}
......@@ -40,12 +40,14 @@ Group::~Group ()
vlc_delete_all( this->representations );
}
std::string Group::getSubSegmentAlignment () throw(AttributeNotPresentException)
bool Group::getSubsegmentAlignmentFlag() const
{
if(this->attributes.find("subsegmentAlignmentFlag") == this->attributes.end())
throw AttributeNotPresentException();
return this->subsegmentAlignmentFlag;
}
return this->attributes["subsegmentAlignmentFlag"];
void Group::setSubsegmentAlignmentFlag(bool alignment)
{
this->subsegmentAlignmentFlag = alignment;
}
std::vector<Representation*> Group::getRepresentations ()
......
......@@ -40,17 +40,18 @@ namespace dash
class Group : public CommonAttributesElements
{
public:
Group (const std::map<std::string, std::string>& attributes);
virtual ~Group ();
Group();
virtual ~Group();
std::string getSubSegmentAlignment () throw(dash::exception::AttributeNotPresentException);
bool getSubsegmentAlignmentFlag() const;
void setSubsegmentAlignmentFlag( bool alignment );
std::vector<Representation *> getRepresentations ();
const Representation* getRepresentationById ( const std::string &id ) const;
void addRepresentation (Representation *rep);
void addRepresentation( Representation *rep );
private:
std::map<std::string, std::string> attributes;
bool subsegmentAlignmentFlag;
std::vector<Representation *> representations;
};
}
......
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