Commit ea06a8cd authored by Francois Cartegnie's avatar Francois Cartegnie

demux: dash: add UniqueNess template

parent df82d1c3
......@@ -53,17 +53,6 @@ Representation::~Representation ()
delete baseUrl;
}
const std::string& Representation::getId () const
{
return this->id;
}
void Representation::setId(const std::string &id)
{
if ( id.empty() == false )
this->id = id;
}
uint64_t Representation::getBandwidth () const
{
return this->bandwidth;
......
......@@ -42,14 +42,13 @@ namespace dash
class MPD;
class Representation : public CommonAttributesElements,
public SegmentInformation
public SegmentInformation,
public UniqueNess<Representation>
{
public:
Representation( AdaptationSet *, MPD *mpd );
virtual ~Representation ();
const std::string& getId () const;
void setId ( const std::string &id );
/*
* @return The bitrate required for this representation
* in bits per seconds.
......@@ -85,7 +84,6 @@ namespace dash
MPD *mpd;
AdaptationSet *adaptationSet;
uint64_t bandwidth;
std::string id;
int qualityRanking;
std::list<const Representation*> dependencies;
TrickModeType *trickModeType;
......
......@@ -60,6 +60,21 @@ namespace dash
Property<SegmentTimeline *> segmentTimeline;
};
template<class T> class UniqueNess
{
public:
UniqueNess(){}
~UniqueNess() {}
void setId(const std::string &id_) {id = id_;}
const std::string & getId() const {return id;}
bool sameAs(const T &other) const
{
return (!id.empty() && id == other.id);
}
private:
std::string id;
};
class SegmentInfoCommon : public ICanonicalUrl,
public Initializable<Segment>
{
......
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