11 #ifndef MPD_BASE_MPD_BUILDER_H_ 12 #define MPD_BASE_MPD_BUILDER_H_ 14 #include <libxml/tree.h> 20 #include "packager/base/atomic_sequence_num.h" 21 #include "packager/base/time/clock.h" 22 #include "packager/mpd/base/mpd_options.h" 47 void AddBaseUrl(
const std::string& base_url);
55 virtual Period* GetOrCreatePeriod(
double start_time_in_seconds);
61 virtual bool ToString(std::string* output);
68 static void MakePathsRelativeToMpd(
const std::string& mpd_path,
69 MediaInfo* media_info);
74 clock_ = std::move(clock);
83 friend class LiveMpdBuilderTest;
84 template <DashProfile profile>
85 friend class MpdBuilderTest;
90 xmlDocPtr GenerateMpd();
103 float GetStaticMpdDuration();
111 bool GetEarliestTimestamp(
double* timestamp_seconds);
114 std::list<std::unique_ptr<Period>> periods_;
116 std::list<std::string> base_urls_;
117 std::string availability_start_time_;
119 base::AtomicSequenceNumber period_counter_;
120 base::AtomicSequenceNumber adaptation_set_counter_;
121 base::AtomicSequenceNumber representation_counter_;
125 std::unique_ptr<base::Clock> clock_;
130 #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.