Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(888)

Unified Diff: media/base/decrypt_config.h

Issue 10651006: Add Common Encryption support to BMFF, including subsample decryption. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix another case issue Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/decrypt_config.cc » ('j') | media/crypto/aes_decryptor.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decrypt_config.h
diff --git a/media/base/decrypt_config.h b/media/base/decrypt_config.h
index 5fca7876d330c78c76ade6c624ba00b85b49c70c..2f61c411795e03e0cece1abc80b4d1aa1784146b 100644
--- a/media/base/decrypt_config.h
+++ b/media/base/decrypt_config.h
@@ -5,24 +5,50 @@
#ifndef MEDIA_BASE_DECRYPT_CONFIG_H_
#define MEDIA_BASE_DECRYPT_CONFIG_H_
+#include <vector>
xhwang 2012/06/27 19:37:43 nit: usually we have empty line after including c+
strobe_ 2012/07/13 00:47:07 Done.
strobe_ 2012/07/13 00:47:07 Done.
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "media/base/media_export.h"
namespace media {
+struct SubsampleEntry {
+ int clear_bytes;
+ int cypher_bytes;
+};
+
xhwang 2012/06/27 19:37:43 Can we have more docs on this? Ideally, people sho
ddorwin 2012/07/03 21:03:47 Docs on what? DecryptConfig, the parameters, or CE
xhwang 2012/07/03 21:17:12 About SubsampleEntry.
strobe_ 2012/07/13 00:47:07 Done.
// Contains all information that a decryptor needs to decrypt.
class MEDIA_EXPORT DecryptConfig {
public:
- explicit DecryptConfig(const uint8* key_id, int key_id_size);
+ DecryptConfig(const uint8* key_id, int key_id_size,
+ const uint8* iv, int iv_size,
+ const SubsampleEntry* subsamples, int subsample_count);
xhwang 2012/06/27 19:37:43 Can we just pass const std::vector<SubsampleEntry>
ddorwin 2012/07/03 21:03:47 Agreed, especially since we store and return it as
strobe_ 2012/07/13 00:47:07 Done.
+
+ // TODO(strobe): This constructor implicitly sets CBC mode and uses a default
+ // IV, to preserve compatibility with an early implementation. It should be
+ // removed, along with CBC mode and the default IV, when
+ // https://chromiumcodereview.appspot.com/10535029 lands.
+ DecryptConfig(const uint8* key_id, int key_id_size);
+
~DecryptConfig();
const uint8* key_id() const { return key_id_.get(); }
int key_id_size() const { return key_id_size_; }
+ const uint8* iv() const { return iv_.get(); }
+ int iv_size() const { return iv_size_; }
xhwang 2012/06/27 19:37:43 We have a plan to replace scoped_array with std::s
+ const std::vector<SubsampleEntry>& subsamples() const { return subsamples_; }
+ bool use_cbc() const { return use_cbc_; }
+
+ std::vector<SubsampleEntry>* mutable_subsamples() { return &subsamples_; }
private:
scoped_array<uint8> key_id_;
int key_id_size_;
+ scoped_array<uint8> iv_;
+ int iv_size_;
+ std::vector<SubsampleEntry> subsamples_;
+ // TODO(strobe): Remove when CBC is no longer used.
+ bool use_cbc_;
DISALLOW_COPY_AND_ASSIGN(DecryptConfig);
};
« no previous file with comments | « no previous file | media/base/decrypt_config.cc » ('j') | media/crypto/aes_decryptor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698