11 #ifndef MPD_BASE_MPD_BUILDER_H_ 12 #define MPD_BASE_MPD_BUILDER_H_ 14 #include <libxml/tree.h> 20 #include "packager/base/time/clock.h" 21 #include "packager/mpd/base/mpd_options.h" 46 void AddBaseUrl(
const std::string& base_url);
54 virtual Period* GetOrCreatePeriod(
double start_time_in_seconds);
60 virtual bool ToString(std::string* output);
67 static void MakePathsRelativeToMpd(
const std::string& mpd_path,
68 MediaInfo* media_info);
73 clock_ = std::move(clock);
82 friend class LiveMpdBuilderTest;
83 template <DashProfile profile>
84 friend class MpdBuilderTest;
89 xmlDocPtr GenerateMpd();
105 float GetStaticMpdDuration();
113 bool GetEarliestTimestamp(
double* timestamp_seconds);
116 void UpdatePeriodDurationAndPresentationTimestamp();
119 std::list<std::unique_ptr<Period>> periods_;
121 std::list<std::string> base_urls_;
122 std::string availability_start_time_;
124 uint32_t period_counter_ = 0;
125 uint32_t representation_counter_ = 0;
129 std::unique_ptr<base::Clock> clock_;
134 #endif // MPD_BASE_MPD_BUILDER_H_ This class generates DASH MPDs (Media Presentation Descriptions).
All the methods that are virtual are virtual for mocking.
void InjectClockForTesting(std::unique_ptr< base::Clock > clock)
This is for testing.