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;
60 virtual Representation* AddRepresentation(
const MediaInfo& media_info);
80 virtual void AddContentProtectionElement(
94 virtual void UpdateContentProtectionPssh(
const std::string& drm_uuid,
95 const std::string& pssh);
101 virtual void AddRole(Role role);
107 xml::scoped_xml_ptr<xmlNode> GetXml();
114 virtual void ForceSetSegmentAlignment(
bool segment_alignment);
118 virtual void AddAdaptationSetSwitching(
const AdaptationSet* adaptation_set);
121 bool has_id()
const {
return static_cast<bool>(id_); }
124 uint32_t id()
const {
return id_.value(); }
141 void OnNewSegmentForRepresentation(uint32_t representation_id,
157 void OnSetFrameRateForRepresentation(uint32_t representation_id,
158 uint32_t frame_duration,
163 virtual void AddTrickPlayReference(
const AdaptationSet* adaptation_set);
166 const std::list<Representation*> GetRepresentations()
const;
169 bool IsVideo()
const;
180 uint32_t* 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);
221 void CheckDynamicSegmentAlignment(uint32_t representation_id,
227 void CheckStaticSegmentAlignment();
230 void RecordFrameRate(uint32_t frame_duration, uint32_t timescale);
232 std::list<ContentProtectionElement> content_protection_elements_;
235 std::map<uint32_t, std::unique_ptr<Representation>> representation_map_;
237 uint32_t*
const representation_counter_;
239 base::Optional<uint32_t> id_;
240 const std::string language_;
244 std::vector<const AdaptationSet*> switchable_adaptation_sets_;
249 std::set<uint32_t> video_widths_;
250 std::set<uint32_t> video_heights_;
258 std::map<double, std::string> video_frame_rates_;
262 std::string content_type_;
272 std::set<std::string> picture_aspect_ratio_;
275 std::set<Role> roles_;
278 SegmentAligmentStatus segments_aligned_;
279 bool force_set_segment_alignment_;
288 RepresentationTimeline representation_segment_start_times_;
294 std::vector<const AdaptationSet*> trick_play_references_;
299 #endif // PACKAGER_MPD_BASE_ADAPTATION_SET_H_
All the methods that are virtual are virtual for mocking.