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);
44 std::string GetLanguage(
const MediaInfo& media_info);
48 std::string GetCodecs(
const MediaInfo& media_info);
52 std::string GetBaseCodec(
const MediaInfo& media_info);
55 std::string GetAdaptationSetKey(
const MediaInfo& media_info);
57 std::string SecondsToXmlDuration(
double seconds);
60 bool GetDurationAttribute(xmlNodePtr node,
float* duration);
62 bool MoreThanOneTrue(
bool b1,
bool b2,
bool b3);
63 bool AtLeastOneTrue(
bool b1,
bool b2,
bool b3);
64 bool OnlyOneTrue(
bool b1,
bool b2,
bool b3);
69 bool HexToUUID(
const std::string& data, std::string* uuid_format);
73 void UpdateContentProtectionPsshHelper(
74 const std::string& drm_uuid,
75 const std::string& pssh,
76 std::list<ContentProtectionElement>* content_protection_elements);
85 Representation* parent);
93 AdaptationSet* parent);
97 #endif // MPD_BASE_MPD_UTILS_H_
void AddContentProtectionElements(const MediaInfo &media_info, Representation *parent)
bool HexToUUID(const std::string &data, std::string *uuid_format)