(This is a merge of https://widevine-internal-review.googlesource.com/9711 from the Widevine CDM repo.) This change updates the CDM's handling of init data types, previously known as MIME types, to comply with the latest version of the EME spec. Following this change, in addition to accepting the deprecated MIME types "video/mp4", "audio/mp4", "video/webm", and "audio/webm", the CDM will accept the new standard: Init data types "cenc" and "webm". Furthermore, this removes the non-PSSH-parsing path from the CDM. All platforms have unified on the CDM being responsible for parsing the concatenated PSSH box list, as outlined in the latest EME spec. As Android has shipped code that expects pre-unwrapped PSSH boxes and must maintain backwards-compatibility, code has been inserted on that platform to detect pre-unwrapped data and re-wrap it with a PSSH header before sending it to the CDM. There are some small changes to unit tests because of this change: 1) The CDM Engine unit test now no longer needs to unwrap the PSSH on any platforms when testing ISO-BMFF. It now pre-caches the unwrapped key ID for use when testing WebM. 2) Several substantially-similar unit tests in the Android code have been rolled into one test. Bug: 13564917 Bug: 13570595 Bug: 9465346 Bug: 13570288 Change-Id: I7f27b16b8503f24a26746b5dce71fb61b6fd1bb2
45 lines
1005 B
C++
45 lines
1005 B
C++
//
|
|
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
//
|
|
|
|
//#define LOG_NDEBUG 0
|
|
#define LOG_TAG "WVCdm"
|
|
#include <utils/Log.h>
|
|
|
|
#include "WVDrmFactory.h"
|
|
|
|
#include "utils/Errors.h"
|
|
#include "wv_cdm_constants.h"
|
|
#include "WVCDMSingleton.h"
|
|
#include "wv_content_decryption_module.h"
|
|
#include "WVDrmPlugin.h"
|
|
#include "WVUUID.h"
|
|
|
|
namespace wvdrm {
|
|
|
|
using namespace android;
|
|
|
|
WVGenericCryptoInterface WVDrmFactory::sOemCryptoInterface;
|
|
|
|
bool WVDrmFactory::isCryptoSchemeSupported(const uint8_t uuid[16]) {
|
|
return isWidevineUUID(uuid);
|
|
}
|
|
|
|
bool WVDrmFactory::isContentTypeSupported(const String8 &initDataType) {
|
|
return wvcdm::WvContentDecryptionModule::IsSupported(initDataType.string());
|
|
}
|
|
|
|
status_t WVDrmFactory::createDrmPlugin(const uint8_t uuid[16],
|
|
DrmPlugin** plugin) {
|
|
if (!isCryptoSchemeSupported(uuid)) {
|
|
*plugin = NULL;
|
|
return BAD_VALUE;
|
|
}
|
|
|
|
*plugin = new WVDrmPlugin(getCDM(), &sOemCryptoInterface);
|
|
|
|
return OK;
|
|
}
|
|
|
|
} // namespace wvdrm
|