]> git.sesse.net Git - vlc/commitdiff
stream_filter: dash: add classId to segments
authorFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 28 Nov 2014 16:55:43 +0000 (17:55 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 18 Dec 2014 20:23:50 +0000 (21:23 +0100)
modules/stream_filter/dash/mpd/Segment.cpp
modules/stream_filter/dash/mpd/Segment.h

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