9 #ifndef MPD_BASE_MPD_UTILS_H_
10 #define MPD_BASE_MPD_UTILS_H_
12 #include <libxml/tree.h>
22 struct ContentProtectionElement;
25 const char kEncryptedMp4Scheme[] =
"urn:mpeg:dash:mp4protection:2011";
26 const char kPsshElementName[] =
"cenc:pssh";
27 const char kMsproElementName[] =
"mspr:pro";
29 bool HasVODOnlyFields(
const MediaInfo& media_info);
31 bool HasLiveOnlyFields(
const MediaInfo& media_info);
36 void RemoveDuplicateAttributes(
37 ContentProtectionElement* content_protection_element);
40 std::string GetLanguage(
const MediaInfo& media_info);
44 std::string GetCodecs(
const MediaInfo& media_info);
48 std::string GetBaseCodec(
const MediaInfo& media_info);
51 std::string GetAdaptationSetKey(
const MediaInfo& media_info,
bool ignore_codec);
53 std::string SecondsToXmlDuration(
double seconds);
56 bool GetDurationAttribute(xmlNodePtr node,
float* duration);
58 bool MoreThanOneTrue(
bool b1,
bool b2,
bool b3);
59 bool AtLeastOneTrue(
bool b1,
bool b2,
bool b3);
60 bool OnlyOneTrue(
bool b1,
bool b2,
bool b3);
65 bool HexToUUID(
const std::string& data, std::string* uuid_format);
69 void UpdateContentProtectionPsshHelper(
70 const std::string& drm_uuid,
71 const std::string& pssh,
72 std::list<ContentProtectionElement>* content_protection_elements);
81 Representation* parent);
89 AdaptationSet* parent);
93 #endif // MPD_BASE_MPD_UTILS_H_