Squashed commit of the following CDM changes:

* Add additional parameters to CDM decryption API
  https://widevine-internal-review.googlesource.com/#/c/6500/

* Pass Length and Flags Parameters to Decrypt()
  https://widevine-internal-review.googlesource.com/#/c/6740/

* Remove core files from oemcrypto/mock
  https://widevine-internal-review.googlesource.com/#/c/6853/

Change-Id: I1c73f5454da20da99130b161543fb990e16e7130
This commit is contained in:
Jeff Tinker
2013-07-29 17:41:22 -07:00
parent 0190f99fb3
commit f4560f109f
24 changed files with 543 additions and 789 deletions

View File

@@ -85,16 +85,7 @@ class CdmEngine : public TimerHandler {
// Decryption and key related methods
// Accept encrypted buffer and return decrypted data.
virtual CdmResponseType Decrypt(const CdmSessionId& session_id,
bool is_encrypted,
bool is_secure,
const KeyId& key_id,
const uint8_t* encrypt_buffer,
size_t encrypt_length,
const std::vector<uint8_t>& iv,
size_t block_offset,
void* decrypt_buffer,
size_t decrypt_buffer_offset,
bool is_video);
const CdmDecryptionParameters& parameters);
// Is the key known to any session?
virtual bool IsKeyValid(const KeyId& key_id);

View File

@@ -59,11 +59,7 @@ class CdmSession {
CdmResponseType QueryKeyControlInfo(CdmQueryMap* key_info);
// Decrypt() - Accept encrypted buffer and return decrypted data.
CdmResponseType Decrypt(bool is_encrypted, bool is_secure,
const KeyId& key_id, const uint8_t* encrypt_buffer,
size_t encrypt_length, const std::vector<uint8_t>& iv,
size_t block_offset, void* decrypt_buffer,
size_t decrypt_buffer_offset, bool is_video);
CdmResponseType Decrypt(const CdmDecryptionParameters& parameters);
// License renewal
// GenerateRenewalRequest() - Construct valid renewal request for the current

View File

@@ -68,15 +68,7 @@ class CryptoSession {
// Media data path
bool SelectKey(const std::string& key_id);
CdmResponseType Decrypt(bool is_encrypted,
bool is_secure,
const uint8_t* encrypt_buffer,
size_t encrypt_length,
const std::vector<uint8_t>& iv,
size_t block_offset,
void* decrypt_buffer,
size_t decrypt_buffer_offset,
bool is_video);
CdmResponseType Decrypt(const CdmDecryptionParameters& parameters);
bool GetRandom(uint8_t* random_data, size_t data_length);

View File

@@ -41,7 +41,7 @@ enum CdmResponseType {
};
#define CORE_DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
TypeName(const TypeName&); \
void operator=(const TypeName&)
enum CdmEventType {
@@ -55,6 +55,50 @@ enum CdmLicenseType {
kLicenseTypeRelease
};
struct CdmDecryptionParameters {
bool is_encrypted;
bool is_secure;
const KeyId* key_id;
const uint8_t* encrypt_buffer;
size_t encrypt_length;
const std::vector<uint8_t>* iv;
size_t block_offset;
void* decrypt_buffer;
size_t decrypt_buffer_length;
size_t decrypt_buffer_offset;
uint8_t subsample_flags;
bool is_video;
CdmDecryptionParameters()
: is_encrypted(true),
is_secure(true),
key_id(NULL),
encrypt_buffer(NULL),
encrypt_length(0),
iv(NULL),
block_offset(0),
decrypt_buffer(NULL),
decrypt_buffer_length(0),
decrypt_buffer_offset(0),
subsample_flags(0),
is_video(true) {}
CdmDecryptionParameters(const KeyId* key, const uint8_t* encrypted_buffer,
size_t encrypted_length,
const std::vector<uint8_t>* initialization_vector,
size_t offset, void* decrypted_buffer)
: is_encrypted(true),
is_secure(true),
key_id(key),
encrypt_buffer(encrypted_buffer),
encrypt_length(encrypted_length),
iv(initialization_vector),
block_offset(offset),
decrypt_buffer(decrypted_buffer),
decrypt_buffer_length(encrypted_length),
decrypt_buffer_offset(0),
subsample_flags(0),
is_video(true) {}
};
// forward class references
class KeyMessage;
class Request;