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_CRYPTO_AES_DECRYPTOR_H_ | 5 #ifndef MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
6 #define MEDIA_CRYPTO_AES_DECRYPTOR_H_ | 6 #define MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 const uint8* init_data, | 38 const uint8* init_data, |
39 int init_data_length) OVERRIDE; | 39 int init_data_length) OVERRIDE; |
40 virtual void AddKey(const std::string& key_system, | 40 virtual void AddKey(const std::string& key_system, |
41 const uint8* key, | 41 const uint8* key, |
42 int key_length, | 42 int key_length, |
43 const uint8* init_data, | 43 const uint8* init_data, |
44 int init_data_length, | 44 int init_data_length, |
45 const std::string& session_id) OVERRIDE; | 45 const std::string& session_id) OVERRIDE; |
46 virtual void CancelKeyRequest(const std::string& key_system, | 46 virtual void CancelKeyRequest(const std::string& key_system, |
47 const std::string& session_id) OVERRIDE; | 47 const std::string& session_id) OVERRIDE; |
48 // Decrypts |encrypted| buffer. |encrypted| should not be NULL. Returns a | 48 virtual void Decrypt(StreamType stream_type, |
49 // DecoderBuffer with the decrypted data if the decryption succeeded through | 49 const scoped_refptr<DecoderBuffer>& encrypted, |
50 // |decrypt_cb|. | |
51 virtual void Decrypt(const scoped_refptr<DecoderBuffer>& encrypted, | |
52 const DecryptCB& decrypt_cb) OVERRIDE; | 50 const DecryptCB& decrypt_cb) OVERRIDE; |
53 virtual void CancelDecrypt() OVERRIDE; | 51 virtual void CancelDecrypt(StreamType stream_type) OVERRIDE; |
| 52 virtual void InitializeAudioDecoder(scoped_ptr<AudioDecoderConfig> config, |
| 53 const DecoderInitCB& init_cb, |
| 54 const KeyAddedCB& key_added_cb) OVERRIDE; |
54 virtual void InitializeVideoDecoder(scoped_ptr<VideoDecoderConfig> config, | 55 virtual void InitializeVideoDecoder(scoped_ptr<VideoDecoderConfig> config, |
55 const DecoderInitCB& init_cb, | 56 const DecoderInitCB& init_cb, |
56 const KeyAddedCB& key_added_cb) OVERRIDE; | 57 const KeyAddedCB& key_added_cb) OVERRIDE; |
| 58 virtual void DecryptAndDecodeAudio( |
| 59 const scoped_refptr<DecoderBuffer>& encrypted, |
| 60 const AudioDecodeCB& audio_decode_cb) OVERRIDE; |
57 virtual void DecryptAndDecodeVideo( | 61 virtual void DecryptAndDecodeVideo( |
58 const scoped_refptr<DecoderBuffer>& encrypted, | 62 const scoped_refptr<DecoderBuffer>& encrypted, |
59 const VideoDecodeCB& video_decode_cb) OVERRIDE; | 63 const VideoDecodeCB& video_decode_cb) OVERRIDE; |
60 virtual void CancelDecryptAndDecodeVideo() OVERRIDE; | 64 virtual void ResetDecoder(StreamType stream_type) OVERRIDE; |
61 virtual void StopVideoDecoder() OVERRIDE; | 65 virtual void DeinitializeDecoder(StreamType stream_type) OVERRIDE; |
62 | 66 |
63 private: | 67 private: |
64 // TODO(fgalligan): Remove this and change KeyMap to use crypto::SymmetricKey | 68 // TODO(fgalligan): Remove this and change KeyMap to use crypto::SymmetricKey |
65 // as there are no decryptors that are performing an integrity check. | 69 // as there are no decryptors that are performing an integrity check. |
66 // Helper class that manages the decryption key. | 70 // Helper class that manages the decryption key. |
67 class DecryptionKey { | 71 class DecryptionKey { |
68 public: | 72 public: |
69 explicit DecryptionKey(const std::string& secret); | 73 explicit DecryptionKey(const std::string& secret); |
70 ~DecryptionKey(); | 74 ~DecryptionKey(); |
71 | 75 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 static uint32 next_session_id_; | 111 static uint32 next_session_id_; |
108 | 112 |
109 DecryptorClient* const client_; | 113 DecryptorClient* const client_; |
110 | 114 |
111 DISALLOW_COPY_AND_ASSIGN(AesDecryptor); | 115 DISALLOW_COPY_AND_ASSIGN(AesDecryptor); |
112 }; | 116 }; |
113 | 117 |
114 } // namespace media | 118 } // namespace media |
115 | 119 |
116 #endif // MEDIA_CRYPTO_AES_DECRYPTOR_H_ | 120 #endif // MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
OLD | NEW |