зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1230026 - Support 'webm' initDataType format for MP4 ClearKey initData. r=gerald
This commit is contained in:
Родитель
ec0bb89f43
Коммит
9654972991
|
@ -209,11 +209,12 @@ MediaKeySession::GenerateRequest(const nsAString& aInitDataType,
|
|||
aInitDataType, data);
|
||||
|
||||
EME_LOG("MediaKeySession[%p,'%s'] GenerateRequest() sent, "
|
||||
"promiseId=%d initData(base64)='%s'",
|
||||
"promiseId=%d initData(base64)='%s' initDataType='%s'",
|
||||
this,
|
||||
NS_ConvertUTF16toUTF8(mSessionId).get(),
|
||||
pid,
|
||||
base64InitData.get());
|
||||
base64InitData.get(),
|
||||
NS_ConvertUTF16toUTF8(aInitDataType).get());
|
||||
|
||||
return promise.forget();
|
||||
}
|
||||
|
|
|
@ -441,9 +441,12 @@ GetSupportedConfig(mozIGeckoMediaPluginService* aGMPService,
|
|||
if (aCandidate.mInitDataTypes.WasPassed()) {
|
||||
nsTArray<nsString> initDataTypes;
|
||||
for (const nsString& candidate : aCandidate.mInitDataTypes.Value()) {
|
||||
// All supported keySystems can handle "cenc" initDataType.
|
||||
// ClearKey also supports "keyids" and "webm" initDataTypes.
|
||||
if (candidate.EqualsLiteral("cenc")) {
|
||||
initDataTypes.AppendElement(candidate);
|
||||
} else if (candidate.EqualsLiteral("keyids") &&
|
||||
} else if ((candidate.EqualsLiteral("keyids") ||
|
||||
candidate.EqualsLiteral("webm)")) &&
|
||||
aKeySystem.EqualsLiteral("org.w3.clearkey")) {
|
||||
initDataTypes.AppendElement(candidate);
|
||||
}
|
||||
|
|
|
@ -69,6 +69,11 @@ ClearKeySession::Init(uint32_t aCreateSessionToken,
|
|||
mCallback->RejectPromise(aPromiseId, kGMPAbortError, message, strlen(message));
|
||||
return;
|
||||
}
|
||||
} else if (aInitDataType == "webm" && aInitDataSize == 16) {
|
||||
// "webm" initData format is simply the raw bytes of the keyId.
|
||||
vector<uint8_t> keyId;
|
||||
keyId.assign(aInitData, aInitData+aInitDataSize);
|
||||
mKeyIds.push_back(keyId);
|
||||
}
|
||||
|
||||
if (!mKeyIds.size()) {
|
||||
|
|
|
@ -102,10 +102,13 @@ ClearKeySessionManager::CreateSession(uint32_t aCreateSessionToken,
|
|||
CK_LOGD("ClearKeySessionManager::CreateSession type:%s", aInitDataType);
|
||||
|
||||
string initDataType(aInitDataType, aInitDataType + aInitDataTypeSize);
|
||||
// initDataType must be "cenc" or "keyids".
|
||||
if (initDataType != "cenc" && initDataType != "keyids") {
|
||||
// initDataType must be "cenc", "keyids", or "webm".
|
||||
if (initDataType != "cenc" &&
|
||||
initDataType != "keyids" &&
|
||||
initDataType != "webm") {
|
||||
string message = "'" + initDataType + "' is an initDataType unsupported by ClearKey";
|
||||
mCallback->RejectPromise(aPromiseId, kGMPNotSupportedError,
|
||||
nullptr /* message */, 0 /* messageLen */);
|
||||
message.c_str(), message.size());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче