11 #ifndef MPD_BASE_MPD_BUILDER_H_
12 #define MPD_BASE_MPD_BUILDER_H_
14 #include <libxml/tree.h>
20 #include "packager/base/compiler_specific.h"
21 #include "packager/base/optional.h"
22 #include "packager/base/time/clock.h"
23 #include "packager/mpd/base/mpd_options.h"
24 #include "packager/mpd/base/xml/xml_node.h"
59 virtual bool ToString(std::string* output) WARN_UNUSED_RESULT;
67 MediaInfo* media_info);
72 clock_ = std::move(clock);
81 friend class LiveMpdBuilderTest;
82 template <DashProfile profile>
83 friend class MpdBuilderTest;
88 base::Optional<xml::XmlNode> GenerateMpd();
92 bool AddCommonMpdInfo(
xml::XmlNode* mpd_node) WARN_UNUSED_RESULT;
96 bool AddStaticMpdInfo(
xml::XmlNode* mpd_node) WARN_UNUSED_RESULT;
99 bool AddDynamicMpdInfo(
xml::XmlNode* mpd_node) WARN_UNUSED_RESULT;
102 bool AddUtcTiming(
xml::XmlNode* mpd_node) WARN_UNUSED_RESULT;
104 float GetStaticMpdDuration();
112 bool GetEarliestTimestamp(
double* timestamp_seconds) WARN_UNUSED_RESULT;
115 void UpdatePeriodDurationAndPresentationTimestamp();
118 std::list<std::unique_ptr<Period>> periods_;
120 std::list<std::string> base_urls_;
121 std::string availability_start_time_;
123 uint32_t period_counter_ = 0;
124 uint32_t representation_counter_ = 0;
128 std::unique_ptr<base::Clock> clock_;
133 #endif // MPD_BASE_MPD_BUILDER_H_