Commit 98b674d7 authored by Francois Cartegnie's avatar Francois Cartegnie

stream_filter: dash: add classId to segments

parent 88537655
...@@ -41,6 +41,7 @@ ISegment::ISegment(const ICanonicalUrl *parent): ...@@ -41,6 +41,7 @@ ISegment::ISegment(const ICanonicalUrl *parent):
endByte (0) endByte (0)
{ {
debugName = "Segment"; debugName = "Segment";
classId = CLASSID_ISEGMENT;
} }
dash::http::Chunk * ISegment::getChunk() dash::http::Chunk * ISegment::getChunk()
...@@ -89,6 +90,11 @@ std::string ISegment::toString() const ...@@ -89,6 +90,11 @@ std::string ISegment::toString() const
return ss.str(); return ss.str();
} }
int ISegment::getClassId() const
{
return classId;
}
ISegment::SegmentChunk::SegmentChunk(ISegment *segment_) : ISegment::SegmentChunk::SegmentChunk(ISegment *segment_) :
dash::http::Chunk() dash::http::Chunk()
{ {
...@@ -109,6 +115,7 @@ Segment::Segment(Representation *parent) : ...@@ -109,6 +115,7 @@ Segment::Segment(Representation *parent) :
this->size = parent->getBandwidth() * parent->getSegmentInfo()->getDuration(); this->size = parent->getBandwidth() * parent->getSegmentInfo()->getDuration();
else else
this->size = -1; this->size = -1;
classId = CLASSID_SEGMENT;
} }
Segment::~Segment() Segment::~Segment()
...@@ -184,12 +191,14 @@ InitSegment::InitSegment(Representation *parent) : ...@@ -184,12 +191,14 @@ InitSegment::InitSegment(Representation *parent) :
Segment(parent) Segment(parent)
{ {
debugName = "InitSegment"; debugName = "InitSegment";
classId = CLASSID_INITSEGMENT;
} }
IndexSegment::IndexSegment(Representation *parent) : IndexSegment::IndexSegment(Representation *parent) :
Segment(parent) Segment(parent)
{ {
debugName = "IndexSegment"; debugName = "IndexSegment";
classId = CLASSID_INDEXSEGMENT;
} }
dash::http::Chunk * IndexSegment::getChunk() dash::http::Chunk * IndexSegment::getChunk()
...@@ -212,6 +221,7 @@ SubSegment::SubSegment(Segment *main, size_t start, size_t end) : ...@@ -212,6 +221,7 @@ SubSegment::SubSegment(Segment *main, size_t start, size_t end) :
{ {
setByteRange(start, end); setByteRange(start, end);
debugName = "SubSegment"; debugName = "SubSegment";
classId = CLASSID_SUBSEGMENT;
} }
std::string SubSegment::getUrlSegment() const std::string SubSegment::getUrlSegment() const
......
...@@ -56,11 +56,15 @@ namespace dash ...@@ -56,11 +56,15 @@ namespace dash
virtual std::vector<ISegment*> subSegments () = 0; virtual std::vector<ISegment*> subSegments () = 0;
virtual std::string toString () const; virtual std::string toString () const;
virtual Representation* getRepresentation() const = 0; virtual Representation* getRepresentation() const = 0;
int getClassId () const;
static const int CLASSID_ISEGMENT = 0;
protected: protected:
size_t startByte; size_t startByte;
size_t endByte; size_t endByte;
std::string debugName; std::string debugName;
int classId;
class SegmentChunk : public dash::http::Chunk class SegmentChunk : public dash::http::Chunk
{ {
...@@ -85,6 +89,7 @@ namespace dash ...@@ -85,6 +89,7 @@ namespace dash
virtual dash::http::Chunk* toChunk(); virtual dash::http::Chunk* toChunk();
virtual std::vector<ISegment*> subSegments(); virtual std::vector<ISegment*> subSegments();
virtual Representation* getRepresentation() const; virtual Representation* getRepresentation() const;
static const int CLASSID_SEGMENT = 1;
protected: protected:
Representation* parentRepresentation; Representation* parentRepresentation;
...@@ -97,12 +102,14 @@ namespace dash ...@@ -97,12 +102,14 @@ namespace dash
{ {
public: public:
InitSegment( Representation *parent ); InitSegment( Representation *parent );
static const int CLASSID_INITSEGMENT = 2;
}; };
class IndexSegment : public Segment class IndexSegment : public Segment
{ {
public: public:
IndexSegment( Representation *parent ); IndexSegment( Representation *parent );
static const int CLASSID_INDEXSEGMENT = 3;
protected: protected:
class IndexSegmentChunk : public SegmentChunk class IndexSegmentChunk : public SegmentChunk
...@@ -122,6 +129,7 @@ namespace dash ...@@ -122,6 +129,7 @@ namespace dash
virtual std::string getUrlSegment() const; /* impl */ virtual std::string getUrlSegment() const; /* impl */
virtual std::vector<ISegment*> subSegments(); virtual std::vector<ISegment*> subSegments();
virtual Representation* getRepresentation() const; virtual Representation* getRepresentation() const;
static const int CLASSID_SUBSEGMENT = 4;
private: private:
Segment *parent; Segment *parent;
}; };
......
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