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();
106 float GetStaticMpdDuration();
114 bool GetEarliestTimestamp(
double* timestamp_seconds);
117 void UpdatePeriodDurationAndPresentationTimestamp();
120 std::list<std::unique_ptr<Period>> periods_;
122 std::list<std::string> base_urls_;
123 std::string availability_start_time_;
125 base::AtomicSequenceNumber period_counter_;
126 base::AtomicSequenceNumber representation_counter_;
130 std::unique_ptr<base::Clock> clock_;
135 #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.