9#ifndef MPD_BASE_MPD_UTILS_H_
10#define MPD_BASE_MPD_UTILS_H_
16#include <libxml/tree.h>
23struct ContentProtectionElement;
26const char kEncryptedMp4Scheme[] =
"urn:mpeg:dash:mp4protection:2011";
27const char kPsshElementName[] =
"cenc:pssh";
28const char kMsproElementName[] =
"mspr:pro";
29const uint32_t kTransferFunctionPQ = 16;
30const uint32_t kTransferFunctionHLG = 18;
32bool HasVODOnlyFields(
const MediaInfo& media_info);
34bool HasLiveOnlyFields(
const MediaInfo& media_info);
39void RemoveDuplicateAttributes(
40 ContentProtectionElement* content_protection_element);
43std::string GetLanguage(
const MediaInfo& media_info);
47std::string GetCodecs(
const MediaInfo& media_info);
49std::string GetSupplementalCodecs(
const MediaInfo& media_info);
51std::string GetSupplementalProfiles(
const MediaInfo& media_info);
55std::string GetBaseCodec(
const MediaInfo& media_info);
58std::string GetAdaptationSetKey(
const MediaInfo& media_info,
bool ignore_codec);
60std::string FloatToXmlString(
double number);
62std::string SecondsToXmlDuration(
double seconds);
65bool GetDurationAttribute(xmlNodePtr node,
float* duration);
67bool MoreThanOneTrue(
bool b1,
bool b2,
bool b3);
68bool AtLeastOneTrue(
bool b1,
bool b2,
bool b3);
69bool OnlyOneTrue(
bool b1,
bool b2,
bool b3);
74bool HexToUUID(
const std::string& data, std::string* uuid_format);
78void 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)