9 #ifndef PACKAGER_MPD_BASE_ADAPTATION_SET_H_ 10 #define PACKAGER_MPD_BASE_ADAPTATION_SET_H_ 20 #include "packager/base/optional.h" 21 #include "packager/mpd/base/xml/scoped_xml_ptr.h" 28 struct ContentProtectionElement;
61 virtual Representation* AddRepresentation(
const MediaInfo& media_info);
81 virtual void AddContentProtectionElement(
95 virtual void UpdateContentProtectionPssh(
const std::string& drm_uuid,
96 const std::string& pssh);
102 virtual void AddAccessibility(
const std::string& scheme,
103 const std::string& value);
109 virtual void AddRole(Role role);
115 xml::scoped_xml_ptr<xmlNode> GetXml();
122 virtual void ForceSetSegmentAlignment(
bool segment_alignment);
126 virtual void AddAdaptationSetSwitching(
const AdaptationSet* adaptation_set);
129 bool has_id()
const {
return static_cast<bool>(id_); }
132 uint32_t id()
const {
return id_.value(); }
149 void OnNewSegmentForRepresentation(uint32_t representation_id,
165 void OnSetFrameRateForRepresentation(uint32_t representation_id,
166 uint32_t frame_duration,
171 virtual void AddTrickPlayReference(
const AdaptationSet* adaptation_set);
174 const std::list<Representation*> GetRepresentations()
const;
177 bool IsVideo()
const;
188 uint32_t* representation_counter);
195 friend class AdaptationSetTest;
204 enum SegmentAligmentStatus {
205 kSegmentAlignmentUnknown,
206 kSegmentAlignmentTrue,
207 kSegmentAlignmentFalse
216 typedef std::map<uint32_t, std::list<uint64_t>> RepresentationTimeline;
219 void UpdateFromMediaInfo(
const MediaInfo& media_info);
229 void CheckDynamicSegmentAlignment(uint32_t representation_id,
235 void CheckStaticSegmentAlignment();
238 void RecordFrameRate(uint32_t frame_duration, uint32_t timescale);
240 std::list<ContentProtectionElement> content_protection_elements_;
243 std::map<uint32_t, std::unique_ptr<Representation>> representation_map_;
245 uint32_t*
const representation_counter_;
247 base::Optional<uint32_t> id_;
248 const std::string language_;
252 std::vector<const AdaptationSet*> switchable_adaptation_sets_;
257 std::set<uint32_t> video_widths_;
258 std::set<uint32_t> video_heights_;
266 std::map<double, std::string> video_frame_rates_;
270 std::string content_type_;
280 std::set<std::string> picture_aspect_ratio_;
283 struct Accessibility {
287 std::vector<Accessibility> accessibilities_;
290 std::set<Role> roles_;
293 SegmentAligmentStatus segments_aligned_;
294 bool force_set_segment_alignment_;
303 RepresentationTimeline representation_segment_start_times_;
309 std::vector<const AdaptationSet*> trick_play_references_;
314 #endif // PACKAGER_MPD_BASE_ADAPTATION_SET_H_
All the methods that are virtual are virtual for mocking.