OLD | NEW |
---|---|
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 DecryptConfig(const uint8* data_to_verify, int data_to_verify_size, |
ddorwin
2012/07/10 01:12:20
It's not obvious what's being passed here. I think
ddorwin
2012/07/11 01:00:27
I now realize that offset_to_data is completely un
fgalligan1
2012/07/11 22:06:33
Done.
fgalligan1
2012/07/11 22:06:33
I want to keep them separate wrt to the decryptor
| |
18 const uint8* iv, int iv_size, | |
19 const uint8* key_id, int key_id_size, | |
20 int offset_to_data); | |
ddorwin
2012/07/10 01:12:20
offset_to_frame? encrypted_data_offset?
It's uncle
fgalligan1
2012/07/11 22:06:33
It actually shouldn't relate to the first paramete
| |
18 ~DecryptConfig(); | 21 ~DecryptConfig(); |
19 | 22 |
23 const uint8* data_to_verify() const { return data_to_verify_.get(); } | |
24 int data_to_verify_size() const { return data_to_verify_size_; } | |
25 const uint8* iv() const { return iv_.get(); } | |
26 int iv_size() const { return iv_size_; } | |
20 const uint8* key_id() const { return key_id_.get(); } | 27 const uint8* key_id() const { return key_id_.get(); } |
21 int key_id_size() const { return key_id_size_; } | 28 int key_id_size() const { return key_id_size_; } |
29 int offset_to_data() const { return offset_to_data_; } | |
22 | 30 |
23 private: | 31 private: |
32 // Data to be verified before decrypting the data. This may be set to NULL | |
33 // for some formats. | |
34 scoped_array<uint8> data_to_verify_; | |
35 int data_to_verify_size_; | |
36 | |
37 // Initialization vector. | |
38 scoped_array<uint8> iv_; | |
39 int iv_size_; | |
40 | |
24 scoped_array<uint8> key_id_; | 41 scoped_array<uint8> key_id_; |
25 int key_id_size_; | 42 int key_id_size_; |
26 | 43 |
44 // This is is the offset in bytes to where the encrypted data starts within | |
45 // the input buffer. | |
46 int offset_to_data_; | |
47 | |
27 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); | 48 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); |
28 }; | 49 }; |
29 | 50 |
30 } // namespace media | 51 } // namespace media |
31 | 52 |
32 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ | 53 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ |
OLD | NEW |