]> git.sesse.net Git - vlc/blobdiff - modules/demux/dash/mpd/SegmentInformation.hpp
demux: dash: factorize timescales inheritance
[vlc] / modules / demux / dash / mpd / SegmentInformation.hpp
index b940241859bf3503315e5c011ab25409fad2d988..a4164e0a73d04d96fb33b05167cd21b243b92157 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "ICanonicalUrl.hpp"
 #include "Properties.hpp"
+#include "SegmentInfoCommon.h"
 #include <vlc_common.h>
 #include <vector>
 
@@ -39,19 +40,21 @@ namespace dash
         class SegmentBase;
         class SegmentList;
         class SegmentTemplate;
+        class SegmentTimeline;
+        class MPD;
 
         /* common segment elements for period/adaptset/rep 5.3.9.1,
          * with properties inheritance */
-        class SegmentInformation : public ICanonicalUrl
+        class SegmentInformation : public ICanonicalUrl,
+                                   public TimescaleAble
         {
             friend class IsoffMainParser;
 
             public:
                 SegmentInformation( SegmentInformation * = 0 );
-                explicit SegmentInformation( ICanonicalUrl * );
+                explicit SegmentInformation( MPD * );
                 virtual ~SegmentInformation();
                 bool canBitswitch() const;
-                uint64_t getTimescale() const;
                 virtual mtime_t getPeriodStart() const;
 
                 class SplitPoint
@@ -72,12 +75,16 @@ namespace dash
 
                 ISegment * getSegment(SegmentInfoType, uint64_t = 0) const;
                 bool getSegmentNumberByTime(mtime_t, uint64_t *) const;
+                mtime_t getPlaybackTimeBySegmentNumber(uint64_t) const;
+                void collectTimelines(std::vector<SegmentTimeline *> *) const;
 
             protected:
                 std::vector<ISegment *> getSegments() const;
                 std::vector<ISegment *> getSegments(SegmentInfoType) const;
+                std::vector<SegmentInformation *> childs;
 
             private:
+                void init();
                 void setSegmentList(SegmentList *);
                 void setSegmentBase(SegmentBase *);
                 void setSegmentTemplate(MediaSegmentTemplate *);
@@ -98,8 +105,6 @@ namespace dash
                     BITSWITCH_YES,
                     BITSWITCH_NO
                 } bitswitch_policy;
-
-                Property<uint64_t> timescale;
         };
     }
 }