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"
26 struct ContentProtectionElement;
29 const char kEncryptedMp4Scheme[] =
"urn:mpeg:dash:mp4protection:2011";
30 const char kPsshElementName[] =
"cenc:pssh";
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);
51 std::string GetBaseCodec(
const MediaInfo& media_info);
54 std::string GetAdaptationSetKey(
const MediaInfo& media_info);
56 std::string SecondsToXmlDuration(
double seconds);
59 bool GetDurationAttribute(xmlNodePtr node,
float* duration);
61 bool MoreThanOneTrue(
bool b1,
bool b2,
bool b3);
62 bool AtLeastOneTrue(
bool b1,
bool b2,
bool b3);
63 bool OnlyOneTrue(
bool b1,
bool b2,
bool b3);
73 bool HexToUUID(
const std::string& data, std::string* uuid_format);
77 void UpdateContentProtectionPsshHelper(
78 const std::string& drm_uuid,
79 const std::string& pssh,
80 std::list<ContentProtectionElement>* content_protection_elements);
89 Representation* parent);
97 AdaptationSet* parent);
101 #endif // MPD_BASE_MPD_UTILS_H_
void AddContentProtectionElements(const MediaInfo &media_info, Representation *parent)
bool HexToUUID(const std::string &data, std::string *uuid_format)
std::string DoubleToString(double value)