[vlc-commits] dash: Implementing the basics for SegmentTimeline.

Hugo Beauzée-Luyssen git at videolan.org
Tue Jan 24 23:21:57 CET 2012


vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Dec 30 11:58:46 2011 +0100| [032156ee22f3a9c370075cc637705bc3bda983ce] | committer: Jean-Baptiste Kempf

dash: Implementing the basics for SegmentTimeline.

This will be usefull when implementing UrlTemplate.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 580caf1111e49d2ba9fe3c76202b92f1db8a45d7)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=032156ee22f3a9c370075cc637705bc3bda983ce
---

 modules/stream_filter/dash/Modules.am              |    2 +
 modules/stream_filter/dash/mpd/SegmentTimeline.cpp |   59 ++++++++++++++++++++
 modules/stream_filter/dash/mpd/SegmentTimeline.h   |   57 +++++++++++++++++++
 3 files changed, 118 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/Modules.am b/modules/stream_filter/dash/Modules.am
index 5b03b9d..cdf7feb 100644
--- a/modules/stream_filter/dash/Modules.am
+++ b/modules/stream_filter/dash/Modules.am
@@ -45,6 +45,8 @@ SOURCES_stream_filter_dash = \
     mpd/Segment.h \
     mpd/SegmentInfo.cpp \
     mpd/SegmentInfo.h \
+    mpd/SegmentTimeline.cpp \
+    mpd/SegmentTimeline.h \
     mpd/TrickModeType.cpp \
     mpd/TrickModeType.h \
     xml/DOMHelper.cpp \
diff --git a/modules/stream_filter/dash/mpd/SegmentTimeline.cpp b/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
new file mode 100644
index 0000000..c18e537
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
+ *****************************************************************************
+ * Copyright (C) 1998-2007 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Hugo Beauzée-Luyssen <beauze.h at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include "SegmentTimeline.h"
+
+#include <vlc_common.h>
+#include <vlc_arrays.h>
+
+using namespace dash::mpd;
+
+SegmentTimeline::SegmentTimeline() :
+    timescale( -1 )
+{
+}
+
+SegmentTimeline::~SegmentTimeline()
+{
+    vlc_delete_all( this->elements );
+}
+
+int dash::mpd::SegmentTimeline::getTimescale() const
+{
+    return this->timescale;
+}
+
+void dash::mpd::SegmentTimeline::setTimescale(int timescale)
+{
+    this->timescale = timescale;
+}
+
+void dash::mpd::SegmentTimeline::addElement(dash::mpd::SegmentTimeline::Element *e)
+{
+    this->elements.push_back( e );
+}
+
+dash::mpd::SegmentTimeline::Element::Element() :
+    r( 0 )
+{
+}
diff --git a/modules/stream_filter/dash/mpd/SegmentTimeline.h b/modules/stream_filter/dash/mpd/SegmentTimeline.h
new file mode 100644
index 0000000..f4df859
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/SegmentTimeline.h
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * SegmentTimeline.cpp: Implement the SegmentTimeline tag.
+ *****************************************************************************
+ * Copyright (C) 1998-2007 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Hugo Beauzée-Luyssen <beauze.h at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef SEGMENTTIMELINE_H
+#define SEGMENTTIMELINE_H
+
+#include <sys/types.h>
+#include <list>
+
+namespace dash
+{
+    namespace mpd
+    {
+        class SegmentTimeline
+        {
+            public:
+                struct  Element
+                {
+                    Element();
+                    int64_t     t;
+                    int64_t     d;
+                    int         r;
+                };
+                SegmentTimeline();
+                ~SegmentTimeline();
+                int                     getTimescale() const;
+                void                    setTimescale( int timescale );
+                void                    addElement( Element* e );
+
+            private:
+                int                     timescale;
+                std::list<Element*>     elements;
+        };
+    }
+}
+
+#endif // SEGMENTTIMELINE_H



More information about the vlc-commits mailing list