10 #ifndef MPD_BASE_XML_XML_NODE_H_
11 #define MPD_BASE_XML_XML_NODE_H_
20 #include "packager/base/compiler_specific.h"
21 #include "packager/base/macros.h"
22 #include "packager/mpd/base/content_protection_element.h"
23 #include "packager/mpd/base/media_info.pb.h"
25 typedef struct _xmlNode xmlNode;
37 bool XmlEqual(
const std::string& xml1,
const xml::XmlNode& xml2);
48 explicit XmlNode(
const std::string& name);
60 bool AddElements(
const std::vector<Element>& elements) WARN_UNUSED_RESULT;
66 const std::string& attribute) WARN_UNUSED_RESULT;
72 uint64_t number) WARN_UNUSED_RESULT;
78 double number) WARN_UNUSED_RESULT;
82 bool SetId(uint32_t
id) WARN_UNUSED_RESULT;
100 std::string
ToString(
const std::string& comment)
const;
106 bool GetAttribute(
const std::string& name, std::string* value)
const;
109 friend bool shaka::XmlEqual(
const std::string& xml1,
111 xmlNode* GetRawPtr()
const;
117 std::unique_ptr<Impl> impl_;
119 DISALLOW_COPY_AND_ASSIGN(
XmlNode);
128 bool AddContentProtectionElements(
129 const std::list<ContentProtectionElement>& content_protection_elements)
135 const std::string& value) WARN_UNUSED_RESULT;
140 const std::string& value) WARN_UNUSED_RESULT;
150 const std::string& scheme_id_uri,
151 const std::string& value) WARN_UNUSED_RESULT;
154 bool AddContentProtectionElement(
170 const std::string& value) WARN_UNUSED_RESULT;
175 const std::string& value) WARN_UNUSED_RESULT;
194 bool AddVideoInfo(
const MediaInfo::VideoInfo& video_info,
197 bool set_frame_rate) WARN_UNUSED_RESULT;
203 bool AddAudioInfo(
const MediaInfo::AudioInfo& audio_info) WARN_UNUSED_RESULT;
209 bool AddVODOnlyInfo(
const MediaInfo& media_info) WARN_UNUSED_RESULT;
214 const std::list<SegmentInfo>& segment_infos,
215 uint32_t start_number) WARN_UNUSED_RESULT;
220 bool AddAudioChannelInfo(
const MediaInfo::AudioInfo& audio_info)
224 bool AddAudioSamplingRateInfo(
const MediaInfo::AudioInfo& audio_info)
AdaptationSetType specified in MPD.
bool AddRoleElement(const std::string &scheme_id_uri, const std::string &value) WARN_UNUSED_RESULT
bool AddAccessibilityElement(const std::string &scheme_id_uri, const std::string &value) WARN_UNUSED_RESULT
bool AddDescriptor(const std::string &descriptor_name, const std::string &scheme_id_uri, const std::string &value) WARN_UNUSED_RESULT
bool AddSupplementalProperty(const std::string &scheme_id_uri, const std::string &value) WARN_UNUSED_RESULT
bool AddEssentialProperty(const std::string &scheme_id_uri, const std::string &value) WARN_UNUSED_RESULT
RepresentationType in MPD.
bool AddVideoInfo(const MediaInfo::VideoInfo &video_info, bool set_width, bool set_height, bool set_frame_rate) WARN_UNUSED_RESULT
bool AddVODOnlyInfo(const MediaInfo &media_info) WARN_UNUSED_RESULT
bool AddLiveOnlyInfo(const MediaInfo &media_info, const std::list< SegmentInfo > &segment_infos, uint32_t start_number) WARN_UNUSED_RESULT
bool AddAudioInfo(const MediaInfo::AudioInfo &audio_info) WARN_UNUSED_RESULT
bool AddChild(XmlNode child) WARN_UNUSED_RESULT
std::set< std::string > ExtractReferencedNamespaces() const
void AddContent(const std::string &content)
Similar to SetContent, but appends to the end of existing content.
void SetContent(const std::string &content)
bool SetFloatingPointAttribute(const std::string &attribute_name, double number) WARN_UNUSED_RESULT
bool SetIntegerAttribute(const std::string &attribute_name, uint64_t number) WARN_UNUSED_RESULT
XmlNode(const std::string &name)
bool SetStringAttribute(const std::string &attribute_name, const std::string &attribute) WARN_UNUSED_RESULT
bool GetAttribute(const std::string &name, std::string *value) const
bool SetId(uint32_t id) WARN_UNUSED_RESULT
bool AddElements(const std::vector< Element > &elements) WARN_UNUSED_RESULT
Adds Elements to this node using the Element struct.
std::string ToString(const std::string &comment) const
All the methods that are virtual are virtual for mocking.