9 #ifndef PACKAGER_MPD_BASE_REPRESENTATION_H_ 10 #define PACKAGER_MPD_BASE_REPRESENTATION_H_ 12 #include "packager/mpd/base/bandwidth_estimator.h" 13 #include "packager/mpd/base/media_info.pb.h" 14 #include "packager/mpd/base/segment_info.h" 15 #include "packager/mpd/base/xml/scoped_xml_ptr.h" 24 struct ContentProtectionElement;
29 class RepresentationXmlNode;
41 virtual void OnNewSegmentForRepresentation(uint64_t start_time,
42 uint64_t duration) = 0;
48 virtual void OnSetFrameRateForRepresentation(uint32_t frame_duration,
49 uint32_t timescale) = 0;
59 kSuppressFrameRate = 4,
79 virtual void AddContentProtectionElement(
93 virtual void UpdateContentProtectionPssh(
const std::string& drm_uuid,
94 const std::string& pssh);
104 virtual void AddNewSegment(uint64_t start_time,
113 virtual void SetSampleDuration(uint32_t sample_duration);
116 virtual const MediaInfo& GetMediaInfo()
const;
119 xml::scoped_xml_ptr<xmlNode> GetXml();
129 void SuppressOnce(SuppressFlag flag);
133 bool GetEarliestTimestamp(
double* timestamp_seconds)
const;
136 float GetDurationSeconds()
const;
139 uint32_t
id()
const {
return id_; }
151 const MediaInfo& media_info,
153 uint32_t representation_id,
154 std::unique_ptr<RepresentationStateChangeListener> state_change_listener);
163 uint64_t presentation_time_offset,
164 std::unique_ptr<RepresentationStateChangeListener> state_change_listener);
171 friend class RepresentationTest;
175 bool HasRequiredMediaInfoFields()
const;
179 bool IsContiguous(uint64_t start_time,
181 uint64_t size)
const;
189 std::string GetVideoMimeType()
const;
190 std::string GetAudioMimeType()
const;
191 std::string GetTextMimeType()
const;
195 MediaInfo media_info_;
196 std::list<ContentProtectionElement> content_protection_elements_;
198 std::list<SegmentInfo> segment_infos_;
201 std::string mime_type_;
208 uint32_t start_number_;
212 std::unique_ptr<RepresentationStateChangeListener> state_change_listener_;
215 int output_suppression_flags_;
220 #endif // PACKAGER_MPD_BASE_REPRESENTATION_H_
All the methods that are virtual are virtual for mocking.