9 #ifndef PACKAGER_MPD_BASE_ADAPTATION_SET_H_ 10 #define PACKAGER_MPD_BASE_ADAPTATION_SET_H_ 20 #include "packager/base/atomic_sequence_num.h" 21 #include "packager/mpd/base/xml/scoped_xml_ptr.h" 28 struct ContentProtectionElement;
60 virtual Representation* AddRepresentation(
const MediaInfo& media_info);
72 uint64_t presentation_time_offset);
83 virtual void AddContentProtectionElement(
97 virtual void UpdateContentProtectionPssh(
const std::string& drm_uuid,
98 const std::string& pssh);
104 virtual void AddRole(Role role);
110 xml::scoped_xml_ptr<xmlNode> GetXml();
117 virtual void ForceSetSegmentAlignment(
bool segment_alignment);
121 virtual void AddAdaptationSetSwitching(uint32_t adaptation_set_id);
124 uint32_t id()
const {
return id_; }
141 void OnNewSegmentForRepresentation(uint32_t representation_id,
157 void OnSetFrameRateForRepresentation(uint32_t representation_id,
158 uint32_t frame_duration,
164 virtual void AddTrickPlayReferenceId(uint32_t
id);
167 const std::list<Representation*> GetRepresentations()
const;
178 const std::string& lang,
180 base::AtomicSequenceNumber* representation_counter);
187 friend class AdaptationSetTest;
196 enum SegmentAligmentStatus {
197 kSegmentAlignmentUnknown,
198 kSegmentAlignmentTrue,
199 kSegmentAlignmentFalse
208 typedef std::map<uint32_t, std::list<uint64_t>> RepresentationTimeline;
211 void UpdateFromMediaInfo(
const MediaInfo& media_info);
220 void CheckLiveSegmentAlignment(uint32_t representation_id,
226 void CheckVodSegmentAlignment();
229 void RecordFrameRate(uint32_t frame_duration, uint32_t timescale);
231 std::list<ContentProtectionElement> content_protection_elements_;
234 std::map<uint32_t, std::unique_ptr<Representation>> representation_map_;
236 base::AtomicSequenceNumber*
const representation_counter_;
239 const std::string lang_;
243 std::vector<uint32_t> adaptation_set_switching_ids_;
248 std::set<uint32_t> video_widths_;
249 std::set<uint32_t> video_heights_;
257 std::map<double, std::string> video_frame_rates_;
261 std::string content_type_;
271 std::set<std::string> picture_aspect_ratio_;
274 std::set<Role> roles_;
277 SegmentAligmentStatus segments_aligned_;
278 bool force_set_segment_alignment_;
287 RepresentationTimeline representation_segment_start_times_;
293 std::set<uint32_t> trick_play_reference_ids_;
298 #endif // PACKAGER_MPD_BASE_ADAPTATION_SET_H_
All the methods that are virtual are virtual for mocking.