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";
28 bool HasVODOnlyFields(
const MediaInfo& media_info);
30 bool HasLiveOnlyFields(
const MediaInfo& media_info);
35 void RemoveDuplicateAttributes(
36 ContentProtectionElement* content_protection_element);
39 std::string GetLanguage(
const MediaInfo& media_info);
43 std::string GetCodecs(
const MediaInfo& media_info);
47 std::string GetBaseCodec(
const MediaInfo& media_info);
50 std::string GetAdaptationSetKey(
const MediaInfo& media_info);
52 std::string SecondsToXmlDuration(
double seconds);
55 bool GetDurationAttribute(xmlNodePtr node,
float* duration);
57 bool MoreThanOneTrue(
bool b1,
bool b2,
bool b3);
58 bool AtLeastOneTrue(
bool b1,
bool b2,
bool b3);
59 bool OnlyOneTrue(
bool b1,
bool b2,
bool b3);
64 bool HexToUUID(
const std::string& data, std::string* uuid_format);
68 void UpdateContentProtectionPsshHelper(
69 const std::string& drm_uuid,
70 const std::string& pssh,
71 std::list<ContentProtectionElement>* content_protection_elements);
80 Representation* parent);
88 AdaptationSet* parent);
92 #endif // MPD_BASE_MPD_UTILS_H_ All the methods that are virtual are virtual for mocking.
void AddContentProtectionElements(const MediaInfo &media_info, Representation *parent)
bool HexToUUID(const std::string &data, std::string *uuid_format)