55 using time_type = std::chrono::system_clock::time_point;
122 bool hasId()
const {
return m_id.has_value(); };
123 const std::optional<std::string> &
id()
const {
return m_id; };
124 Period &
id(
const std::nullopt_t &) { m_id.reset();
return *
this; };
125 Period &
id(
const std::string &
id) { m_id =
id;
return *
this; };
126 Period &
id(std::string &&
id) { m_id = std::move(
id);
return *
this; };
127 Period &
id(
const std::optional<std::string> &
id) { m_id =
id;
return *
this; };
128 Period &
id(std::optional<std::string> &&
id) { m_id = std::move(
id);
return *
this; };
130 bool hasStart()
const {
return m_start.has_value(); };
131 const std::optional<duration_type> &
start()
const {
return m_start; };
132 Period &
start(
const std::nullopt_t &) { m_start.reset();
return *
this; };
137 const std::optional<duration_type> &
duration()
const {
return m_duration; };
140 Period &
duration(
const std::optional<duration_type> &durn) { m_duration = durn;
return *
this; };
146 const std::list<BaseURL> &
baseURLs()
const {
return m_baseURLs; };
147 std::list<BaseURL>::const_iterator
baseURLsBegin()
const {
return m_baseURLs.cbegin(); };
148 std::list<BaseURL>::const_iterator
baseURLsEnd()
const {
return m_baseURLs.cend(); };
149 std::list<BaseURL>::iterator
baseURLsBegin() {
return m_baseURLs.begin(); };
150 std::list<BaseURL>::iterator
baseURLsEnd() {
return m_baseURLs.end(); };
172 const std::optional<SegmentBase> &
segmentBase()
const {
return m_segmentBase; };
176 Period &
segmentBase(
const std::optional<SegmentBase> &seg_base) { m_segmentBase = seg_base;
return *
this; };
177 Period &
segmentBase(std::optional<SegmentBase> &&seg_base) { m_segmentBase = std::move(seg_base);
return *
this; };
181 const std::optional<SegmentList> &
segmentList()
const {
return m_segmentList; };
185 Period &
segmentList(
const std::optional<SegmentList> &seg_list) { m_segmentList = seg_list;
return *
this; };
186 Period &
segmentList(std::optional<SegmentList> &&seg_list) { m_segmentList = std::move(seg_list);
return *
this; };
190 const std::optional<SegmentTemplate> &
segmentTemplate()
const {
return m_segmentTemplate; };
194 Period &
segmentTemplate(
const std::optional<SegmentTemplate> &seg_template) {m_segmentTemplate = seg_template;
return *
this; };
195 Period &
segmentTemplate(std::optional<SegmentTemplate> &&seg_template) {m_segmentTemplate = std::move(seg_template);
return *
this; };
199 const std::optional<Descriptor> &
assetIdentifier()
const {
return m_assetIdentifier; };
204 Period &
assetIdentifier(std::optional<Descriptor> &&asset_id) { m_assetIdentifier = std::move(asset_id);
return *
this; };
207 const std::list<EventStream> &
eventStreams()
const {
return m_eventStreams; };
208 std::list<EventStream>::const_iterator
eventStreamsBegin()
const {
return m_eventStreams.cbegin(); };
209 std::list<EventStream>::const_iterator
eventStreamsEnd()
const {
return m_eventStreams.cend(); };
243 const std::list<AdaptationSet> &
adaptationSets()
const {
return m_adaptationSets; };
244 std::list<AdaptationSet>::const_iterator
adaptationSetsBegin()
const {
return m_adaptationSets.cbegin(); };
245 std::list<AdaptationSet>::const_iterator
adaptationSetsEnd()
const {
return m_adaptationSets.cend(); };
255 const std::list<Subset> &
subsets()
const {
return m_subsets; };
256 std::list<Subset>::const_iterator
subsetsBegin()
const {
return m_subsets.cbegin(); };
257 std::list<Subset>::const_iterator
subsetsEnd()
const {
return m_subsets.cend(); };
258 std::list<Subset>::iterator
subsetsBegin() {
return m_subsets.begin(); };
259 std::list<Subset>::iterator
subsetsEnd() {
return m_subsets.end(); };
291 const std::list<Label> &
groupLabels()
const {
return m_groupLabels; };
292 std::list<Label>::const_iterator
groupLabelsBegin()
const {
return m_groupLabels.cbegin(); };
293 std::list<Label>::const_iterator
groupLabelsEnd()
const {
return m_groupLabels.cend(); };
303 const std::list<Preselection> &
preselections()
const {
return m_preselections; };
304 std::list<Preselection>::const_iterator
preselectionsBegin()
const {
return m_preselections.cbegin(); };
305 std::list<Preselection>::const_iterator
preselectionsEnd()
const {
return m_preselections.cend(); };
390 void setXMLElement(xmlpp::Element&)
const;
395 Period &setPreviousSibling(
Period *sibling) { m_previousSibling = sibling; cacheCalcClear(); sibling->cacheCalcClear();
return *
this; };
396 Period &setNextSibling(
Period *sibling) { m_nextSibling = sibling; cacheCalcClear(); sibling->cacheCalcClear();
return *
this; };
397 time_type getPeriodStartTime()
const;
398 std::optional<duration_type> getPeriodDuration()
const;
399 const MultipleSegmentBase &getMultiSegmentBase()
const;
403 void cacheCalcTimes()
const;
404 void cacheCalcClear()
const;
407 Period *m_previousSibling;
408 Period *m_nextSibling;
411 std::optional<XLink> m_xlink;
412 std::optional<std::string> m_id;
413 std::optional<duration_type> m_start;
414 std::optional<duration_type> m_duration;
415 bool m_bitstreamSwitching;
418 std::list<BaseURL> m_baseURLs;
419 std::optional<SegmentBase> m_segmentBase;
420 std::optional<SegmentList> m_segmentList;
421 std::optional<SegmentTemplate> m_segmentTemplate;
422 std::optional<Descriptor> m_assetIdentifier;
423 std::list<EventStream> m_eventStreams;
424 std::list<ServiceDescription> m_serviceDescriptions;
425 std::list<ContentProtection> m_contentProtections;
426 std::list<AdaptationSet> m_adaptationSets;
427 std::list<Subset> m_subsets;
428 std::list<Descriptor> m_supplementalProperties;
429 std::list<AdaptationSet> m_emptyAdaptationSets;
430 std::list<Label> m_groupLabels;
431 std::list<Preselection> m_preselections;
434 Cache() :calcStart(), calcDuration() {};
435 Cache(
const Cache &other) :calcStart(other.calcStart), calcDuration(other.calcDuration) {};
436 Cache(Cache &&other) :calcStart(
std::move(other.calcStart)), calcDuration(
std::move(other.calcDuration)) {};
437 Cache &operator=(
const Cache &other) { calcStart = other.calcStart; calcDuration = other.calcDuration;
return *
this; };
438 Cache &operator=(Cache &&other) { calcStart = std::move(other.calcStart); calcDuration = std::move(other.calcDuration);
return *
this; };
440 std::optional<Period::duration_type> calcStart;
441 std::optional<Period::duration_type> calcDuration;