Commit ea61bf32 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

dash: Rework profile handling.

Profile was parsed twice.
parent 907c5042
...@@ -75,12 +75,6 @@ bool BasicCMParser::setMPD() ...@@ -75,12 +75,6 @@ bool BasicCMParser::setMPD()
this->mpd = new MPD; this->mpd = new MPD;
std::map<std::string, std::string>::const_iterator it; std::map<std::string, std::string>::const_iterator it;
it = attr.find( "profile" );
if ( it == attr.end() )
it = attr.find( "profiles" ); //The standard spells it the two ways...
if ( it != attr.end() )
this->mpd->setProfile( it->second );
it = attr.find("mediaPresentationDuration"); it = attr.find("mediaPresentationDuration");
/* /*
Standard specifies a default of "On-Demand", Standard specifies a default of "On-Demand",
......
...@@ -62,10 +62,6 @@ void IsoffMainParser::setMPDAttributes () ...@@ -62,10 +62,6 @@ void IsoffMainParser::setMPDAttributes ()
std::map<std::string, std::string>::const_iterator it; std::map<std::string, std::string>::const_iterator it;
it = attr.find("profiles");
if(it != attr.end())
this->mpd->setProfile(it->second);
it = attr.find("mediaPresentationDuration"); it = attr.find("mediaPresentationDuration");
if(it != attr.end()) if(it != attr.end())
this->mpd->setDuration(str_duration(it->second.c_str())); this->mpd->setDuration(str_duration(it->second.c_str()));
......
...@@ -167,15 +167,3 @@ void MPD::setProfile(Profile profile) ...@@ -167,15 +167,3 @@ void MPD::setProfile(Profile profile)
{ {
this->profile = profile; this->profile = profile;
} }
void MPD::setProfile( const std::string &strProfile )
{
if( strProfile == "urn:mpeg:mpegB:profile:dash:isoff-basic-on-demand:cm" )
this->profile = dash::mpd::BasicCM;
else if ( strProfile == "urn:mpeg:mpegB:profile:dash:full:2011" )
this->profile = dash::mpd::Full2011;
else if ( strProfile == "urn:mpeg:dash:profile:isoff-main:2011" )
this->profile = dash::mpd::IsoffMain;
else
this->profile = dash::mpd::UnknownProfile;
}
...@@ -45,7 +45,6 @@ namespace dash ...@@ -45,7 +45,6 @@ namespace dash
virtual ~MPD(); virtual ~MPD();
Profile getProfile() const; Profile getProfile() const;
void setProfile( const std::string &strProfile );
void setProfile( Profile profile ); void setProfile( Profile profile );
bool isLive() const; bool isLive() const;
void setLive( bool live ); void setLive( bool live );
......
...@@ -49,7 +49,7 @@ MPD* MPDFactory::createBasicCMMPD (dash::xml::Node *root, stream_t *p_stream) ...@@ -49,7 +49,7 @@ MPD* MPDFactory::createBasicCMMPD (dash::xml::Node *root, stream_t *p_stream)
if(mpdParser.parse() == false || mpdParser.getMPD() == NULL) if(mpdParser.parse() == false || mpdParser.getMPD() == NULL)
return NULL; return NULL;
mpdParser.getMPD()->setProfile( dash::mpd::BasicCM );
return mpdParser.getMPD(); return mpdParser.getMPD();
} }
MPD* MPDFactory::createIsoffMainMPD (dash::xml::Node *root, stream_t *p_stream) MPD* MPDFactory::createIsoffMainMPD (dash::xml::Node *root, stream_t *p_stream)
...@@ -58,6 +58,6 @@ MPD* MPDFactory::createIsoffMainMPD (dash::xml::Node *root, stream_t *p_stream) ...@@ -58,6 +58,6 @@ MPD* MPDFactory::createIsoffMainMPD (dash::xml::Node *root, stream_t *p_stream)
if(mpdParser.parse() == false || mpdParser.getMPD() == NULL) if(mpdParser.parse() == false || mpdParser.getMPD() == NULL)
return NULL; return NULL;
mpdParser.getMPD()->setProfile( dash::mpd::IsoffMain );
return mpdParser.getMPD(); return mpdParser.getMPD();
} }
...@@ -157,7 +157,9 @@ Profile DOMParser::getProfile () ...@@ -157,7 +157,9 @@ Profile DOMParser::getProfile ()
if(this->root == NULL) if(this->root == NULL)
return dash::mpd::UnknownProfile; return dash::mpd::UnknownProfile;
const std::string profile = this->root->getAttributeValue("profiles"); std::string profile = this->root->getAttributeValue("profiles");
if ( profile.length() == 0 )
profile = this->root->getAttributeValue("profile"); //The standard spells it the both ways...
if(profile.find("urn:mpeg:mpegB:profile:dash:isoff-basic-on-demand:cm") != std::string::npos || if(profile.find("urn:mpeg:mpegB:profile:dash:isoff-basic-on-demand:cm") != std::string::npos ||
profile.find("urn:mpeg:dash:profile:isoff-ondemand:2011") != std::string::npos || profile.find("urn:mpeg:dash:profile:isoff-ondemand:2011") != std::string::npos ||
......
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