2 * SegmentInformation.hpp
3 *****************************************************************************
4 * Copyright (C) 2014 - VideoLAN Authors
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
20 #ifndef SEGMENTINFORMATION_HPP
21 #define SEGMENTINFORMATION_HPP
23 #define __STDC_CONSTANT_MACROS
29 #include "ICanonicalUrl.hpp"
30 #include "Properties.hpp"
31 #include "SegmentInfoCommon.h"
32 #include <vlc_common.h>
42 class SegmentTemplate;
43 class SegmentTimeline;
46 /* common segment elements for period/adaptset/rep 5.3.9.1,
47 * with properties inheritance */
48 class SegmentInformation : public ICanonicalUrl,
51 friend class IsoffMainParser;
54 SegmentInformation( SegmentInformation * = 0 );
55 explicit SegmentInformation( MPD * );
56 virtual ~SegmentInformation();
57 bool canBitswitch() const;
58 virtual mtime_t getPeriodStart() const;
66 void SplitUsingIndex(std::vector<SplitPoint>&);
74 static const int InfoTypeCount = INFOTYPE_INDEX + 1;
76 ISegment * getSegment(SegmentInfoType, uint64_t = 0) const;
77 bool getSegmentNumberByTime(mtime_t, uint64_t *) const;
78 mtime_t getPlaybackTimeBySegmentNumber(uint64_t) const;
79 void collectTimelines(std::vector<SegmentTimeline *> *) const;
82 std::vector<ISegment *> getSegments() const;
83 std::vector<ISegment *> getSegments(SegmentInfoType) const;
84 std::vector<SegmentInformation *> childs;
88 void setSegmentList(SegmentList *);
89 void setSegmentBase(SegmentBase *);
90 void setSegmentTemplate(MediaSegmentTemplate *);
91 void setBitstreamSwitching(bool);
93 SegmentBase * inheritSegmentBase() const;
94 SegmentList * inheritSegmentList() const;
95 MediaSegmentTemplate * inheritSegmentTemplate() const;
97 SegmentInformation *parent;
98 SegmentBase *segmentBase;
99 SegmentList *segmentList;
100 MediaSegmentTemplate *mediaSegmentTemplate;
112 #endif // SEGMENTINFORMATION_HPP