Commit 85ed6b99 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Rémi Denis-Courmont

dash: Avoid some copies.

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent df975712
......@@ -50,33 +50,36 @@ MPD::~MPD ()
delete(this->programInfo);
}
std::vector<Period*> MPD::getPeriods ()
const std::vector<Period*>& MPD::getPeriods () const
{
return this->periods;
}
std::vector<BaseUrl*> MPD::getBaseUrls ()
const std::vector<BaseUrl*>& MPD::getBaseUrls () const
{
return this->baseUrls;
}
std::string MPD::getMinBufferTime () throw(AttributeNotPresentException)
const std::string& MPD::getMinBufferTime () const throw(AttributeNotPresentException)
{
AttributesMap::iterator it = this->attributes.find("minBufferTime");
AttributesMap::const_iterator it = this->attributes.find("minBufferTime");
if( it == this->attributes.end())
throw AttributeNotPresentException();
return it->second;
}
std::string MPD::getType () throw(AttributeNotPresentException)
const std::string& MPD::getType () const throw(AttributeNotPresentException)
{
AttributesMap::iterator it = this->attributes.find( "type" );
AttributesMap::const_iterator it = this->attributes.find( "type" );
if( it == this->attributes.end() )
throw AttributeNotPresentException();
return it->second;
}
std::string MPD::getDuration () throw(AttributeNotPresentException)
const std::string& MPD::getDuration () const throw(AttributeNotPresentException)
{
AttributesMap::iterator it = this->attributes.find("mediaPresentationDuration");
AttributesMap::const_iterator it = this->attributes.find("mediaPresentationDuration");
if( it == this->attributes.end())
throw AttributeNotPresentException();
......
......@@ -48,11 +48,11 @@ namespace dash
MPD ();
virtual ~MPD();
std::string getType () throw(dash::exception::AttributeNotPresentException);
std::string getDuration () throw(dash::exception::AttributeNotPresentException);
std::string getMinBufferTime () throw(dash::exception::AttributeNotPresentException);
std::vector<BaseUrl *> getBaseUrls ();
std::vector<Period *> getPeriods ();
const std::string& getType () const throw(dash::exception::AttributeNotPresentException);
const std::string& getDuration () const throw(dash::exception::AttributeNotPresentException);
const std::string& getMinBufferTime () const throw(dash::exception::AttributeNotPresentException);
const std::vector<BaseUrl *>& getBaseUrls () const;
const std::vector<Period *>& getPeriods () const;
ProgramInformation* getProgramInformation () throw(dash::exception::ElementNotPresentException);
void addPeriod (Period *period);
......
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