Live profile can be replayed as static after broadcast.
Standard specifies a default of "On-Demand",
so anything that is not "Live" is "On-Demand"
*/
- this->mpd->setLive( it != attr.end() && it->second == "Live" );
+
it = attr.find( "availabilityStartTime" );
if ( it == attr.end() && this->mpd->isLive() == true )
{
if(it != attr.end())
this->mpd->setMinBufferTime(str_duration( it->second.c_str()));
+ it = attr.find("type");
+ if(it != attr.end())
+ mpd->setType(it->second);
}
void IsoffMainParser::setAdaptationSets (Node *periodNode, Period *period)
ICanonicalUrl(),
stream(stream_),
profile( profile_ ),
- live( false ),
availabilityStartTime( -1 ),
availabilityEndTime( -1 ),
duration( -1 ),
bool MPD::isLive() const
{
- return this->live;
+ if(type.empty())
+ {
+ Profile live(Profile::ISOLive);
+ return profile == live;
+ }
+ else
+ return (type != "static");
}
-void MPD::setLive( bool live )
+void MPD::setType(const std::string &type_)
{
- this->live = live;
+ type = type_;
}
time_t MPD::getAvailabilityStartTime() const
Profile getProfile() const;
bool isLive() const;
- void setLive( bool live );
time_t getAvailabilityStartTime() const;
void setAvailabilityStartTime( time_t time );
time_t getAvailabilityEndTime() const;
void setAvailabilityEndTime( time_t time );
+ void setType(const std::string &);
time_t getDuration() const;
void setDuration( time_t duration );
time_t getMinUpdatePeriod() const;
private:
stream_t *stream;
Profile profile;
- bool live;
time_t availabilityStartTime;
time_t availabilityEndTime;
time_t duration;
std::vector<Period *> periods;
std::vector<BaseUrl *> baseUrls;
ProgramInformation *programInfo;
+ std::string type;
};
}
}