10#ifndef MPD_BASE_XML_XML_NODE_H_
11#define MPD_BASE_XML_XML_NODE_H_
20#include <packager/macros/classes.h>
21#include <packager/mpd/base/content_protection_element.h>
22#include <packager/mpd/base/media_info.pb.h>
24typedef struct _xmlNode xmlNode;
36bool XmlEqual(
const std::string& xml1,
const xml::XmlNode& xml2);
47 explicit XmlNode(
const std::string& name);
59 [[nodiscard]]
bool AddElements(
const std::vector<Element>& elements);
65 const std::string& attribute);
77 const std::string& attribute_name,
82 [[nodiscard]]
bool SetId(uint32_t
id);
87 void AddUrlEncodedContent(
const std::string& content);
97 void SetUrlEncodedContent(
const std::string& content);
104 std::string
ToString(
const std::string& comment)
const;
110 bool GetAttribute(
const std::string& name, std::string* value)
const;
113 friend bool shaka::XmlEqual(
const std::string& xml1,
115 xmlNode* GetRawPtr()
const;
121 std::unique_ptr<Impl> impl_;
123 DISALLOW_COPY_AND_ASSIGN(
XmlNode);
132 [[nodiscard]]
bool AddContentProtectionElements(
133 const std::list<ContentProtectionElement>& content_protection_elements);
138 const std::string& value);
143 const std::string& value);
152 [[nodiscard]]
bool AddDescriptor(
const std::string& descriptor_name,
153 const std::string& scheme_id_uri,
154 const std::string& value);
157 [[nodiscard]]
bool AddContentProtectionElement(
172 const std::string& value);
176 [[nodiscard]]
bool AddRoleElement(
const std::string& scheme_id_uri,
177 const std::string& value);
199 [[nodiscard]]
bool AddVideoInfo(
const MediaInfo::VideoInfo& video_info,
202 bool set_frame_rate);
208 [[nodiscard]]
bool AddAudioInfo(
const MediaInfo::AudioInfo& audio_info);
220 bool use_segment_list,
221 double target_segment_duration);
226 const MediaInfo& media_info,
227 const std::list<SegmentInfo>& segment_infos,
228 bool low_latency_dash_mode);
233 [[nodiscard]]
bool AddAudioChannelInfo(
234 const MediaInfo::AudioInfo& audio_info);
237 [[nodiscard]]
bool AddAudioSamplingRateInfo(
238 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)
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.