29 #include "AampVgdrmHelper.h"
35 const std::string AampVgdrmHelper::VGDRM_OCDM_ID =
"net.vgdrm";
46 if (jsonInitDataObj.
add(std::string(
"initData"), mDrmInfo.
initData) &&
47 jsonInitDataObj.
add(std::string(
"uri"), mDrmInfo.
keyURI) &&
48 (mPsshStr.empty() || jsonInitDataObj.
add(std::string(
"pssh"), mPsshStr)))
51 jsonInitDataObj.
print(initData);
63 if ((mDrmInfo.
keyURI.length() != 40) && (mDrmInfo.
keyURI.length() != 48))
65 AAMPLOG_ERR(
"Invalid key URI: %s", mDrmInfo.
keyURI);
70 int keyLen = std::stoi(mDrmInfo.
keyURI.substr(KEY_ID_OFFSET, 2), 0, BASE_16);
72 if ((KEY_PAYLOAD_OFFSET + (2 * keyLen)) > mDrmInfo.
keyURI.length())
74 AAMPLOG_ERR(
"Invalid key length extracted from URI: %d", keyLen);
79 keyID.reserve(keyLen);
80 for (
int i = 0; i < keyLen; i++)
82 keyID.push_back(std::stoi(mDrmInfo.
keyURI.substr(KEY_PAYLOAD_OFFSET + (2 * i), 2), 0, BASE_16));
89 licenseRequest.url =
"";
90 licenseRequest.payload =
"";
98 if (VGDRM_UUID == drmInfo.
keyFormat)
return true;
99 if (AampVgdrmHelper::VGDRM_OCDM_ID == drmInfo.
keyFormat)
return true;
102 if (((drmInfo.
keyURI.length() == 40) ||
103 (drmInfo.
keyURI.length() == 48)) &&
104 (drmInfo.
keyURI.find_first_not_of(
"0123456789abcdefABCDEF") == std::string::npos))
106 if (VGDRM_URI_START.count(drmInfo.
keyURI.substr(0,14)) != 0)
return true;
116 return std::make_shared<AampVgdrmHelper>(drmInfo, logObj);
123 systemIds.push_back(VGDRM_UUID);