[vlc-commits] stream_filter: dash: add segment duration

Francois Cartegnie git at videolan.org
Thu Dec 18 22:39:54 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 11 21:41:04 2014 +0100| [070ce589076458ce7966795debb628d0876e7285] | committer: Francois Cartegnie

stream_filter: dash: add segment duration

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=070ce589076458ce7966795debb628d0876e7285
---

 modules/stream_filter/dash/mpd/Segment.cpp |   13 ++++++++++++-
 modules/stream_filter/dash/mpd/Segment.h   |    3 +++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/modules/stream_filter/dash/mpd/Segment.cpp b/modules/stream_filter/dash/mpd/Segment.cpp
index c6b53cd..2ece6dc 100644
--- a/modules/stream_filter/dash/mpd/Segment.cpp
+++ b/modules/stream_filter/dash/mpd/Segment.cpp
@@ -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;
diff --git a/modules/stream_filter/dash/mpd/Segment.h b/modules/stream_filter/dash/mpd/Segment.h
index 52bce34..164a3e70 100644
--- a/modules/stream_filter/dash/mpd/Segment.h
+++ b/modules/stream_filter/dash/mpd/Segment.h
@@ -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
                 {



More information about the vlc-commits mailing list