Cache Max Subsample Size

(This is a merge of http://go/wvgerrit/95003.)

To reduce the number of OEMCrypto calls on the decrypt path, the maximum
subsample size will now be cached after the first call to retrieve it.

Bug: 150018606
Test: Android Unit Tests
Test: CE CDM Unit Tests
Test: ExoPlayer high-bitrate playback on OEC v15
Change-Id: I0b5d38d8a082c0a127d2a47f112b76c64085bddb
This commit is contained in:
John W. Bruce
2020-03-04 12:20:58 -08:00
parent d3f10ece7c
commit 1f1ba94a61
2 changed files with 28 additions and 17 deletions

View File

@@ -300,7 +300,7 @@ class CryptoSession {
CdmResponseType GetSystemIdInternal(uint32_t* system_id);
CdmResponseType GenerateRsaSignature(const std::string& message,
std::string* signature);
bool GetMaxSubsampleRegionSize(size_t* max);
size_t GetMaxSubsampleRegionSize();
bool SetDestinationBufferType();
@@ -429,6 +429,7 @@ class CryptoSession {
static std::atomic<uint64_t> request_id_index_source_;
uint32_t api_version_;
size_t max_subsample_region_size_;
// Stores the most recent error code returned from a call to
// OEMCrypto_DecryptCENC. This is used to reduce the total number of