1#ifndef _BBC_PARSE_DASH_MPD_SEGMENT_TEMPLATE_HH_
2#define _BBC_PARSE_DASH_MPD_SEGMENT_TEMPLATE_HH_
50 Variables(
const std::optional<std::string> &rep_id = std::nullopt,
51 const std::optional<unsigned long> &
number = std::nullopt,
52 const std::optional<unsigned int> &
bandwidth = std::nullopt,
53 const std::optional<unsigned long> &
time = std::nullopt,
54 const std::optional<unsigned long> &sub_number = std::nullopt
56 :m_representationId(rep_id)
60 ,m_subNumber(sub_number)
63 :m_representationId(other.m_representationId)
64 ,m_number(other.m_number)
65 ,m_bandwidth(other.m_bandwidth)
67 ,m_subNumber(other.m_subNumber)
70 :m_representationId(
std::move(other.m_representationId))
71 ,m_number(
std::move(other.m_number))
72 ,m_bandwidth(
std::move(other.m_bandwidth))
73 ,m_time(
std::move(other.m_time))
74 ,m_subNumber(
std::move(other.m_subNumber))
80 m_representationId = other.m_representationId;
81 m_number = other.m_number;
82 m_bandwidth = other.m_bandwidth;
83 m_time = other.m_time;
84 m_subNumber = other.m_subNumber;
89 m_representationId = std::move(other.m_representationId);
90 m_number = std::move(other.m_number);
91 m_bandwidth = std::move(other.m_bandwidth);
92 m_time = std::move(other.m_time);
93 m_subNumber = std::move(other.m_subNumber);
97 const std::optional<std::string> &
representationId()
const {
return m_representationId; };
103 const std::optional<unsigned long> &
number()
const {
return m_number; };
104 std::optional<unsigned long> &
number() {
return m_number; };
108 const std::optional<unsigned int> &
bandwidth()
const {
return m_bandwidth; };
109 std::optional<unsigned int> &
bandwidth() {
return m_bandwidth; };
113 const std::optional<unsigned long> &
time()
const {
return m_time; };
114 std::optional<unsigned long> &
time() {
return m_time; };
118 return std::chrono::duration_cast<duration_type>(std::chrono::duration<
double, std::ratio<1> >(
static_cast<double>(m_time?m_time.value():0) /
timescale));
121 const std::optional<unsigned long> &
subNumber()
const {
return m_subNumber; };
122 std::optional<unsigned long> &
subNumber() {
return m_subNumber; };
126 std::string
format(
const std::string &
format,
const std::optional<unsigned int> &start_number = std::nullopt)
const;
129 std::optional<std::string> m_representationId;
130 std::optional<unsigned long> m_number;
131 std::optional<unsigned int> m_bandwidth;
132 std::optional<unsigned long> m_time;
133 std::optional<unsigned long> m_subNumber;
153 bool hasMedia()
const {
return m_media.has_value(); };
154 const std::optional<std::string> &
media()
const {
return m_media; };
160 bool hasIndex()
const {
return m_index.has_value(); };
161 const std::optional<std::string> &
index()
const {
return m_index; };
168 const std::optional<std::string> &
initialization()
const {
return m_initialization; };
186 void setXMLElement(xmlpp::Element&)
const;
190 std::string formatTemplate(
const std::string &fmt,
const Variables &vars)
const;
194 std::optional<std::string> m_media;
195 std::optional<std::string> m_index;
196 std::optional<std::string> m_initialization;
197 std::optional<std::string> m_bitstreamSwitching;
AdaptationSet class.
Definition AdaptationSet.hh:60
Definition Representation.hh:55
const std::optional< unsigned int > & timescale() const
Definition SegmentBase.hh:58
Definition SegmentTemplate.hh:46
virtual ~Variables()
Definition SegmentTemplate.hh:77
Variables & time(unsigned long val)
Definition SegmentTemplate.hh:116
Variables & representationId(const std::nullopt_t &)
Definition SegmentTemplate.hh:99
std::optional< std::string > & representationId()
Definition SegmentTemplate.hh:98
Variables & bandwidth(unsigned int val)
Definition SegmentTemplate.hh:111
std::optional< unsigned int > & bandwidth()
Definition SegmentTemplate.hh:109
Variables(Variables &&other)
Definition SegmentTemplate.hh:69
const std::optional< unsigned long > & time() const
Definition SegmentTemplate.hh:113
Variables(const std::optional< std::string > &rep_id=std::nullopt, const std::optional< unsigned long > &number=std::nullopt, const std::optional< unsigned int > &bandwidth=std::nullopt, const std::optional< unsigned long > &time=std::nullopt, const std::optional< unsigned long > &sub_number=std::nullopt)
Definition SegmentTemplate.hh:50
std::string format(const std::string &format, const std::optional< unsigned int > &start_number=std::nullopt) const
std::optional< unsigned long > & subNumber()
Definition SegmentTemplate.hh:122
Variables & operator=(Variables &&other)
Definition SegmentTemplate.hh:88
const std::optional< std::string > & representationId() const
Definition SegmentTemplate.hh:97
Variables & bandwidth(const std::nullopt_t &)
Definition SegmentTemplate.hh:110
Variables & number(const std::nullopt_t &)
Definition SegmentTemplate.hh:105
Variables & subNumber(unsigned long val)
Definition SegmentTemplate.hh:124
Variables & operator=(const Variables &other)
Definition SegmentTemplate.hh:79
Variables & number(unsigned long val)
Definition SegmentTemplate.hh:106
const std::optional< unsigned int > & bandwidth() const
Definition SegmentTemplate.hh:108
Variables & representationId(std::string &&val)
Definition SegmentTemplate.hh:101
std::chrono::microseconds duration_type
Definition SegmentTemplate.hh:48
Variables & subNumber(const std::nullopt_t &)
Definition SegmentTemplate.hh:123
Variables & representationId(const std::string &val)
Definition SegmentTemplate.hh:100
duration_type timeAsDurationType(unsigned int timescale) const
Definition SegmentTemplate.hh:117
std::optional< unsigned long > & number()
Definition SegmentTemplate.hh:104
Variables & time(const std::nullopt_t &)
Definition SegmentTemplate.hh:115
std::optional< unsigned long > & time()
Definition SegmentTemplate.hh:114
const std::optional< unsigned long > & number() const
Definition SegmentTemplate.hh:103
Variables(const Variables &other)
Definition SegmentTemplate.hh:62
const std::optional< unsigned long > & subNumber() const
Definition SegmentTemplate.hh:121
Definition SegmentTemplate.hh:40
bool hasBitstreamSwitching() const
Definition SegmentTemplate.hh:174
SegmentTemplate & index(const std::nullopt_t &)
Definition SegmentTemplate.hh:162
SegmentTemplate & index(const std::string &val)
Definition SegmentTemplate.hh:163
SegmentTemplate & bitstreamSwitching(std::string &&val)
Definition SegmentTemplate.hh:178
SegmentTemplate(const SegmentTemplate &)
SegmentTemplate & index(std::string &&val)
Definition SegmentTemplate.hh:164
SegmentTemplate & operator=(const SegmentTemplate &)
SegmentTemplate & bitstreamSwitching(const std::string &val)
Definition SegmentTemplate.hh:177
SegmentTemplate & initialization(const std::nullopt_t &)
Definition SegmentTemplate.hh:169
bool hasMedia() const
Definition SegmentTemplate.hh:153
std::string formatInitializationTemplate(const Variables &) const
bool hasInitialization() const
Definition SegmentTemplate.hh:167
SegmentTemplate & media(const std::string &val)
Definition SegmentTemplate.hh:156
std::string formatIndexTemplate(const Variables &) const
SegmentTemplate(SegmentTemplate &&)
const std::optional< std::string > & bitstreamSwitching() const
Definition SegmentTemplate.hh:175
bool hasIndex() const
Definition SegmentTemplate.hh:160
virtual ~SegmentTemplate()
Definition SegmentTemplate.hh:140
SegmentTemplate & bitstreamSwitching(const std::nullopt_t &)
Definition SegmentTemplate.hh:176
SegmentTemplate & initialization(const std::string &val)
Definition SegmentTemplate.hh:170
const std::optional< std::string > & initialization() const
Definition SegmentTemplate.hh:168
bool operator==(const SegmentTemplate &) const
std::string formatBitstreamSwitchingTemplate(const Variables &) const
std::string formatMediaTemplate(const Variables &) const
const std::optional< std::string > & index() const
Definition SegmentTemplate.hh:161
SegmentTemplate & initialization(std::string &&val)
Definition SegmentTemplate.hh:171
SegmentTemplate & media(std::string &&val)
Definition SegmentTemplate.hh:157
SegmentTemplate & media(const std::nullopt_t &)
Definition SegmentTemplate.hh:155
SegmentTemplate & operator=(SegmentTemplate &&)
const std::optional< std::string > & media() const
Definition SegmentTemplate.hh:154
#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