libmpd++
DASH MPD parsing and manipulation library
 
Loading...
Searching...
No Matches
SegmentTimeline.hh
Go to the documentation of this file.
1#ifndef _BBC_PARSE_DASH_MPD_SEGMENT_TIMELINE_HH_
2#define _BBC_PARSE_DASH_MPD_SEGMENT_TIMELINE_HH_
3/*****************************************************************************
4 * DASH MPD parsing library in C++: SegmentTimeline class
5 *****************************************************************************
6 * Copyright: (C) 2025 British Broadcasting Corporation
7 * Author(s): David Waring <david.waring2@bbc.co.uk>
8 * License: LGPLv3
9 *
10 * For full license terms please see the LICENSE file distributed with this
11 * library or refer to: https://www.gnu.org/licenses/lgpl-3.0.txt.
12 */
13#include <chrono>
14#include <optional>
15#include <list>
16
17#include "macros.hh"
18#include "FailoverContent.hh"
19#include "SingleRFC7233Range.hh"
20#include "URL.hh"
21
24// Forward declarations for types only used by pointer or reference
25namespace xmlpp {
26 class Element;
27 class Node;
28}
31
33
40public:
41 using duration_type = std::chrono::microseconds;
42
48 public:
49 S();
50 S(const S&);
51 S(S&&);
52
53 virtual ~S() {};
54
55 S &operator=(const S&);
57
58 bool operator==(const S&) const;
59
61 protected:
62 friend class SegmentTimeline;
63 S(xmlpp::Node&);
64 void setXMLElement(xmlpp::Element&) const;
66
67 private:
68 // S element type ISO 23009-1:2022 Clause 5.3.9.6.3
69 std::optional<unsigned long> m_t;
70 std::optional<unsigned long> m_n;
71 unsigned long m_d;
72 int m_r;
73 unsigned long m_k;
74 };
75
76 SegmentTimeline() :m_sLines() {};
77 SegmentTimeline(const SegmentTimeline &other) :m_sLines(other.m_sLines) {};
78 SegmentTimeline(SegmentTimeline &&other) :m_sLines(std::move(other.m_sLines)) {};
79
80 virtual ~SegmentTimeline() {};
81
82 SegmentTimeline &operator=(const SegmentTimeline &other) { m_sLines = other.m_sLines; return *this; };
83 SegmentTimeline &operator=(SegmentTimeline &&other) { m_sLines = std::move(other.m_sLines); return *this; };
84
85 bool operator==(const SegmentTimeline &other) const { return m_sLines == other.m_sLines; };
86
88protected:
89 friend class MultipleSegmentBase;
90 SegmentTimeline(xmlpp::Node&);
91 void setXMLElement(xmlpp::Element&) const;
93
94private:
95 // SegmentTimeline element from ISO 23009-1:2022 Clause 5.3.9.6.3
96 std::list<S> m_sLines;
97};
98
100
101/* vim:ts=8:sts=4:sw=4:expandtab:
102 */
103#endif /*_BBC_PARSE_DASH_MPD_SEGMENT_TIMELINE_HH_*/
Definition MultipleSegmentBase.hh:39
virtual ~S()
Definition SegmentTimeline.hh:53
Definition SegmentTimeline.hh:39
SegmentTimeline & operator=(SegmentTimeline &&other)
Definition SegmentTimeline.hh:83
SegmentTimeline(SegmentTimeline &&other)
Definition SegmentTimeline.hh:78
SegmentTimeline & operator=(const SegmentTimeline &other)
Definition SegmentTimeline.hh:82
SegmentTimeline(const SegmentTimeline &other)
Definition SegmentTimeline.hh:77
SegmentTimeline()
Definition SegmentTimeline.hh:76
std::chrono::microseconds duration_type
Definition SegmentTimeline.hh:41
virtual ~SegmentTimeline()
Definition SegmentTimeline.hh:80
bool operator==(const SegmentTimeline &other) const
Definition SegmentTimeline.hh:85
#define LIBMPDPP_NAMESPACE_END
Definition macros.hh:54
#define LIBMPDPP_PUBLIC_API
Used to mark something as part of the public API.
Definition macros.hh:21
#define LIBMPDPP_NAMESPACE_BEGIN
Definition macros.hh:50
Definition SegmentAvailability.hh:87