Combined Decrypt Calls

(This is a merge of http://go/wvgerrit/93829,
http://go/wvgerrit/93830, http://go/wvgerrit/93832,
http://go/wvgerrit/93833, and http://go/wvgerrit/93834 from the
Widevine repo.)

This implements the CDM code changes necessary to take advantage of
Combined Decrypt Calls on OEMCrypto v16. The result of this is that
WVCryptoPlugin is much lighter now because it can pass the full sample
down to the core in one call, but CryptoSession is heavier, as it now
has to handle more complex fallback logic when devices can't handle
multiple subsamples at once.

This patch also removes support for the 'cens' and 'cbc1' schema, which
are being dropped in OEMCrypto v16. This fixes an overflow in the code
for handling those schemas by removing it entirely.

This patch also fixes the "in chunks" legacy decrypt path to use larger
chunk sizes on devices with higher resource rating tiers.

Bug: 135285640
Bug: 123435824
Bug: 138584971
Bug: 139257871
Bug: 78289910
Bug: 149361893
Test: no new CE CDM Unit Test failures
Test: Google Play plays
Test: Netflix plays
Test: no new GTS failures
Change-Id: Ic4952c9fa3bc7fd5ed08698e88254380a7a18514
This commit is contained in:
John W. Bruce
2020-02-18 14:46:31 -08:00
parent 3708c4d53f
commit a62886b925
28 changed files with 1253 additions and 1260 deletions

View File

@@ -285,10 +285,14 @@ enum {
kLoadProvisioningError = ERROR_DRM_VENDOR_MIN + 302,
kLoadLicenseError = ERROR_DRM_VENDOR_MIN + 303,
kLoadRenewalError = ERROR_DRM_VENDOR_MIN + 304,
kCannotDecryptZeroSamples = ERROR_DRM_VENDOR_MIN + 305,
kCannotDecryptZeroSubsamples = ERROR_DRM_VENDOR_MIN + 306,
kSampleAndSubsampleSizeMismatch = ERROR_DRM_VENDOR_MIN + 307,
kInvalidIvSize = ERROR_DRM_VENDOR_MIN + 308,
// This should always follow the last error code.
// The offset value should be updated each time a new error code is added.
kErrorWVDrmMaxErrorUsed = ERROR_DRM_VENDOR_MIN + 304,
kErrorWVDrmMaxErrorUsed = ERROR_DRM_VENDOR_MIN + 308,
// Used by crypto test mode
kErrorTestMode = ERROR_DRM_VENDOR_MAX,

View File

@@ -72,6 +72,10 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
// Alphabetically ordered based on the case condition.
case wvcdm::ADD_KEY_ERROR:
return kAddKeyError;
case wvcdm::CANNOT_DECRYPT_ZERO_SAMPLES:
return kCannotDecryptZeroSamples;
case wvcdm::CANNOT_DECRYPT_ZERO_SUBSAMPLES:
return kCannotDecryptZeroSubsamples;
case wvcdm::CENC_INIT_DATA_UNAVAILABLE:
return kCencInitDataUnavailable;
case wvcdm::CERT_PROVISIONING_EMPTY_SERVICE_CERTIFICATE:
@@ -230,6 +234,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kInvalidDecryptParametersEng4;
case wvcdm::INVALID_DEVICE_CERTIFICATE_TYPE:
return kInvalidDeviceCertificateType;
case wvcdm::INVALID_IV_SIZE:
return kInvalidIvSize;
case wvcdm::INVALID_KEY_SYSTEM:
return kInvalidKeySystem;
case wvcdm::INVALID_LICENSE_REQUEST_TYPE_1:
@@ -464,6 +470,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kRenewKeyError2;
case wvcdm::RESTORE_OFFLINE_LICENSE_ERROR_2:
return kRestoreOfflineLicenseError2;
case wvcdm::SAMPLE_AND_SUBSAMPLE_SIZE_MISMATCH:
return kSampleAndSubsampleSizeMismatch;
case wvcdm::SESSION_FILE_HANDLE_INIT_ERROR:
return kSessionFileHandleInitError;
case wvcdm::SESSION_KEYS_NOT_FOUND: