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

Side by Side Diff: media/base/decrypt_config.h

Issue 10535029: Add support for encrypted WebM files as defined in the RFC. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing comments in the CL. Created 8 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/base/decrypt_config.cc » ('j') | media/crypto/aes_decryptor.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_DECRYPT_CONFIG_H_ 5 #ifndef MEDIA_BASE_DECRYPT_CONFIG_H_
6 #define MEDIA_BASE_DECRYPT_CONFIG_H_ 6 #define MEDIA_BASE_DECRYPT_CONFIG_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 // Contains all information that a decryptor needs to decrypt. 14 // Contains all information that a decryptor needs to decrypt a frame.
15 class MEDIA_EXPORT DecryptConfig { 15 class MEDIA_EXPORT DecryptConfig {
16 public: 16 public:
17 explicit DecryptConfig(const uint8* key_id, int key_id_size); 17 // |key_id| is the initialization data defined in the Encrypted Media
ddorwin 2012/07/13 00:48:00 key_id is a key ID here. This is the ID that the d
fgalligan1 2012/07/13 21:40:41 Done.
18 // Extensions [1]. |iv| is the initialization vector defined by the encrypted
19 // format. |checksum| is the hash value of the encrypted buffer. |checksum|
20 // is defined by the encrypted format and may be NULL.
21 // |encrypted_frame_offset| is the offset into the encrypted buffer that the
22 // encrypted frame starts. The class will copy the data from |key_id|, |iv|,
23 // and |checksum|.
24 // [1] http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted -media.html
25 DecryptConfig(const uint8* key_id, int key_id_size,
26 const uint8* iv, int iv_size,
27 const uint8* checksum, int checksum_size,
28 int encrypted_frame_offset);
18 ~DecryptConfig(); 29 ~DecryptConfig();
19 30
31 const uint8* checksum() const { return checksum_.get(); }
ddorwin 2012/07/13 00:48:00 Move these below for consistency with new paramete
fgalligan1 2012/07/13 21:40:41 Done.
32 int checksum_size() const { return checksum_size_; }
33 const uint8* iv() const { return iv_.get(); }
34 int iv_size() const { return iv_size_; }
20 const uint8* key_id() const { return key_id_.get(); } 35 const uint8* key_id() const { return key_id_.get(); }
21 int key_id_size() const { return key_id_size_; } 36 int key_id_size() const { return key_id_size_; }
37 int encrypted_frame_offset() const { return encrypted_frame_offset_; }
22 38
23 private: 39 private:
40 // Checksum of the data to be verified before decrypting the data. This may
41 // be set to NULL for some formats.
42 scoped_array<uint8> checksum_;
43 int checksum_size_;
44
45 // Initialization vector.
46 scoped_array<uint8> iv_;
47 int iv_size_;
48
24 scoped_array<uint8> key_id_; 49 scoped_array<uint8> key_id_;
25 int key_id_size_; 50 int key_id_size_;
26 51
52 // This is the offset in bytes to where the encrypted data starts within
53 // the input buffer.
54 int encrypted_frame_offset_;
55
27 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); 56 DISALLOW_COPY_AND_ASSIGN(DecryptConfig);
28 }; 57 };
29 58
30 } // namespace media 59 } // namespace media
31 60
32 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ 61 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/decrypt_config.cc » ('j') | media/crypto/aes_decryptor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698