Commit ea06a8cd authored by Francois Cartegnie's avatar Francois Cartegnie

demux: dash: add UniqueNess template

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