9 #ifndef MPD_BASE_MPD_UTILS_H_
10 #define MPD_BASE_MPD_UTILS_H_
16 #include <libxml/tree.h>
23 struct ContentProtectionElement;
26 const char kEncryptedMp4Scheme[] =
"urn:mpeg:dash:mp4protection:2011";
27 const char kPsshElementName[] =
"cenc:pssh";
28 const char kMsproElementName[] =
"mspr:pro";
29 const uint32_t kTransferFunctionPQ = 16;
30 const uint32_t kTransferFunctionHLG = 18;
32 bool HasVODOnlyFields(
const MediaInfo& media_info);
34 bool HasLiveOnlyFields(
const MediaInfo& media_info);
39 void RemoveDuplicateAttributes(
40 ContentProtectionElement* content_protection_element);
43 std::string GetLanguage(
const MediaInfo& media_info);
47 std::string GetCodecs(
const MediaInfo& media_info);
49 std::string GetSupplementalCodecs(
const MediaInfo& media_info);
51 std::string GetSupplementalProfiles(
const MediaInfo& media_info);
55 std::string GetBaseCodec(
const MediaInfo& media_info);
58 std::string GetAdaptationSetKey(
const MediaInfo& media_info,
bool ignore_codec);
60 std::string FloatToXmlString(
double number);
62 std::string SecondsToXmlDuration(
double seconds);
65 bool GetDurationAttribute(xmlNodePtr node,
float* duration);
67 bool MoreThanOneTrue(
bool b1,
bool b2,
bool b3);
68 bool AtLeastOneTrue(
bool b1,
bool b2,
bool b3);
69 bool OnlyOneTrue(
bool b1,
bool b2,
bool b3);
74 bool HexToUUID(
const std::string& data, std::string* uuid_format);
78 void UpdateContentProtectionPsshHelper(
79 const std::string& drm_uuid,
80 const std::string& pssh,
81 std::list<ContentProtectionElement>* content_protection_elements);
90 Representation* parent);
98 AdaptationSet* parent);
All the methods that are virtual are virtual for mocking.
bool HexToUUID(const std::string &data, std::string *uuid_format)
void AddContentProtectionElements(const MediaInfo &media_info, Representation *parent)