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/base/optional.h" 22 #include "packager/mpd/base/xml/scoped_xml_ptr.h" 29 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 AddRole(Role role);
108 xml::scoped_xml_ptr<xmlNode> GetXml();
115 virtual void ForceSetSegmentAlignment(
bool segment_alignment);
119 virtual void AddAdaptationSetSwitching(
const AdaptationSet* adaptation_set);
122 bool has_id()
const {
return static_cast<bool>(id_); }
125 uint32_t id()
const {
return id_.value(); }
142 void OnNewSegmentForRepresentation(uint32_t representation_id,
158 void OnSetFrameRateForRepresentation(uint32_t representation_id,
159 uint32_t frame_duration,
164 virtual void AddTrickPlayReference(
const AdaptationSet* adaptation_set);
167 const std::list<Representation*> GetRepresentations()
const;
170 bool IsVideo()
const;
181 base::AtomicSequenceNumber* representation_counter);
188 friend class AdaptationSetTest;
197 enum SegmentAligmentStatus {
198 kSegmentAlignmentUnknown,
199 kSegmentAlignmentTrue,
200 kSegmentAlignmentFalse
209 typedef std::map<uint32_t, std::list<uint64_t>> RepresentationTimeline;
212 void UpdateFromMediaInfo(
const MediaInfo& media_info);
221 void CheckLiveSegmentAlignment(uint32_t representation_id,
227 void CheckVodSegmentAlignment();
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 base::AtomicSequenceNumber*
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.