9 #ifndef MPD_BASE_MPD_UTILS_H_
10 #define MPD_BASE_MPD_UTILS_H_
12 #include <libxml/tree.h>
17 #include "packager/base/base64.h"
18 #include "packager/base/strings/string_util.h"
19 #include "packager/mpd/base/content_protection_element.h"
20 #include "packager/mpd/base/media_info.pb.h"
21 #include "packager/mpd/base/mpd_builder.h"
23 namespace edash_packager {
26 struct ContentProtectionElement;
29 const char kEncryptedMp4Scheme[] =
"urn:mpeg:dash:mp4protection:2011";
30 const char kPsshElementName[] =
"cenc:pssh";
31 const char kEncryptedMp4Value[] =
"cenc";
33 bool HasVODOnlyFields(
const MediaInfo& media_info);
35 bool HasLiveOnlyFields(
const MediaInfo& media_info);
40 void RemoveDuplicateAttributes(
41 ContentProtectionElement* content_protection_element);
45 std::string GetCodecs(
const MediaInfo& media_info);
47 std::string SecondsToXmlDuration(
double seconds);
50 bool GetDurationAttribute(xmlNodePtr node,
float* duration);
52 bool MoreThanOneTrue(
bool b1,
bool b2,
bool b3);
53 bool AtLeastOneTrue(
bool b1,
bool b2,
bool b3);
54 bool OnlyOneTrue(
bool b1,
bool b2,
bool b3);
59 bool HexToUUID(
const std::string& data, std::string* uuid_format);
63 void UpdateContentProtectionPsshHelper(
64 const std::string& drm_uuid,
65 const std::string& pssh,
66 std::list<ContentProtectionElement>* content_protection_elements);
75 Representation* parent);
83 AdaptationSet* parent);
87 #endif // MPD_BASE_MPD_UTILS_H_
void AddContentProtectionElements(const MediaInfo &media_info, Representation *parent)
bool HexToUUID(const std::string &data, std::string *uuid_format)