diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-08 05:09:27 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-08 05:09:27 +0000 |
commit | 08819ae89715143453b592abe0115ac1d3076003 (patch) | |
tree | 2f271a0ad88893d89a49703a5f6873ede8b5c073 /media/base/data_buffer.h | |
parent | a8076b782e9d36f69651c84d5aee2a5ae321dca7 (diff) | |
download | chromium_src-08819ae89715143453b592abe0115ac1d3076003.zip chromium_src-08819ae89715143453b592abe0115ac1d3076003.tar.gz chromium_src-08819ae89715143453b592abe0115ac1d3076003.tar.bz2 |
Add AES decryptor and tests.
For now we support decryption in video only. The first encryption key ID in ContentEncodings element will be used as the decryption key ID. Also we assume decryption key is the same as key ID.
BUG=117060
TEST=test page with encrypted content plays; added media_unittest
Review URL: http://codereview.chromium.org/9298021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/data_buffer.h')
-rw-r--r-- | media/base/data_buffer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/base/data_buffer.h b/media/base/data_buffer.h index 6c5c8a9..651088f 100644 --- a/media/base/data_buffer.h +++ b/media/base/data_buffer.h @@ -24,9 +24,13 @@ class MEDIA_EXPORT DataBuffer : public Buffer { // set to a NULL ptr. explicit DataBuffer(size_t buffer_size); + // Create a DataBuffer whose |data_| is copied from |data|. + static scoped_refptr<DataBuffer> CopyFrom(const uint8* data, size_t size); + // Buffer implementation. virtual const uint8* GetData() const OVERRIDE; virtual size_t GetDataSize() const OVERRIDE; + virtual const DecryptConfig* GetDecryptConfig() const OVERRIDE; // Returns a read-write pointer to the buffer data. virtual uint8* GetWritableData(); @@ -38,6 +42,8 @@ class MEDIA_EXPORT DataBuffer : public Buffer { // Returns the size of the underlying buffer. virtual size_t GetBufferSize() const; + virtual void SetDecryptConfig(scoped_ptr<DecryptConfig> decrypt_config); + protected: virtual ~DataBuffer(); @@ -45,6 +51,7 @@ class MEDIA_EXPORT DataBuffer : public Buffer { scoped_array<uint8> data_; size_t buffer_size_; size_t data_size_; + scoped_ptr<DecryptConfig> decrypt_config_; DISALLOW_COPY_AND_ASSIGN(DataBuffer); }; |