]> git.sesse.net Git - vlc/commitdiff
stream_filter: dash: add segment duration
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 11 Dec 2014 20:41:04 +0000 (21:41 +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 c6b53cdedee884686483aa3e03e9cbab3c3799c8..2ece6dc619e04b4ec56b36f0fea74e18860b613c 100644 (file)
@@ -41,7 +41,8 @@ ISegment::ISegment(const ICanonicalUrl *parent):
     ICanonicalUrl( parent ),
     startByte  (0),
     endByte    (0),
-    startTime  (VLC_TS_INVALID)
+    startTime  (VLC_TS_INVALID),
+    duration   (0)
 {
     debugName = "Segment";
     classId = CLASSID_ISEGMENT;
@@ -100,6 +101,16 @@ mtime_t ISegment::getStartTime() const
     return startTime;
 }
 
+mtime_t ISegment::getDuration() const
+{
+    return duration;
+}
+
+void ISegment::setDuration(mtime_t d)
+{
+    duration = d;
+}
+
 size_t ISegment::getOffset() const
 {
     return startByte;
index 52bce3467484178e4951ec1f3a72283f676328f4..164a3e704ddb67a5b50539d766c164ab412d8ac6 100644 (file)
@@ -55,6 +55,8 @@ namespace dash
                 virtual void                            setByteRange    (size_t start, size_t end);
                 virtual void                            setStartTime    (mtime_t ztime);
                 virtual mtime_t                         getStartTime    () const;
+                virtual mtime_t                         getDuration     () const;
+                virtual void                            setDuration     (mtime_t);
                 virtual size_t                          getOffset       () const;
                 virtual std::vector<ISegment*>          subSegments     () = 0;
                 virtual std::string                     toString        () const;
@@ -70,6 +72,7 @@ namespace dash
                 mtime_t                 startTime;
                 std::string             debugName;
                 int                     classId;
+                mtime_t                 duration;
 
                 class SegmentChunk : public dash::http::Chunk
                 {