9 #ifndef PACKAGER_MPD_BASE_PERIOD_H_
10 #define PACKAGER_MPD_BASE_PERIOD_H_
15 #include "packager/base/optional.h"
16 #include "packager/mpd/base/adaptation_set.h"
17 #include "packager/mpd/base/media_info.pb.h"
18 #include "packager/mpd/base/xml/xml_node.h"
43 const MediaInfo& media_info,
44 bool content_protection_in_adaptation_set);
49 base::Optional<xml::XmlNode>
GetXml(
bool output_period_duration);
68 return trickplay_cache_;
80 uint32_t* representation_counter);
87 friend class PeriodTest;
90 virtual std::unique_ptr<AdaptationSet> NewAdaptationSet(
91 const std::string& lang,
93 uint32_t* representation_counter);
96 bool SetNewAdaptationSetAttributes(
97 const std::string& language,
98 const MediaInfo& media_info,
99 const std::list<AdaptationSet*>& adaptation_sets,
100 bool content_protection_in_adaptation_set,
111 const MediaInfo& media_info,
112 bool content_protection_in_adaptation_set,
113 std::string* adaptation_set_key);
117 std::string GetAdaptationSetKeyForTrickPlay(
const MediaInfo& media_info);
121 const double start_time_in_seconds_;
122 double duration_seconds_ = 0;
124 uint32_t*
const representation_counter_;
125 std::list<std::unique_ptr<AdaptationSet>> adaptation_sets_;
131 std::map<std::string, std::list<AdaptationSet*>> adaptation_set_list_map_;
135 std::map<std::string, std::list<AdaptationSet*>> trickplay_cache_;
138 class ProtectedAdaptationSetMap {
140 ProtectedAdaptationSetMap() =
default;
143 const MediaInfo& media_info);
147 const MediaInfo& media_info,
148 bool content_protection_in_adaptation_set);
154 ProtectedAdaptationSetMap(
const ProtectedAdaptationSetMap&) =
delete;
155 ProtectedAdaptationSetMap& operator=(
const ProtectedAdaptationSetMap&) =
159 std::map<const AdaptationSet*, MediaInfo::ProtectedContent>
160 protected_content_map_;
162 ProtectedAdaptationSetMap protected_adaptation_set_map_;
167 #endif // PACKAGER_MPD_BASE_PERIOD_H_