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

dash: Basic CM parser: Parse some Representation attributes

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 967fdaa4
...@@ -106,6 +106,30 @@ void BasicCMParser::setRepresentations (Node *root, Group *group) ...@@ -106,6 +106,30 @@ void BasicCMParser::setRepresentations (Node *root, Group *group)
delete rep; delete rep;
continue ; continue ;
} }
std::map<std::string, std::string>::const_iterator it;
it = attributes.find( "id" );
if ( it == attributes.end() )
{
std::cerr << "Missing mandatory attribute for Representation: @id" << std::endl;
delete rep;
continue ;
}
rep->setId( it->second );
it = attributes.find( "bandwidth" );
if ( it == attributes.end() )
{
std::cerr << "Missing mandatory attribute for Representation: @bandwidth" << std::endl;
delete rep;
continue ;
}
rep->setBandwidth( atoi( it->second.c_str() ) );
it = attributes.find( "qualityRanking" );
if ( it != attributes.end() )
rep->setQualityRanking( atoi( it->second.c_str() ) );
this->setSegmentInfo(representations.at(i), rep); this->setSegmentInfo(representations.at(i), rep);
if ( rep->getSegmentInfo() && rep->getSegmentInfo()->getSegments().size() > 0 ) if ( rep->getSegmentInfo() && rep->getSegmentInfo()->getSegments().size() > 0 )
group->addRepresentation(rep); group->addRepresentation(rep);
......
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