10 #ifndef MPD_BASE_XML_XML_NODE_H_
11 #define MPD_BASE_XML_XML_NODE_H_
19 #include <packager/macros/classes.h>
20 #include <packager/mpd/base/content_protection_element.h>
21 #include <packager/mpd/base/media_info.pb.h>
23 typedef struct _xmlNode xmlNode;
35 bool XmlEqual(
const std::string& xml1,
const xml::XmlNode& xml2);
46 explicit XmlNode(
const std::string& name);
58 [[nodiscard]]
bool AddElements(
const std::vector<Element>& elements);
64 const std::string& attribute);
76 const std::string& attribute_name,
81 [[nodiscard]]
bool SetId(uint32_t
id);
86 void AddUrlEncodedContent(
const std::string& content);
96 void SetUrlEncodedContent(
const std::string& content);
103 std::string
ToString(
const std::string& comment)
const;
109 bool GetAttribute(
const std::string& name, std::string* value)
const;
112 friend bool shaka::XmlEqual(
const std::string& xml1,
114 xmlNode* GetRawPtr()
const;
120 std::unique_ptr<Impl> impl_;
122 DISALLOW_COPY_AND_ASSIGN(
XmlNode);
131 [[nodiscard]]
bool AddContentProtectionElements(
132 const std::list<ContentProtectionElement>& content_protection_elements);
137 const std::string& value);
142 const std::string& value);
151 [[nodiscard]]
bool AddDescriptor(
const std::string& descriptor_name,
152 const std::string& scheme_id_uri,
153 const std::string& value);
156 [[nodiscard]]
bool AddContentProtectionElement(
171 const std::string& value);
175 [[nodiscard]]
bool AddRoleElement(
const std::string& scheme_id_uri,
176 const std::string& value);
198 [[nodiscard]]
bool AddVideoInfo(
const MediaInfo::VideoInfo& video_info,
201 bool set_frame_rate);
207 [[nodiscard]]
bool AddAudioInfo(
const MediaInfo::AudioInfo& audio_info);
219 bool use_segment_list,
220 double target_segment_duration);
225 const MediaInfo& media_info,
226 const std::list<SegmentInfo>& segment_infos,
227 bool low_latency_dash_mode);
232 [[nodiscard]]
bool AddAudioChannelInfo(
233 const MediaInfo::AudioInfo& audio_info);
236 [[nodiscard]]
bool AddAudioSamplingRateInfo(
237 const MediaInfo::AudioInfo& audio_info);
AdaptationSetType specified in MPD.
bool AddAccessibilityElement(const std::string &scheme_id_uri, const std::string &value)
bool AddLabelElement(const std::string &value)
bool AddRoleElement(const std::string &scheme_id_uri, const std::string &value)
bool AddDescriptor(const std::string &descriptor_name, const std::string &scheme_id_uri, const std::string &value)
bool AddEssentialProperty(const std::string &scheme_id_uri, const std::string &value)
bool AddSupplementalProperty(const std::string &scheme_id_uri, const std::string &value)
RepresentationType in MPD.
bool AddVODOnlyInfo(const MediaInfo &media_info, bool use_segment_list, double target_segment_duration)
bool AddLiveOnlyInfo(const MediaInfo &media_info, const std::list< SegmentInfo > &segment_infos, bool low_latency_dash_mode)
bool AddAudioInfo(const MediaInfo::AudioInfo &audio_info)
bool AddVideoInfo(const MediaInfo::VideoInfo &video_info, bool set_width, bool set_height, bool set_frame_rate)
bool AddChild(XmlNode child)
bool AddElements(const std::vector< Element > &elements)
Adds Elements to this node using the Element struct.
std::set< std::string > ExtractReferencedNamespaces() const
void AddContent(const std::string &content)
Similar to SetContent, but appends to the end of existing content.
bool SetStringAttribute(const std::string &attribute_name, const std::string &attribute)
void SetContent(const std::string &content)
XmlNode(const std::string &name)
bool SetIntegerAttribute(const std::string &attribute_name, uint64_t number)
bool GetAttribute(const std::string &name, std::string *value) const
std::string ToString(const std::string &comment) const
bool SetFloatingPointAttribute(const std::string &attribute_name, double number)
All the methods that are virtual are virtual for mocking.